REST API
API Tokens
Manage service-account API tokens — the bearer tokens used for server-to-server integrations (the same auth method used by the examples throughout this reference). Creating a token provisions a hidden service account with the admin role in the current company; the token value is shown exactly once, in the create response. Deleting a token also removes the underlying service account.
Endpoints
| Method | Path | Summary |
|---|---|---|
| GET | /v1/api-tokensList API tokens | List API tokens |
| POST | /v1/api-tokensCreate an API token | Create an API token |
| GET | /v1/api-tokens/{id}Get an API token | Get an API token |
| PUT | /v1/api-tokens/{id}Update a token's name/description | Update a token's name/description |
| DELETE | /v1/api-tokens/{id}Delete an API token (and its service account) | Delete an API token (and its service account) |
Examples
Create an API token
Request
bash
curl -X POST https://api.aisar.app/v1/api-tokens \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "n8n Integration",
"description": "Server-to-server token for the n8n automation"
}'Response
json
{
"data": {
"id": 42,
"name": "n8n Integration",
"description": "Server-to-server token for the n8n automation",
"created_at": "2026-03-15T10:00:00.000000Z",
"token": "42|aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789abcdefg"
}
}List tokens
Request
bash
curl https://api.aisar.app/v1/api-tokens \
-H "Authorization: Bearer YOUR_API_TOKEN"Response
json
{
"data": [
{
"id": 42,
"name": "n8n Integration",
"description": "Server-to-server token for the n8n automation",
"created_at": "2026-03-15T10:00:00.000000Z",
"last_used_at": "2026-03-16T08:12:44.000000Z"
}
]
}