errors.auth-tokens.create

Create a SENTRY_AUTH_TOKEN (an access key of yours capped to errors:*), shown once

POST /errors/api/auth-tokensIAM errors:UploadSourceMapsChanges state

sentry-cli reads the URL and organization from the token: SENTRY_AUTH_TOKEN alone redirects it here.

Depending on the resource, the call checks iam:CreateAccessKey instead; hold all of them to be sure it is allowed.

Request syntax

POST /errors/api/auth-tokens
{
  "description": "string",
  "expiresInDays": "number"
}

Request body

  • descriptionOptional

    string

    What the token is for, 1–200 characters, default "sentry-cli"; the access key is described as "Error Tracking: <description>"

    Constraints: 1-200 chars

    Default: "sentry-cli"

  • expiresInDaysOptional

    number

    Days until the token expires, 1–3650. Default: the organization’s default access-key lifetime (90 days unless changed); more than the organization’s maximum (365 days unless changed) is refused (400)

    Constraints: integer, 1-3650

Response

201 with { token, accessKeyId, expiresAt }: `token` the SENTRY_AUTH_TOKEN, shown only now; `accessKeyId` the access key behind it, listed under your IAM access keys, where it is revoked. 400 for a lifetime beyond the organization’s maximum; 409 when your access-key quota is used up.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow errors:UploadSourceMaps on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud errors auth-tokens create

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_errors_auth-tokens_create.