Rotate Admin API token
When you feel your Admin API token (a key for accessing Admin API) might have been suddenly exposed to 3rd persons, or as part of periodically changing secrets for security purposes, you can change (rotate) it. Admin API token rotation may be used only with the help of Admin API available on Studio adn higher plans.
When you change Admin API token it will be rotated immediately, so you must immediately save it in the DB or you lose access to Admin API, and only support may help you then.
Request format
URL: https://cloud.n1ed.com/a/admin/admin-token-rotate
Request type: POST
Content type: application/x-www-form-urlencoded
Parameters:
-
adminTokenYour secret Admin API token
Response format
The server will return the new Admin API token in the data section if the request succeeds, or an error code otherwise.
HTTP code: 200
Content type: application/json
Body:
{
error: null,
data: {
adminToken: "rotated-admin-token"
}
}
Possible error codes:
INCORRECT-TOKEN- theadminTokenparameter has been incorrectly specified. Are you trying to rotate the same old Admin API token a second time?
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/admin-token-rotate \
-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.