Project tokens

Token

Token by ID.

GEThttps://cloud-api.calyptia.com/v1/project_tokens/{tokenID}
Authorization
Path parameters
tokenID*string (uuid)
Response

OK

Body
id*string (uuid)
token*string
Example: "redacted"
name*string
Example: "my-token"
permissions*array of Permission (enum)
createdAt*string (date-time)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/project_tokens/{tokenID}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "token": "redacted",
  "name": "my-token",
  "permissions": [
    "create:*"
  ],
  "createdAt": "2024-10-16T08:49:08.624Z"
}

Delete token

Delete token by its ID.

DELETEhttps://cloud-api.calyptia.com/v1/project_tokens/{tokenID}
Authorization
Path parameters
tokenID*string (uuid)
Response

No Content

Request
const response = await fetch('https://cloud-api.calyptia.com/v1/project_tokens/{tokenID}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();

Update token

Update token by its ID.

PATCHhttps://cloud-api.calyptia.com/v1/project_tokens/{tokenID}
Authorization
Path parameters
tokenID*string (uuid)
Body
namenullable string
Example: "new-token"
permissionsnullable array of Permission (enum)

An empty list means it has all permissions.

Response

No Content

Request
const response = await fetch('https://cloud-api.calyptia.com/v1/project_tokens/{tokenID}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();