Rotate an API key
curl --request POST \
--url https://go-fetch.io/api/v1/api-keys/{id}/rotate/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://go-fetch.io/api/v1/api-keys/{id}/rotate/"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://go-fetch.io/api/v1/api-keys/{id}/rotate/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"api_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_name": "<string>",
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_name": "<string>",
"environment_slug": "<string>",
"name": "<string>",
"prefix": "<string>",
"scopes": [
"read"
],
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"rate_limit": 50000,
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
},
"raw_key": "<string>"
}API keys
Rotate an API key
Revokes the key and issues a new one with the same name, scopes, rate limit and environment. raw_key is the new key, shown this once. Needs the admin scope.
POST
/
api
/
v1
/
api-keys
/
{id}
/
rotate
/
Rotate an API key
curl --request POST \
--url https://go-fetch.io/api/v1/api-keys/{id}/rotate/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://go-fetch.io/api/v1/api-keys/{id}/rotate/"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://go-fetch.io/api/v1/api-keys/{id}/rotate/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"api_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_name": "<string>",
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_name": "<string>",
"environment_slug": "<string>",
"name": "<string>",
"prefix": "<string>",
"scopes": [
"read"
],
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"rate_limit": 50000,
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
},
"raw_key": "<string>"
}