Command Palette

Search for a command to run...

API Tokens

API tokens are long-lived credentials for server integrations, scripts, and automated workflows. They stay valid until you revoke them.

Creating tokens

In the admin panel:

  1. Go to Settings > API Tokens
  2. Click Create Token
  3. Enter a name that identifies the token's purpose
  4. Select permissions (see below)
  5. Click Create

Copy your token

The token is only shown once. Store it securely.

Via the API:

mutation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 mutation { createPyloApiKey( input: { name: "CI/CD Integration" permissions: ["read", "write"] } ) { data { id name token } } }

Using tokens

Send the token in the pylo-api-key header:

terminal
1 2 3 4 curl -X POST https://api.pyloapp.com/graphql \ -H "Content-Type: application/json" \ -H "pylo-api-key: YOUR_API_TOKEN" \ -d '{"query": "{ customerList { data { id name } } }"}'

In the SDKs, store the token in the PYLO_API_KEY environment variable and pass it as apiKey: process.env.PYLO_API_KEY! in pylo.config.ts (codegen) and createPyloNode / createPyloServer (data access). See the quickstarts.

Permissions

PermissionDescription
readQuery entities (list and by-ID)
writeCreate, update, and delete entities
adminFull access including user management and settings

Permissions combine: a token with ["read", "write"] can query and mutate data but cannot manage users or app settings.

Least privilege

Create tokens with the minimum permissions required. Give a read-only integration read and nothing else.

Revoking tokens

In the admin panel: Settings > API Tokens, find the token, click Delete. Via the API:

mutation
1 2 3 4 5 6 7 mutation { deletePyloApiKey(ids: ["token-id"]) { data { success } } }

Revoked tokens stop working immediately, and requests carrying one get an UNAUTHORIZED error.