Docs
Developers

Authentication

Create an APROS API key, choose its scopes, send it as a bearer token, check what it can do, and rotate or revoke it.

Every API request authenticates with an API key sent as a bearer token. A key belongs to the person who created it and acts as that person, limited to the scopes you choose for the key.

Who can create keys

Creating, editing and revoking keys needs the MANAGE_API_KEYS permission. In a new workspace only the Administrator role has it. An administrator can add it to another role in Settings → Roles & Permissions.

Keys are managed in the product only. An API key cannot create, edit or revoke API keys: such a request answers 403 with the code API_KEY_CANNOT_MANAGE_KEYS.

Create an API key

  1. In the sidebar, open Settings → API Keys. This opens Integrations on the API tab.

  2. Select the API keys card. On its Keys tab, select Create API Key.

  3. Enter a Key Name that tells you later where the key is used, for example the name of the system that will call the API.

  4. Under Scopes, tick each permission the key needs. Use Search scopes... to find them by name. The list offers only permissions you hold yourself.

  5. Optional: in Expires in (days), enter a number from 1 to 365. Leave it empty for a key that does not expire.

  6. Select Create. The Your new API Key dialog shows the key once. Copy it, store it in your secret manager, then select Done.

A key with no scopes can do nothing

If you create a key without ticking any scopes, it cannot call any endpoint, and the keys table shows No access in its Scopes column. To give a key everything you can do, create it, then edit it and tick Unrestricted access (this key may do anything its owner may do). Prefer a short list of scopes: a narrow key limits the damage if it leaks.

APROS keeps only a hash of the key, so nobody can show it to you again. If you lose a key, revoke it and create a new one.

Keys start with sk-. The keys table shows each key's Key Prefix (its first ten characters, for example sk-3f9a1c2...), so you can tell keys apart without seeing the secret.

Send the key

Put the key in the Authorization header of every request:

Authorization: Bearer sk-...

Keep the key in an environment variable rather than in your code. The examples on this site read it from APROS_API_KEY. This call returns what the key is allowed to do:

curl https://<your-workspace>.apros.app/api/me/scopes \
  -H "Authorization: Bearer $APROS_API_KEY"

A request with no key, an unknown key, a revoked key or an expired key answers 401:

{ "error": "No authentication token found", "code": "AUTHENTICATION_ERROR" }

Scopes and permissions

A scope is the name of a permission in your workspace, in the form ACTION_RESOURCE: VIEW_LEAD, CREATE_LEAD, UPDATE_INVOICE and so on. The same permissions make up the roles in Settings → Roles & Permissions.

A key can do only what both of these allow:

  • The key's scopes. A scoped key can use only the permissions on its list. An unrestricted key is not limited by a list.
  • Its owner's rights. The key acts as the person who created it, so it never gets more than that person has. A scope the owner does not hold has no effect, and if the owner loses a permission, their keys lose it too. Row-level access applies as well: a key sees only the records its owner's role lets them see (their own, their department's, or all).

If the owner's account is suspended or terminated, their keys stop working and every request answers 403 with the code ACCOUNT_DISABLED.

Common scopes:

PermissionWhat it allows
VIEW_LEADView lead details
CREATE_LEADCreate new leads
UPDATE_LEADUpdate lead information
DELETE_LEADDelete leads
VIEW_CONTACTView contact details
VIEW_COMPANYView company details
VIEW_DEALView deal details
VIEW_TASKView tasks
CREATE_TASKCreate tasks
VIEW_INVOICEView invoices

Each operation in the API reference lists the permissions its path enforces in x-apros-scopes. The list is kept per path, not per method: GET and DELETE on the same path share one list, and a read needs only the read permission from it.

Each custom entity type you create gets its own permissions, named after the type, and you can scope a key to them like any other permission. GET /api/me/scopes lists them.

Check what a key can do

GET /api/me/scopes describes the credential you call it with. Any valid key can call it, whatever its scopes.

{
  "credential": {
    "type": "api-key",
    "id": "0f6b2c1e-7d4a-4b8e-9c3f-2a1d5e6f7a8b",
    "name": "Website forms",
    "keyPrefix": "sk-3f9a1c2..."
  },
  "granted": { "mode": "list", "scopes": ["CREATE_LEAD", "VIEW_LEAD"] },
  "userPermissions": ["CREATE_LEAD", "DELETE_LEAD", "UPDATE_LEAD", "VIEW_LEAD"],
  "effective": ["CREATE_LEAD", "VIEW_LEAD"],
  "catalogue": [
    { "name": "CREATE_LEAD", "source": "endpoint", "endpoints": ["/api/leads"] }
  ]
}

The arrays are shortened here. The fields:

FieldMeaning
credential.typeapi-key for an API key, oauth-token for an MCP connection made by sign-in, session for a signed-in browser.
granted.modelist: the key is limited to granted.scopes. all: an unrestricted key, and granted.scopes is null. legacy-unrestricted: an old key created before scopes were required; replace it with a scoped one.
userPermissionsEverything the key's owner holds.
effectiveWhat actually works for this key right now: the key's scopes that its owner also holds. Use this list to explain a 403.
catalogueEvery scope name that exists in your workspace, with the public endpoints that enforce it. Scopes of custom entity types carry the type in entityType.

Change a key's name or scopes

  1. Open the API keys card as in Create an API key.

  2. In the row of the key, open the row actions and select Edit.

  3. Change Key Name or Scopes, or tick Unrestricted access (this key may do anything its owner may do).

  4. Select Save.

The secret does not change, so integrations that use the key keep working with the new rights. Every change to a key's scopes is recorded in the workspace's audit log, with the scopes before and after. A revoked key cannot be edited.

Rotate a key

There is no rotate button. Rotate a key by replacing it:

  1. Create a new key with the same scopes.

  2. Deploy the new key to the system that uses the old one.

  3. Watch the old key's Last Used column until it stops changing. The column is updated at most once a minute.

  4. Revoke the old key.

To rotate on a schedule, give keys an expiry in Expires in (days). An expired key answers 401 like a revoked one.

Revoke a key

  1. Open the API keys card.

  2. In the row of the key, open the row actions and select Revoke.

  3. Confirm in Revoke API Key.

Revoking cannot be undone. From its next request the key answers 401, and the table shows it as Revoked. The revocation is recorded in the audit log.

Keep keys safe

  • Call the API from your server. Never put a key in browser code, a mobile app or a public repository.
  • Use one key per integration, so you can revoke one without breaking the others.
  • Give each key only the scopes it needs, and an expiry when you can.

Other credentials

AI clients that connect to the MCP server by sign-in use OAuth access tokens instead of API keys. They follow the same rule: the token can never do more than the person who approved it.