Black Friday in 1 day: will your customers be able to pay? 25% off the first year and free setup, until 30 NovemberSee the offer →

Integration

Authentication and API keys

Bearer, TTL, storing PATHLY_API_TOKEN — never exposing the key in Git.

Get my API keyOpenAPI contract

Full document, no authentication, ready for your client generator.

Authentication and keys

Every authenticated request carries Authorization: Bearer $PATHLY_API_TOKEN. A key belongs to the organisation, not the person. Issue it under Settings → API keys (owner or admin). The secret is shown only at creation: the database keeps only a hash.

Every key has a TTL: 365 days by default, 730 at most. A missing, unknown, revoked or expired key gets the same 401: telling these cases apart would enable token enumeration.

Store the secret in a manager (GitHub Actions secrets, GitLab CI variables, Vault, Secret Manager). Never in a commit, ticket, application log or versioned .tf file.

# Shell local / CI
export PATHLY_API_TOKEN=sp_…
# Jamais : curl -H "Authorization: Bearer sp_xxx_en_clair"

Rotate a key with no downtime

You rotate a key before it expires, without stopping your pipelines: the old one and the new one are both valid during the switch. Issuing and revoking happen in the console, Settings → API keys, by an owner or an admin. No API endpoint creates or revokes a key.

Create the new key with the same scopes as the old one, and a name that states its use and its date. The secret is shown once only: paste it straight into your CI secret or your secrets manager, under the name PATHLY_API_TOKEN. It goes through no message and no file.

Check one call with the new key before you touch the old one. A read is enough: a 200 response confirms the key, a 403 response names the missing scope. Then run a full pipeline again.

Revoke the old key once all your pipelines use the new one. The key list shows the name, prefix, scopes and expiry of each key: it tells you which one to remove. A revoked key is refused from the very next request.

Put the new key in the CI secret

# GitHub Actions: paste the new key at the prompt.
# It never lands in your shell history or in a file.
gh secret set PATHLY_API_TOKEN

# GitLab CI: Settings → CI/CD → Variables → PATHLY_API_TOKEN, masked and protected.
# Re-run the pipeline, then revoke the old key.

A key has leaked

A key seen in a commit, a CI log, a ticket or a screenshot is compromised, even if the repository is private. Revoke it right away under Settings → API keys. Do not wait to find out whether it was used.

Then issue a replacement with the same scopes, or narrower ones if the leak shows the key had too many. Put it in the CI secret and run your pipelines again. They fail while you replace it: that is the price of an immediate revocation.

A revoked key gets 401, exactly like an unknown key. The response does not say why, so that someone trying tokens learns nothing. A pipeline that suddenly turns to 401 is therefore still using the old key.

Review what the key may have done. Go through recent runs with GET /v1/runs, looking for triggers you did not start. Go through the audit log in the console for creations, changes and deletions. Compare your scenarios with your Terraform code if you have some.

Finally, look for where the key was copied: Git history, CI logs, .env files, workstations, messages and tickets. Removing it from a commit is not enough, it stays in the history. Fix the cause: a key is read from a secret, never from a versioned file.

Find where the key was copied

# KEY_PREFIX: the prefix shown next to the key in Settings → API keys.
# Every commit, on every branch, that added or removed it:
git log --all --oneline -S"$KEY_PREFIX"

# Files of the working tree, .env files included:
grep -rn "$KEY_PREFIX" . --exclude-dir=.git --exclude-dir=node_modules