Skip to main content
POST
/
api_keys
Create API Key
curl --request POST \
  --url https://api.attention.tech/v2/api_keys \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Admin API Key",
  "orgLevel": true
}'
{
  "id": "e5323e40-xxxx-4f6f-84f6-85eba56091ed",
  "name": "Admin API Key",
  "organizationUUID": "16b78cec-xxxx-46d2-8213-5d3bb7d2571c",
  "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30",
  "lastSeenAt": "2024-03-20T10:00:00Z"
}

Authorizations

Authorization
string
header
required

Body

Details of the application for which to generate the API key.

name
string
required

The name of the API key

orgLevel
boolean
required

Whether the API key is organization-level or user-level

Response

Successfully created API key

id
string
required

The unique identifier of the API key

name
string
required

The name of the API key

organizationUUID
string
required

The UUID of the organization this API key belongs to, if applicable

userUUID
string
required

The UUID of the user this API key belongs to, if applicable

value
string
required

The actual API key value

lastSeenAt
string<date-time>
required

The last time this API key was used