API keys
An API key is the identity your system calls the API with: bound to one governed deployment, carrying the scopes, Flows and limits your administrator chose, and issued as two credentials shown exactly once. Read this if you hold a key or issue one: what it allows, and how it changes over its life.
Before you start: a key is created in the Organisations console under Identity & access, Programmatic access, by an owner or operator, or someone with the ProgrammaticAccessAdministrator role (Programmatic access); Studio has no key screen.
Receive the two credentials
After Create, a dialog titled with the key's name ("“<name>” created") shows both values once: "Copy these now. AlphaAgent does not store them and cannot show them again." Close stays disabled until I have stored the key is ticked. AlphaAgent keeps only SHA-256 hashes; the key's page shows only the last characters, as Key ending and External ID ending.
- API key, sent as
Authorization: Bearer <key>on every call. Shapeak_<key_id>.<secret>: the key id (ak_and 12 hexadecimal characters), a dot, the secret. - Key external id, sent as the
X-AlphaAgent-Key-External-Idheader on every call: the second factor. Shapeake_and 32 hexadecimal characters.
A lost value cannot be recovered; your administrator rotates the secret or issues a new external id.
What a key carries
The New API key form sets each item in its own section; GET /me returns them to the caller (Authentication).
| Section in the form | The key carries | Default and bounds |
|---|---|---|
| Key identity | Name and Description | Name required, up to 100 characters; description up to 500 |
| Bound deployment | The one governed deployment the key works against ("The deployment binding is fixed") | Chosen at creation, never changed. The picker lists governed deployments only and marks one on a Studio release too old to serve the API (below 1.0.139) with "Studio <version>, needs <release>" |
| Workflow access | All active workflows (every Flow active in the deployment, now and later) or Specific workflows picked from the deployment's active Flows | All active workflows; at most 50 specific Flows |
| Allowed operations | Scopes, below | workflows:read, runs:create, runs:read and outputs:read ticked; at least one |
| Source network access | Source IP allow-list (one CIDR per line): the IPv4 or IPv6 Classless Inter-Domain Routing (CIDR) ranges the caller's address must fall in. On a private deployment that is its own address on your network; on an existing public one, its public address. "Leave empty to allow any address." | Empty; at most 32 ranges |
| Expiry and rate limit | Expiry: 30, 90, 180 or 365 days from creation; every call fails once it has passed | 90 days |
| Rate limit (requests per minute), all routes together | 60; at most 10,000 | |
| Daily run quota: runs started per day, reset at 00:00 Coordinated Universal Time (UTC) | 100; at most 100,000 | |
| Concurrent runs: runs in flight at once | 10; at most 100 | |
| Allowed hours | Only accept calls during allowed hours (UTC), from From (UTC) to Until (UTC); an end before the start wraps midnight | Off; 08:00 to 18:00 when ticked; start and end must differ |
The scopes, with the console's own description of each:
| Scope | "What it allows" (the console's text) |
|---|---|
workflows:read | "Read workflows and their parameters" |
runs:create | "Start and cancel runs". Ticking it also ticks workflows:read: "Starting a run requires reading its workflow" |
runs:read | "Read run status, steps and events" |
outputs:read | "Download run outputs" |
runs:delete | "Erase a run’s data (right to erasure)" |
Which route needs which scope is in the route table.
How the key changes over its life
Every change reaches the deployment within about a minute; a revocation within two minutes. The key's page offers these commands on its Action Bar while the key is Active or Rotating.
- Edit API key. Every field except the deployment. Expiry offers Keep the current expiry, or a new duration counted from the moment you save. Your credentials stay the same;
GET /meshows the new contract. - Rotate API key. A new secret is issued; the dialog reads "A new secret is issued now. The old secret keeps working for <overlap> so you can switch callers, then stops." Overlap is 1 hour, 24 hours (default), 3 days or 7 days (maximum). Switch your callers inside the overlap. The key id and the external id do not change.
- New external ID. No overlap: "The current key external id stops working the moment the deployment picks this up (within about a minute)." Update every caller straight away. The secret does not change.
- Revoke API key. Final: "Every call with this key fails within two minutes. This cannot be undone." You type the key's name to confirm. The key cannot be reactivated; create a new one.
- Delete API key, offered once a key is revoked or expired: "Deleting removes it from this list and from the deployment; its audit trail stays."
- Expiry. Once the date passes every call fails, as for a revoked key.
Read a key's usage
API key usage on the key's page opens it under Audit, API key usage (also reachable from the Audit tab of that name).
- Requests (24 h), Last used and Rejected auth/IP (last hour), then Hourly requests, last 7 days as accepted and rejected bars. The Organisation collects usage from the deployment once an hour.
- "Per-request detail (method, path, status, IP, reason) is kept in the deployment for 90 days and is not proxied through Organisations."
- Audit trail: Created, Edited, Secret rotated, Key external id rotated, Revoked, Deleted, Active in the deployment, Expired and Run data purged with the run id, each with who did it.
What you should see
| Status in the console | Your calls |
|---|---|
Not yet active in <deployment> | Just created or changed; 401 or 503 for about a minute. The list re-reads itself every 15 seconds until it clears |
| Active | Accepted |
Rotating until <date> | Both the old and the new secret are accepted until then |
| Revoked · effective in the deployment within 2 minutes, then Revoked | Every call fails |
| Expired | Every call fails |
A red Auth failures chip beside the status ("N rejected credential or IP attempts in the last hour") means the key raised the auth-failure alarm; the usage page reads "Auth-failure alarm since <time>".
Notes
- Rejected calls (wrong secret, wrong external id, address outside the allow-list) are counted against the key; the alarm is raised at 20 in an hour. It goes to the deployment's Alarm topic, set on its Configuration tab in Organisations or in a configuration template, and shows only in CloudWatch when none is set.
- A lost or leaked secret: Rotate API key; the old secret stops at the end of the overlap. A lost or leaked external id: New external ID; the old value stops within about a minute.
- New API key is disabled with "Create a governed deployment first" when the Organisation has no governed deployment.
- With Specific workflows, a Flow that has since been deactivated shows as "<id> (no longer active)"; a key cannot run a Flow that is not active.
Related
- Overview
- Programmatic access: the console screen, for administrators.
- Authentication: how the two credentials are sent and checked.
- Limits, errors and codes: the limits as the caller sees them.