Skip to content

Commit 6bb0fcf

Browse files
feat: return patch method to /keys
1 parent d242a40 commit 6bb0fcf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎docs/api-references/service-endpoints/keys-patch.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"name": "prefix",
1919
"in": "path",
2020
"required": true,
21-
"description": "Prefix of the API key to update. Passed in the URL path. This is the first 8 characters of the API key. Only these 8 characters are visible in the dashboard (the rest are masked with asterisks). You can also obtain this value via the POST method (see the `prefix` field in its response).",
21+
"description": "Prefix of the API key to update. Passed in the URL path. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the GET method (see the `prefix` field in its response).",
2222
"schema": {
2323
"type": "string",
2424
"example": "b747e891"
@@ -110,7 +110,7 @@
110110
},
111111
"prefix": {
112112
"type": "string",
113-
"description": "Key prefix. Passed in the URL path. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the POST method (see the `prefix` field in its response).",
113+
"description": "Key prefix. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the GET method (see the `prefix` field in its response).",
114114
"example": "b747e891"
115115
},
116116
"scopes": {
@@ -191,15 +191,15 @@
191191
"x-codeSamples": [
192192
{
193193
"lang": "cURL",
194-
"source": "curl -L \\\n --request PATCH \\\n --url 'https://api.aimlapi.com/v1/keys/b747e891' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"disabled\": false\n }'"
194+
"source": "curl -L \\\n --request PATCH \\\n --url 'https://api.aimlapi.com/v1/keys/<API_KEY_PREFIX>' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"disabled\": false\n }'"
195195
},
196196
{
197197
"lang": "JavaScript",
198-
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/b747e891\", {\n method: \"PATCH\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n disabled: false\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
198+
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/<API_KEY_PREFIX>\", {\n method: \"PATCH\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n disabled: false\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
199199
},
200200
{
201201
"lang": "Python",
202-
"source": "import requests\nimport json\n\n\ndef main():\n prefix = \"b747e891\"\n url = f\"https://api.aimlapi.com/v1/keys/{prefix}\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"disabled\": False\n }\n\n response = requests.patch(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
202+
"source": "import requests\nimport json\n\n\ndef main():\n url = f\"https://api.aimlapi.com/v1/keys/<API_KEY_PREFIX>\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"disabled\": False\n }\n\n response = requests.patch(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
203203
}
204204
]
205205
}

0 commit comments

Comments
 (0)