ReferenceStructures
ApiTokenView
The personal access token object returned by PAT endpoints.
ApiTokenView is the safe public projection of a personal access token (PAT). The raw token value and its hash are never included — the raw token is returned only once at creation time as part of CreateTokenResponse.
ApiTokenView fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Unique token identifier. Pass this to DELETE /api/v1/tokens/{token_id} to revoke. |
name | string | Human-readable label chosen at creation time (e.g. "ci-deploy"). |
prefix | string | First 16 characters of the raw token value (display only). Prefix hzel_. |
last_used_at | string (ISO 8601) | null | UTC timestamp of the last successful authentication using this token. null if the token has never been used. |
expires_at | string (ISO 8601) | null | Absolute expiry timestamp. null if the token never expires. |
created_at | string (ISO 8601) | UTC timestamp when the token was created. |
revoked_at | string (ISO 8601) | null | UTC timestamp when the token was revoked. null if the token is still active. |
Example (ApiTokenView)
{
"id": "c9d8e7f6-0000-0000-0000-000000000001",
"name": "ci-deploy",
"prefix": "hzel_AbCdEfGhIjKlMnOp",
"last_used_at": "2025-06-20T08:00:00Z",
"expires_at": "2026-12-31T00:00:00Z",
"created_at": "2025-06-15T09:00:00Z",
"revoked_at": null
}CreateTokenResponse
Returned only by POST /api/v1/tokens. Contains all ApiTokenView fields plus the one-time token field, serialized as a flat object.
| Field | Type | Description |
|---|---|---|
token | string | The raw token value — returned only at creation. Prefix hzel_. Store it immediately. |
(all ApiTokenView fields) | See above. |
{
"token": "hzel_AbCdEfGhIjKlMnOpQrStUvWxYz01234567",
"id": "c9d8e7f6-0000-0000-0000-000000000001",
"name": "ci-deploy",
"prefix": "hzel_AbCdEfGhIjKlMnOp",
"last_used_at": null,
"expires_at": "2026-12-31T00:00:00Z",
"created_at": "2025-06-15T09:00:00Z",
"revoked_at": null
}