Command reference
deployments api-key
Environment-scoped API credentials
| Command | Summary |
|---|---|
deployments api-key create | Create an API key |
deployments api-key list | List API keys |
deployments api-key usage | List API-key request activity |
deployments api-key rotate | Rotate an API key |
deployments api-key revoke | Revoke an API key |
deployments api-key create
Create an API key.
deployments api-key create --name <name> --service-account <service-account>- Calls
POST /v1/api-keys(SDKcreateApiCredential). - Needs an environment:
--envor the saved context. - Sends an idempotency key. The CLI generates one per run; pass
--idempotency-keyto retry safely. - Output contains secrets. They are redacted unless you pass
--reveal.
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--name | string | yes | Resource name | |
--service-account | string | yes | Owning service account ID | |
--scopes | string (a,b,c) | Capability scopes | ||
--expires | string | Expiration timestamp |
Also accepts the global flags.
deployments api-key list
List API keys.
deployments api-key list- Calls
GET /v1/api-keys(SDKlistApiCredentials). - Needs an environment:
--envor the saved context. - Paginated.
--page-sizesets the page size; pass the returned cursor as--cursorfor the next page.
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--cursor | string (cursor) | Pagination cursor | ||
--page-size | string (number) | Page size |
Also accepts the global flags.
deployments api-key usage
List API-key request activity.
deployments api-key usage- Calls
GET /v1/api-key-usage(SDKlistApiCredentialUsage). - Needs an environment:
--envor the saved context. - Paginated.
--page-sizesets the page size; pass the returned cursor as--cursorfor the next page.
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--cursor | string (cursor) | Pagination cursor | ||
--page-size | string (number) | Page size | ||
--api-credential | string | API credential ID | ||
--since | string | Start timestamp | ||
--until | string | End timestamp |
Also accepts the global flags.
deployments api-key rotate
Rotate an API key.
deployments api-key rotate <id>- Calls
POST /v1/api-keys/{id}/rotate(SDKrotateApiCredential). - Needs an environment:
--envor the saved context. - Destructive. Live runs ask for confirmation; pass
--yesin scripts or with--json. - Sends an idempotency key. The CLI generates one per run; pass
--idempotency-keyto retry safely. - Output contains secrets. They are redacted unless you pass
--reveal.
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
<id> | positional | yes | Resource ID | |
--reason | string | Reason for this operation |
Also accepts the global flags.
deployments api-key revoke
Revoke an API key.
deployments api-key revoke <id>- Calls
DELETE /v1/api-keys/{id}(SDKrevokeApiCredential). - Needs an environment:
--envor the saved context. - Destructive. Live runs ask for confirmation; pass
--yesin scripts or with--json. - Sends an idempotency key. The CLI generates one per run; pass
--idempotency-keyto retry safely.
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
<id> | positional | yes | Resource ID | |
--reason | string | Reason for this operation |
Also accepts the global flags.