/\ ATFGraph /docs
README Downloads
HTTP API & schemas / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Auth API

Operations grouped under this contract tag.

Operations

OperationMethodPath
listApiTokensGET/api/v2/auth/tokens
createApiTokenPOST/api/v2/auth/tokens
revokeApiTokenDELETE/api/v2/auth/tokens/{id}
rotateApiTokenPOST/api/v2/auth/tokens/{id}/rotate

listApiTokens

GET /api/v2/auth/tokens

Requires: admin role

Every API token of the caller's namespace, newest first, without secrets: only the 8-character prefix, principal, roles, label, expiry, revocation and last use (refreshed at most once a minute) are shown. Tokens from atfgraph.yaml are not listed; they are configuration, not store rows.

Generated Python client internals: atfgraph._generated.api.auth_api.AuthApi.list_api_tokens()

Responses

StatusBodyMeaning
200ApiTokenListSuccessful operation
400ErrorResponseStructured API error
401ErrorResponseMissing or invalid credentials
403ErrorResponseRole or ownership denied
404ErrorResponseResource unavailable to this identity
409ErrorResponseRevision, idempotency, immutable version or lease conflict
413ErrorResponseStructured API error
422ErrorResponseCapability input/output schema violation
429ErrorResponseCapacity exceeded
500ErrorResponseStructured API error
503ErrorResponseStructured API error

Example response 200

{
  "items": [
    {
      "active": false,
      "created_at": 0,
      "created_by": "string",
      "expires_at": 0,
      "id": "string",
      "label": "string",
      "last_used_at": 0,
      "prefix": "string",
      "principal": "string",
      "revoked_at": 0,
      "roles": [
        "string"
      ],
      "rotated_from": "string"
    }
  ]
}

createApiToken

POST /api/v2/auth/tokens

Requires: admin role

Issue a bearer credential for a principal of the caller's namespace with the given roles (admin, invoke, worker) and optional label and expiry. The plaintext token is in this response only; the server stores its SHA-256 and never logs it. Configured tokens (atfgraph.yaml auth.tokens) stay authoritative and are checked first; a stored token is consulted only when no configured token matches. Namespaces hold at most 1024 tokens (422 api_tokens_full).

Generated Python client internals: atfgraph._generated.api.auth_api.AuthApi.create_api_token()

Request body

ApiTokenCreate (required)

{
  "principal": "string",
  "roles": [
    "string"
  ]
}

Responses

StatusBodyMeaning
201ApiTokenCreatedSuccessful operation
400ErrorResponseStructured API error
401ErrorResponseMissing or invalid credentials
403ErrorResponseRole or ownership denied
404ErrorResponseResource unavailable to this identity
409ErrorResponseRevision, idempotency, immutable version or lease conflict
413ErrorResponseStructured API error
422ErrorResponseCapability input/output schema violation
429ErrorResponseCapacity exceeded
500ErrorResponseStructured API error
503ErrorResponseStructured API error

Example response 201

{
  "active": false,
  "created_at": 0,
  "created_by": "string",
  "expires_at": 0,
  "id": "string",
  "label": "string",
  "last_used_at": 0,
  "prefix": "string",
  "previous_revoked_at": 0,
  "principal": "string",
  "revoked_at": 0,
  "roles": [
    "string"
  ],
  "rotated_from": "string",
  "token": "string"
}

revokeApiToken

DELETE /api/v2/auth/tokens/{id}

Requires: admin role

Revoke a token immediately, bringing forward any rotation grace period. Idempotent: revoking a revoked token returns it unchanged. Requests with the token fail with 401 token_revoked from the next request on; the row is kept for audit and appears in the listing with active false.

Generated Python client internals: atfgraph._generated.api.auth_api.AuthApi.revoke_api_token()

Parameters

ParameterInRequiredType
idpathyesstring

Responses

StatusBodyMeaning
200ApiTokenSuccessful operation
400ErrorResponseStructured API error
401ErrorResponseMissing or invalid credentials
403ErrorResponseRole or ownership denied
404ErrorResponseResource unavailable to this identity
409ErrorResponseRevision, idempotency, immutable version or lease conflict
413ErrorResponseStructured API error
422ErrorResponseCapability input/output schema violation
429ErrorResponseCapacity exceeded
500ErrorResponseStructured API error
503ErrorResponseStructured API error

Example response 200

{
  "active": false,
  "created_at": 0,
  "created_by": "string",
  "expires_at": 0,
  "id": "string",
  "label": "string",
  "last_used_at": 0,
  "prefix": "string",
  "principal": "string",
  "revoked_at": 0,
  "roles": [
    "string"
  ],
  "rotated_from": "string"
}

rotateApiToken

POST /api/v2/auth/tokens/{id}/rotate

Requires: admin role

Issue a fresh secret for the same principal, roles, label and expiry and schedule the old token's revocation grace_seconds from now (default 0: immediately, at most 30 days). The new plaintext is in this response only and rotated_from names the replaced token. Only an active token can be rotated (409 token_inactive); requests with the old token fail with 401 token_revoked once the grace period has passed.

Generated Python client internals: atfgraph._generated.api.auth_api.AuthApi.rotate_api_token()

Parameters

ParameterInRequiredType
idpathyesstring

Request body

ApiTokenRotate (required)

{
  "grace_seconds": 0
}

Responses

StatusBodyMeaning
200ApiTokenCreatedSuccessful operation
400ErrorResponseStructured API error
401ErrorResponseMissing or invalid credentials
403ErrorResponseRole or ownership denied
404ErrorResponseResource unavailable to this identity
409ErrorResponseRevision, idempotency, immutable version or lease conflict
413ErrorResponseStructured API error
422ErrorResponseCapability input/output schema violation
429ErrorResponseCapacity exceeded
500ErrorResponseStructured API error
503ErrorResponseStructured API error

Example response 200

{
  "active": false,
  "created_at": 0,
  "created_by": "string",
  "expires_at": 0,
  "id": "string",
  "label": "string",
  "last_used_at": 0,
  "prefix": "string",
  "previous_revoked_at": 0,
  "principal": "string",
  "revoked_at": 0,
  "roles": [
    "string"
  ],
  "rotated_from": "string",
  "token": "string"
}
ATFGraph documentationHosted workflow · Framework reference