/organization/apikeys 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
getOrganizationApiKey
Code samples
const headers = {
Accept: "application/json",
};
fetch("https://goldleaf.app/api/v1/organization/apikeys", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /organization/apikeys
Retrieve API keys for the organization
Returns a list of API keys associated with the organization. Requires admin role and professional or enterprise subscription.
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | A list of API keys | None |
| 500 | Internal Server Error | Internal server error | string |
Response Schema
postOrganizationApiKeys
Code samples
const inputBody = '{
"params": {
"name": "My API Key",
"scopes": "read,write",
"keyType": "full-access",
"approvedIpAddresses": [
{
"ipAddress": "192.168.1.100",
"description": "Office IP"
}
],
"expires": "2025-12-31T23:59:59Z"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/organization/apikeys',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /organization/apikeys
Create a new API key for the organization
Generates a new API key with specified name, scopes, and key type. Requires admin role and professional or enterprise subscription.
Body parameter
{
"params": {
"name": "My API Key",
"scopes": "read,write",
"keyType": "full-access",
"approvedIpAddresses": [
{
"ipAddress": "192.168.1.100",
"description": "Office IP"
}
],
"expires": "2025-12-31T23:59:59Z"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| 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 for the API key |
| »» 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 |
|---|---|---|---|
| 201 | Created | API key created successfully | None |
| 500 | Internal Server Error | Internal server error | string |
