Skip to main content
API keys let you authenticate requests without using your email and password. All API key endpoints require a valid Bearer JWT in the Authorization header.

Create an API key

POST https://api.agentity.to/auth/api-keys Create a new API key associated with your account. Give each key a unique nickname so you can identify it later.

Request

Authorization
string
required
Bearer <accessToken> — your JWT access token from the Login endpoint.
nickname
string
required
A human-readable label for this key (e.g. "production-agent"). Must be unique across your API keys.

Response

Copy the key value immediately. It is only returned once and cannot be retrieved again.
id
integer
required
Unique numeric identifier for this API key.
nickname
string
required
The label you assigned to this key.
key
string
required
The API key value. Store this securely — it will not be shown again.
createdAt
string
required
ISO 8601 timestamp of when the key was created.
updatedAt
string
required
ISO 8601 timestamp of the last update.
curl -X POST https://api.agentity.to/auth/api-keys \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{"nickname": "production-agent"}'
{
  "id": 42,
  "nickname": "production-agent",
  "key": "agk_live_abc123def456...",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z"
}

List API keys

GET https://api.agentity.to/auth/api-keys Retrieve all API keys associated with your account. The actual key values are not returned — only metadata.

Request

Authorization
string
required
Bearer <accessToken> — your JWT access token.

Response

apiKeys
object[]
required
Array of API key objects.
curl -X GET https://api.agentity.to/auth/api-keys \
  -H "Authorization: Bearer <accessToken>"
{
  "apiKeys": [
    {
      "id": 42,
      "nickname": "production-agent",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    },
    {
      "id": 43,
      "nickname": "staging-agent",
      "createdAt": "2024-02-01T00:00:00.000Z",
      "updatedAt": "2024-02-01T00:00:00.000Z"
    }
  ]
}

Delete an API key

DELETE https://api.agentity.to/auth/api-keys/:id Permanently delete an API key by its ID. Any requests using this key will immediately stop working.

Request

Authorization
string
required
Bearer <accessToken> — your JWT access token.
id
integer
required
The numeric ID of the API key to delete. Use the List API keys endpoint to look up key IDs.

Response

Returns 200 OK with a confirmation message.

Errors

StatusDescription
401Missing or invalid access token, or the key belongs to a different account.
404No API key found with the given ID.
curl -X DELETE https://api.agentity.to/auth/api-keys/42 \
  -H "Authorization: Bearer <accessToken>"
{
  "message": "API key deleted successfully"
}