vlayervlayer docs
API reference

Tokens

Create, list and revoke API tokens

List API tokens

List all API tokens for the authenticated user. Token values are not returned.

GET
/auth/tokens

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

curl -X GET "//auth/tokens" \
  -H "Authorization: Bearer <token>"

Token list

{
  "data": [
    {
      "id": 1,
      "name": "My API Token",
      "lastUsedAt": "2019-08-24T14:15:22Z",
      "expiresAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ]
}

Create API token

Create a new API token. The raw token value is only returned once — store it securely.

POST
/auth/tokens

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Request Body

application/jsonRequired
nameRequiredstring
Minimum length: 1Maximum length: 255
expiresInDaysinteger

Optional. Token expires after this many days.

Minimum: 1
curl -X POST "//auth/tokens" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Token",
    "expiresInDays": 90
  }'

Token created

{
  "data": {
    "id": 1,
    "token": "<API_TOKEN>",
    "name": "My API Token",
    "expiresAt": "2026-05-01T00:00:00.000Z"
  }
}

Revoke API token

DELETE
/auth/tokens/{id}

Authorization

AuthorizationRequiredBearer <token>

API token. Send it as Authorization: Bearer <API_TOKEN>.

In: header

Path Parameters

idRequiredinteger
curl -X DELETE "//auth/tokens/{id}" \
  -H "Authorization: Bearer <token>"

Token revoked

{
  "ok": true
}

Last updated on