CLI Tokens
CLI tokens (dpl_…) are long-lived, revocable credentials for the deplo CLI, CI pipelines, and any script talking to this API. A token created here authenticates every endpoint in this reference, exactly like a dashboard JWT.
Tokens never expire — they work until revoked. Only a SHA-256 hash is stored server-side, so the raw token is shown exactly once, at creation. The auth middleware recognises the dpl_ prefix and resolves the owner by hash lookup instead of verifying a JWT; see Authentication and the CLI authentication guide.
Creates a new CLI token. The response is the only time the raw token is ever returned — store it immediately. The name is trimmed and capped at 64 characters; an empty name returns 400 VALIDATION_ERROR.
| Field | Type | Description |
|---|---|---|
| name | string | Required. A label to recognise the token by, e.g. the machine or pipeline it lives on. |
curl -X POST https://www.deplo.in/api/v1/cli-tokens \
-H "Authorization: Bearer $DEPLO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"github-actions"}'{
"id": "cm5xd6e7f0004njk8x2y3z4a5",
"name": "github-actions",
"token": "dpl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"createdAt": "2026-08-07T09:24:37.000Z"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Token name is required"
}
}token value cannot be retrieved again — only its SHA-256 hash is persisted, so even a database leak never exposes usable credentials. If a token is lost, revoke it and create a new one.Lists the authenticated user's tokens, newest first — names and usage metadata only, never the token value.
| Field | Type | Description |
|---|---|---|
| id | string | Token id (cuid) — used to revoke. |
| name | string | The label given at creation. |
| lastUsedAt | string | null | When the token last authenticated a request; null if never used. |
| createdAt | string | ISO creation timestamp. |
curl https://www.deplo.in/api/v1/cli-tokens \
-H "Authorization: Bearer $DEPLO_TOKEN"{
"tokens": [
{
"id": "cm5xd6e7f0004njk8x2y3z4a5",
"name": "github-actions",
"lastUsedAt": "2026-08-07T08:59:02.000Z",
"createdAt": "2026-08-07T09:24:37.000Z"
},
{
"id": "cm5xd0a1b0003njk8m6n7o8p9",
"name": "work-laptop",
"lastUsedAt": null,
"createdAt": "2026-08-01T14:12:20.000Z"
}
]
}Revokes a token immediately — requests using it fail with 401 from the next call on. Returns 204 with no body, or 404 if the id does not exist or belongs to another user.
curl -X DELETE https://www.deplo.in/api/v1/cli-tokens/cm5xd0a1b0003njk8m6n7o8p9 \
-H "Authorization: Bearer $DEPLO_TOKEN"HTTP/1.1 204 No Content