APIKey .issue
POST /{namespace}/api-keys/issue
Issue creates an API Key for one Customer and returns its secret once; afterwards only the prefix shows.
- Noun
- API Key
- Mode
do- Event
APIKey.issued
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
customer | Customer | required | The Customer whose calls it signs. |
name | string | required | What the key is for. |
environment | string | required | One of test or live. |
verbs | list of Verb | The Verbs it may call; unset reaches every Verb the Customer’s Entitlements grant. | |
expiresAt | datetime | When it stops working on its own. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
apiKey | API Key | required | The API Key, with its prefix. |
secret | string | required | The full secret. It is returned here once and never again. |
Effects
- Emits
APIKey.issued. - Two-way: it runs at once, in the
try,sendanddomodes. - Lists the key in the Customer’s Portal, with its prefix, scope and last use.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | APIKey.issue |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |