create_api_key
Create a new API key with permission scopes and optional sub-account binding so outbound messages are branded as that profile.
Instructions
Create a new API key. The secret key value is returned ONLY in this response — store it securely. Note: the secret will be visible in the AI conversation context. Optionally bind the key to a sub-account via profile_id — outbound messages sent with the key are then branded as that sub-account.
Agent usage: This operation requires 2FA. Before calling, complete the 2FA flow: (1) call start_2fa with action_type "api_key_create" and the user's preferred channel, (2) tell the user a code was sent and wait for them to verify, (3) poll get_2fa_status until status is "verified", (4) then call create_api_key — the backend session will be elevated. If you get a 403, the 2FA session has expired — restart the flow.
ACCESS: needs a Proof account. Set PROOF_API_KEY and restart this server, or sign in with start_login — a session opens this tool — then call this tool again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Human-readable key name | |
| scopes | No | Permission scopes for the key | |
| profile_id | No | Bind the new key to a sub-account you own (24-hex id). Immutable after creation; omit for an unbound account-wide key. | |
| environment | No | Key environment (default: production) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | MongoDB ObjectId | |
| key | Yes | The full API key. Returned only in this response; it cannot be read again. | |
| name | Yes | ||
| prefix | Yes | ||
| scopes | Yes | ||
| warning | Yes | ||
| created_at | Yes | ||
| profile_id | Yes | Sub-account (PublicProfile) the key is bound to; null for unbound keys. | |
| environment | Yes |