List API keys
When your CMS or website builder manages many websites, you may want to audit which API keys exist on your N1ED account and verify they are in sync with your own database: find keys you forgot to save, keys with outdated domains, or keys left after removed websites. This request of Admin API (available on Studio and higher plans) returns all API keys that belong to your account.
This is a lightweight read-only request, so you can safely call it from periodic synchronization scripts.
By default it lists only active API keys. Pass the deleted parameter to list the keys you have deleted instead — e.g. to find a key you want to undelete.
Request format
URL: https://cloud.n1ed.com/a/admin/api-key-list
Request type: POST
Content type: application/x-www-form-urlencoded
Parameters:
-
adminTokenYour secret Admin API token
-
deleted
optionalPass
trueto list deleted API keys instead of active ones.
When omitted (orfalse), only active API keys are listed.
Response format
The server will return the list of your API keys in the data section if the request succeeds, or an error code otherwise.
HTTP code: 200
Content type: application/json
Body:
{
error: null,
data: {
apiKeys: [
{
apiKey: "your-api-key",
domain: "example.com",
createdAt: 1721400000000
},
...
]
}
}
createdAt is the creation time as Unix time in milliseconds. domain can be null for API keys created without a domain.
When you request deleted API keys (deleted=true), every entry additionally contains deletedAt — the deletion time as Unix time in milliseconds.
Possible error codes:
INCORRECT-TOKEN- theadminTokenparameter has been incorrectly specified.
Sample request
Here is a sample of how to make this request from the Linux console (sh, bash, or any other shell).
curl \
-X POST https://cloud.n1ed.com/a/admin/api-key-list \
-d "adminToken=your-secret-admin-token"
Please refer to Admin API to see samples for PHP, JS, and learn how to write code for other languages.