api-keys
Organization, pod and inbox scoped keys. The `machinemail api-keys` commands: arguments, flags, examples and the API routes they call.
Organization, pod and inbox scoped keys. Also spelled api-key, keys.
| Command | Summary |
|---|---|
api-keys create | Create API key |
api-keys delete | Delete API key |
api-keys get | Get API key |
api-keys list | List API keys |
api-keys update | Update API key |
Every command also takes the global flags.
api-keys create
Create API key.
The route sets the scope of the new key: POST /v0/api-keys makes an organization key, POST /v0/pods/{pod_id}/api-keys a pod key, POST /v0/inboxes/{inbox_id}/api-keys an inbox key.
Only organization-scoped credentials (and dashboard sessions) can create keys, and only with permissions they have themselves (403). api_key is returned once.
Requires the api_key_create permission.
Flags
--inbox <inbox-id>string--pod <pod-id>string--name <value>string--permissions <json>JSON | null--expires-at <time>string | null-d, --data <json|@file|->stringExamples
API
POST /v0/api-keysPOST /v0/inboxes/{inbox_id}/api-keyswith--inboxPOST /v0/pods/{pod_id}/api-keyswith--pod
api-keys delete
Delete API key.
Also: machinemail api-keys rm.
Revokes the key: it stops working immediately. The record is kept (with revoked_at) and no longer listed.
Requires the api_key_delete permission.
Arguments
<api-key-id>stringRequiredFlags
--inbox <inbox-id>string--pod <pod-id>stringExamples
API
DELETE /v0/api-keys/{api_key_id}DELETE /v0/inboxes/{inbox_id}/api-keys/{api_key_id}with--inboxDELETE /v0/pods/{pod_id}/api-keys/{api_key_id}with--pod
api-keys get
Get API key.
Also returns revoked keys (with revoked_at).
Requires the api_key_read permission.
Arguments
<api-key-id>stringRequiredFlags
--inbox <inbox-id>string--pod <pod-id>stringExamples
API
GET /v0/api-keys/{api_key_id}GET /v0/inboxes/{inbox_id}/api-keys/{api_key_id}with--inboxGET /v0/pods/{pod_id}/api-keys/{api_key_id}with--pod
api-keys list
List API keys.
Also: machinemail api-keys ls.
Keys that are not revoked. Under /v0/pods/{pod_id} or /v0/inboxes/{inbox_id}, only the keys scoped to that pod or inbox; a pod or inbox credential sees only keys in its own scope.
Requires the api_key_read permission.
Flags
--inbox <inbox-id>string--pod <pod-id>string--typebearer | public_key--limit <n>integer--page-token <value>string--ascendingboolean--allbooleanExamples
API
GET /v0/api-keysGET /v0/inboxes/{inbox_id}/api-keyswith--inboxGET /v0/pods/{pod_id}/api-keyswith--pod
api-keys update
Update API key.
Rename a key or replace its permissions. Only organization-scoped credentials (and dashboard sessions) can update keys, and cannot grant permissions they lack (403).
Requires the api_key_update permission.
Arguments
<api-key-id>stringRequiredFlags
--inbox <inbox-id>string--pod <pod-id>string--name <value>string--permissions <json>JSON-d, --data <json|@file|->string