Alfa API

Authentication

Every Alfa API request carries an API key as a bearer token. Keys belong to a company, are generated in Alfa, and never act as a signed-in user.

Authorization: Bearer alfa_live_…

Generating a key

An org admin or owner generates keys in Alfa, in Settings › Developers, with Generate key. They choose a name, an environment, the scopes and, optionally, an expiry. The full key is shown once, when it is generated; afterwards Alfa shows only its prefix.

A key is alfa_live_ or alfa_test_ followed by 43 letters and digits.

Environments

EnvironmentKey prefixHost
Livealfa_live_https://api.welovealfa.com
Testalfa_test_https://dev-api.welovealfa.com

A key works only on its own host. A live key sent to the development API, or a test key sent to production, is refused with 401 unauthorized.

Scopes

Scopes are chosen when a key is generated and cannot be changed later; generate a new key for different scopes. A request without the scope it needs is 403 insufficient_scope. The reference names the scope on each operation.

ScopeAllowsDefault
ats_jobs:writeCreate and update ATS jobs.Yes
jobs:readList ATS jobs and the Alfa jobs linked to them.Yes
candidates:readRead candidates and their resumes.Yes
webhooks:manageSet, test and rotate the webhook endpoint; read and redeliver deliveries.No
applications:writeSend applicants with applicant intake. Platform keys only.No

Company keys and platform keys

A company key belongs to one company and acts only for it. It can leave out the Alfa-Company-Id header; if it names a different company, the request is 403 company_not_connected. A platform key is issued by Alfa to an ATS platform and names a client company on every request. Read about platform keys.

Keeping keys safe

  • Store a key as a secret: in an environment variable or a secrets manager.
  • Never commit a key to source control, and never put it in front-end code, a mobile app or anything else that runs on a user's device.
  • Use test keys for development and testing, and live keys only in production.
  • If a key may have leaked, rotate it with no overlap, or revoke it.

Rotating a key

Rotating a key in Settings › Developers issues a new key with the same name, environment and scopes, and moves the old key's webhook endpoints to it. The old key keeps working for the overlap you choose, so you can deploy the new key first:

  • Immediately, for a key that may have leaked.
  • 1 hour.
  • 24 hours, the default.
  • 7 days.

When the overlap ends, the old key stops working.

Expiry and revocation

A key can expire 30, 90 or 365 days after it is generated, or never. Revoking a key in Settings › Developers takes effect within a minute and stops its webhook deliveries. A revoked or expired key is refused with 401 unauthorized.

Errors

StatusCodeWhen
401unauthorizedThe key is missing, mistyped, revoked or expired, or was sent to the wrong host.
400company_id_requiredA platform key sent no Alfa-Company-Id header.
403insufficient_scopeThe key does not have the scope the operation needs.
403company_not_connectedThe key may not act for the company named in Alfa-Company-Id.
403api_not_enabledThe Alfa API is not switched on for the company. Contact Alfa.
429rate_limitedToo many requests. Wait for the seconds in Retry-After.

See every error code and the rate limits, the API reference and the changelog.