Authentication
Every Layer REST API request must be authenticated with a bearer token in the Authorization header:
curl https://api.app.layer.ai/api/v1/workspaces \ -H "Authorization: Bearer $LAYER_TOKEN"The API base URL is https://api.app.layer.ai/api, and every endpoint is versioned under /v1 — so full paths look like https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/....
Personal Access Tokens
Section titled “Personal Access Tokens”A Personal Access Token (PAT) is the recommended way to authenticate a server-side integration. Tokens are prefixed with pat_.
- Log in to app.layer.ai.
- Go to Settings → Personal Access Tokens.
- Click Create Token, give it a name (and an optional expiry), and copy the value.
A PAT is created and managed only in the app UI — there is no REST endpoint to mint, list, or revoke tokens.
Permissions
Section titled “Permissions”A PAT inherits all of the permissions of the user who created it — there are no per-token scopes. Treat a PAT as equivalent to that user’s access, and provision integration users with only the workspace access they need. Requests for actions the user isn’t allowed to perform return 403 FORBIDDEN.
Expiry
Section titled “Expiry”If you set an expiry when creating the token, requests made after that time fail with 401 UNAUTHENTICATED. Rotate tokens before they expire.
SSO / Auth0 tokens
Section titled “SSO / Auth0 tokens”The API also accepts an Auth0-issued JWT (the same session your browser uses) as the bearer token. This is intended for first-party, browser-based use — there is no third-party OAuth app registration, client-credentials, or scopes flow for the REST API. For programmatic integrations, use a PAT.
Keeping tokens safe
Section titled “Keeping tokens safe”- Never embed a PAT in client-side code or a public repository — the API is server-to-server only.
- Scope integration users to the minimum workspace access required.
- Rotate tokens periodically and on suspected exposure.