Update an API key
curl --request PATCH \
--url https://go-fetch.io/api/v1/api-keys/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [],
"rate_limit": 50000,
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://go-fetch.io/api/v1/api-keys/{id}/"
payload = {
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [],
"rate_limit": 50000,
"is_active": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
scopes: [],
rate_limit: 50000,
is_active: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://go-fetch.io/api/v1/api-keys/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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"
}API keys
Update an API key
Rename it, change its scopes, rate limit or expiry. Needs the admin scope.
PATCH
/
api
/
v1
/
api-keys
/
{id}
/
Update an API key
curl --request PATCH \
--url https://go-fetch.io/api/v1/api-keys/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [],
"rate_limit": 50000,
"is_active": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://go-fetch.io/api/v1/api-keys/{id}/"
payload = {
"environment": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scopes": [],
"rate_limit": 50000,
"is_active": True,
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
scopes: [],
rate_limit: 50000,
is_active: true,
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://go-fetch.io/api/v1/api-keys/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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"
}Authorizations
Path Parameters
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Friendly name for the API key
Required string length:
1 - 255read- readwrite- writeadmin- admin
Available options:
read, write, admin Requests per hour, from 1 to 100,000. A value outside that range is refused with a 400 that names rate_limit.
Required range:
1 <= x <= 100000Response
200 - application/json
Friendly name for the API key
Maximum string length:
255read- readwrite- writeadmin- admin
Available options:
read, write, admin Requests per hour, from 1 to 100,000. A value outside that range is refused with a 400 that names rate_limit.
Required range:
1 <= x <= 100000