Create a service access token

POST
/v1/{namespace}/tokens/service

A service access token belongs to the namespace rather than a user, for use by automation.

Authorization

headerAuthorizationBearer <token>

A personal or service access token, sent as Authorization: Bearer <token>. See access tokens.

Path Parameters

namespace*string

The namespace id.

Request Body

application/json
  1. body

An access token to create. Whether it is a personal or a service token follows from the operation.

name*string

A name to recognise the token by.

permissions*array<>

The permissions the token grants. They cannot exceed the caller's own.

firewalls*array<string>

Restricts the token to these firewalls. Empty means every firewall its permissions cover.

validForHours*integer

How long the token is valid, in hours. Defaults to 12; at most two years.

Response Body

The new token. It is returned only once.

application/json
  1. response

A new access token.

token*string

The token. It is returned only here and cannot be read back later.

expiresAt*string

When the token expires.

Formatdate-time
curl -X POST 'https://eu-sov-1.bytesafecloud.eu/v1/my-namespace-id/tokens/service' \  -H 'Content-Type: application/json' \  -d '{  "firewalls": [    "npm-main"  ],  "name": "ci-pipeline",  "permissions": [    "fw:access"  ],  "validForHours": 720}'
{  "token": "sat-0b8e4d2a-7c61-4f39-a5e0-d17f3b96c482",  "expiresAt": "2026-04-01T09:30:00Z"}