/organization/apikeys/{apiKeyId}/update v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Organizations
postOrganizationApiKeysIdUpdate
Code samples
const inputBody = '{
"params": {
"name": "Updated API Key",
"scopes": "read,write",
"keyType": "full-access",
"approvedIpAddresses": [
{
"ipAddress": "192.168.1.101",
"description": "New Office IP"
}
],
"expires": "2026-01-01T00:00:00Z"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/organization/apikeys/{apiKeyId}/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /organization/apikeys/{apiKeyId}/update
Update an existing API key for the organization
Updates the API key’s name, scopes, key type, approved IP addresses, and expiration date. Requires admin role and professional or enterprise subscription.
Body parameter
{
"params": {
"name": "Updated API Key",
"scopes": "read,write",
"keyType": "full-access",
"approvedIpAddresses": [
{
"ipAddress": "192.168.1.101",
"description": "New Office IP"
}
],
"expires": "2026-01-01T00:00:00Z"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| apiKeyId | path | string(objectId) | true | The ID of the API key to update |
| body | body | object | true | none |
| » params | body | object | false | none |
| »» name | body | string | true | Name or label for the API key |
| »» scopes | body | string | true | Comma-separated list of scopes or permissions |
| »» keyType | body | string | true | Type of the key (e.g., read-only, full-access) |
| »» approvedIpAddresses | body | [object] | false | Optional list of approved IP addresses allowed to use this key |
| »»» ipAddress | body | string | false | IP address allowed |
| »»» description | body | string | false | Description of the IP address |
| »» expires | body | string(date-time) | false | Optional expiration date of the API key |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | API key updated successfully | None |
| 500 | Internal Server Error | Internal server error | string |
