ahlan hamad

API key or OAuth app?

There are two ways to reach a company's data in Ahlan Hamad. Both call the same endpoints with the same scopes; the difference is who issues the credential and how the data owner says yes.

API key LiveOAuth app Coming soon
Who it is forOne company's own integration or script, or a single-customer pilotA product that many companies connect to
Who creates the credentialA user of the customer company, in Integrations → API keysYou, once, in the developer console — then each company approves your app
Secrets copied between companiesYes — the customer gives you the keyNo — the company approves on a consent screen
What the company seesKey name, scopes, last used; revoke the keyConnected apps: who has access, scopes, last used; one-click revoke
Endpoints and scopesEvery endpoint, the same scopesEvery endpoint, the same scopes
AvailableNowComing soon

Use an API key when

A key belongs to one company, carries a fixed set of scopes and is shown once when created. A user with the integrations.manage permission (CEO or HR admin by default) creates it. ah_test_ keys are for sandbox companies, ah_live_ keys for real ones. See the quickstart.

Build an OAuth app when

Coming soon. OAuth apps are being built and are not available yet. What follows describes the planned design; details may change before launch. Start today with an API key on a sandbox — when OAuth ships only your authentication code changes, not the endpoints.

How it will work

  1. You create a developer organisation (separate from any customer company) and an app in it: a client ID and secret (shown once, stored hashed, rotatable), exact redirect URIs, the scopes you request, and an English and Arabic listing.
  2. While your app is in development mode it can connect only to sandbox companies your organisation owns. Connecting real companies needs the app to be published after review, or an explicit allow-list entry for a pilot customer.
  3. You send the customer's user to /oauth/authorize. A user with integrations.manage picks the company, sees your app and its scopes, and approves.
  4. You exchange the authorization code for an access token and a refresh token at /oauth/token (authorization code with PKCE S256). Refresh tokens rotate on every use.
  5. You call /v1 with Authorization: Bearer <token> — the same endpoints, the same scope checks, the same rate limit.
  6. The customer sees your app on its Connected apps page and can revoke it in one click; revoking stops your tokens and disables that connection's webhooks.

The technical detail is in the OAuth guide (preview).

Moving from API keys to OAuth

Endpoints, scopes, data shapes and webhooks are the same either way. If you start on API keys, moving to OAuth means changing only how you obtain the Bearer token. API keys stay supported for private, single-company integrations.