Auth Service icon

Auth Service

Interact with an Auth Service instance — validate tokens, manage zones and tokens

Create Token

AI-generated

Summary

Creates a new API token in an Auth Service instance by POSTing a name, zone grants, and optional expiry to the /tokens endpoint. Requires the tokens:write scope.

Inputs

  • Token Name (required) — Label for the new token, sent as name.
  • Grants (required) — One or more Zone + Level pairs. Zone is picked from zones loaded from the instance (GET /tokens/zones). Level is Read, Write, Delete or All. Sent as a list of {area, level}.
  • Expires At — Optional ISO 8601 expiration date. Sent as expiresAt only if set; otherwise the field is omitted.

Output shape

One output item per input item, containing the JSON response returned by the Auth Service's POST /tokens endpoint.

The exact response fields are not defined in the node. The response will likely include the new token's details, but check it against your instance. Authentication uses the authServiceApi credential, and its base URL is used for the request. If Continue On Fail is enabled, a failed item returns {error, operation} instead of throwing.

Examples

Example 1: Issue a read-only token for a service that reads orders.

Token Name: 'orders-reader'; Grants: one grant with Zone 'orders' and Level 'read'; Expires At left empty.

Example 2: Create a temporary token with broader access.

Token Name: 'billing-temp'; Grants: 'billing' with level 'write' and 'orders' with level 'read'; Expires At: 2026-12-31T23:59:59Z.

Links

Discussion