Skip to main content
The API uses bearer tokens. Create tokens in Ardent dashboard > Settings > API keys, store them in a secret manager, and pass them with each request. API keys start with sk-ard_ and are passed in an Authorization: Bearer header.
curl -H "Authorization: Bearer $ARDENT_TOKEN" https://api.tryardent.com/v1/projects

Token handling

  • Store tokens in your CI secret manager or platform vault.
  • Do not commit tokens to source control.
  • Rotate tokens when someone leaves the team or a token is exposed.
  • Prefer the least-privileged role that can perform the job.

API key roles

Role IDIntended use
role_org_viewerRead-only automation and reporting
role_org_memberCreate and modify day-to-day resources such as branches and connectors
role_org_adminAdministrative automation, including team and API-key management
role_org_ownerFull organization control

CLI and API tokens

The CLI can also use API tokens through ARDENT_TOKEN:
export ARDENT_TOKEN="sk-ard_..."
ardent branch create pr-123 --print-url
For local interactive work, ardent login is friendlier. For CI and scripts, ARDENT_TOKEN is more explicit.

Common auth errors

StatusMeaningWhat to do
401 UnauthorizedThe token is missing, expired, revoked, or malformedCheck the token and create a new one if needed
403 ForbiddenThe token is valid but does not have access to that organization or actionUse a token with the right role, or ask an organization admin to update access
404 Not FoundThe resource does not exist or is outside the token’s accessible scopeCheck the ID and organization context

Example: list projects

curl -H "Authorization: Bearer $ARDENT_TOKEN" https://api.tryardent.com/v1/projects