Skills
Log in

Create an API token

API-only: a persisted role-backed API token creates a token with the calling role or a selected role with equal or narrower permissions and restrictions at issuance. Selected-role membership is not required. Role changes remain live. Requires the API token creation feature and grant-token-via-api permission. Expiring callers can only create tokens that expire earlier; unexpiring callers may create unexpiring tokens. Revocation is independent. Delegated tokens cannot create further tokens, regardless of role permissions. A delegated token has a fixed expiry that neither its own rotation nor parent rotation extends.

Required permission

Account > Admin > ApiTokens > Grant Token Via Api

Request body

  • {object}
    • name

      string required
      min length
      3
      max length
      100
      pattern
      ^[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*$
    • description

      string
      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • roleId

      string
      Selected role ID. Omit with roleType to inherit the calling role.
      pattern
      ^[A-Za-z0-9-]+$
    • roleType

      string
      one of
      org, team
    • expiresAt

      string | null
      Must precede the calling credential expiry. Omit or use null for no expiry when the caller is unexpiring.

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
      • id

        string required
      • token

        string required
      • expiresAt

        string | null required

POST /v1/tokens

POST /v1/teams/{teamId}/tokens

Example request

Request body
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"string"}' \
  "https://api.northflank.com/v1/tokens"

Example response

200 OK

The created API token. Store the credential securely.

JSON

{
  "data": {
    "id": "string",
    "token": "string",
    "expiresAt": "1970-01-01T00:00:00.000Z"
  }
}

© 2026 Northflank Ltd. All rights reserved.

northflank.com / Terms / Privacy / feedback@northflank.com