Skip to main content
POST
/
organizations
/
{organizationId}
/
tokens
/
{tokenId}
/
rotate
Rotate API token
curl --request POST \
  --url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/tokens/{tokenId}/rotate \
  --header 'Authorization: Bearer <token>'
{
  "createdAt": "2022-11-22T04:37:12Z",
  "description": "my token description",
  "id": "clm8q7f6q000008lcgyougpsk",
  "kind": "STANDARD",
  "name": "My token",
  "shortToken": "short-token",
  "startAt": "2022-11-22T04:37:12Z",
  "type": "WORKSPACE",
  "updatedAt": "2022-11-22T04:37:12Z",
  "createdBy": {
    "id": "clm8qv74h000008mlf08scq7k",
    "apiTokenName": "my-token",
    "avatarUrl": "https://avatar.url",
    "fullName": "Jane Doe",
    "subjectType": "USER",
    "username": "user1@company.com"
  },
  "endAt": "2022-11-22T04:37:12Z",
  "expiryPeriodInDays": 30,
  "lastUsedAt": "2022-11-22T04:37:12Z",
  "roles": [
    {
      "entityId": "clm8sgvai000008l794psbkdv",
      "entityType": "WORKSPACE",
      "role": "WORKSPACE_MEMBER",
      "deploymentId": "clm8t5u4q000008jq4qoc3031"
    }
  ],
  "token": "token",
  "updatedBy": {
    "id": "clm8qv74h000008mlf08scq7k",
    "apiTokenName": "my-token",
    "avatarUrl": "https://avatar.url",
    "fullName": "Jane Doe",
    "subjectType": "USER",
    "username": "user1@company.com"
  }
}

Documentation Index

Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organizationId
string
required

The ID of the Organization where you want to rotate an API token.

tokenId
string
required

The token to rotate

Response

OK

createdAt
string<date-time>
required

The time when the API token was created in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

Example:

"2022-11-22T04:37:12Z"

description
string
required

The description of the API token.

Example:

"my token description"

id
string
required

The API token's ID.

Example:

"clm8q7f6q000008lcgyougpsk"

kind
enum<string>
required

The kind of the API token.

Available options:
STANDARD,
DIRECT_ACCESS
Example:

"STANDARD"

name
string
required

The name of the API token.

Example:

"My token"

shortToken
string
required

The short value of the API token.

Example:

"short-token"

startAt
string<date-time>
required

The time when the API token will become valid in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

Example:

"2022-11-22T04:37:12Z"

type
enum<string>
required

The type of the API token.

Available options:
DEPLOYMENT,
WORKSPACE,
ORGANIZATION
Example:

"WORKSPACE"

updatedAt
string<date-time>
required

The time when the API token was last updated in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

Example:

"2022-11-22T04:37:12Z"

createdBy
object
endAt
string<date-time>

The time when the API token expires in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

Example:

"2022-11-22T04:37:12Z"

expiryPeriodInDays
integer

The expiry period of the API token in days.

Example:

30

lastUsedAt
string<date-time>

The time when the API token was last used in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.

Example:

"2022-11-22T04:37:12Z"

roles
object[]

The roles of the API token.

token
string

The value of the API token.

Example:

"token"

updatedBy
object