Skip to main content

createApiKey

Requires at least one of the permissions settings:api:create or settings:tenant:update.

Generate a new API key. The full key is only shown once. Requires permission to create API keys or update tenant settings.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateApiKey($input: CreateApiKeyInputGql!) {
createApiKey(input: $input) {
id
name
createdAt
allowedIps
expiresAt
isActive
}
}

Variables:

{
"input": {
"name": "string"
}
}

Response:

{
"data": {
"createApiKey": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"allowedIps": [
"string"
],
"expiresAt": "2025-01-15T00:00:00Z",
"isActive": true
}
}
}
createApiKey(
input: CreateApiKeyInputGql!
): ApiKeyResult!

Arguments​

createApiKey.input ● CreateApiKeyInputGql! non-null input​

The details of the api key to create.

Type​

ApiKeyResult object​

An API key. The full key is never shown again after it is created.