Create API tokens through the GraphQL API
Generate API tokens using the CreateApiToken GraphQL mutation and a curl request.
If you're responsible for generating API tokens within your organisation, you can streamline the process by creating them directly through the GraphQL API.
This section walks you through the process using the CreateApiToken mutation, example variables and a sample curl request for practical implementation.
CreateApiToken mutation
mutation CreateApiToken(
$name: String!
$description: String!
) {
apiClientTokenCreate(input: {
name: $name,
description: $description
}) {
errors {
...on ApiClientTokenCreateNotPermittedError {
message
}
}
item {
...on ApiClientTokenWithValue {
apiClientToken {
expiresOn
}
token
}
}
}
} Variable example
{
"name": "my-organisation-token-2025-09-08",
"description": "API token created for N-able admin."
}cURL example
curl -g \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
-d '{ "query": "mutation CreateApiToken(name: String!, description: String!) { apiClientTokenCreate(input: { name: $name, description: $description }) { errors { ...on ApiClientTokenCreateNotPermittedError { message } } item { ...on ApiClientTokenWithValue { apiClientToken { expiresOn } token } } } }", "variables": '{ "name": "my-organisation-token-2025-09-08", "description": "API token created for N-able admin." }' }' \
-i \
--verbose \
https://api.n-able.com/graphql Updated 4 days ago
What’s Next
For further information on authentication and our API tokens visit: