Skip to content

Create an API key for an application

OpenAPI JSON
POST
/v1/apps/{app}/api-keys
curl --request POST \
--url https://api.eu.apigami.com/v1/apps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example" }'

The secret is returned once, never again. A dashboard session or personal access token only: an agent token and an OAuth token are refused with 403, so an AI assistant asks the person to create the key in the dashboard.

app
required
string format: uuid
Media typeapplication/json
object
name
required
string
>= 1 characters <= 200 characters
Examplegenerated
{
"name": "example"
}

The key, shown once.

Media typeapplication/json
object
id
required
string format: uuid
secret
required

apg_ followed by the key.

string
Examplegenerated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"secret": "example"
}

An agent token or an OAuth token.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "an agent token cannot administer the account; ask the user to do it in the dashboard"
}

Not an application of your team.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "not found"
}