Skip to main content
POST
/
organizations
/
{organizationId}
/
tokens
/
{tokenId}
/
roles
Update API token roles
curl --request POST \
  --url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/tokens/{tokenId}/roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "roles": [
    {
      "entityId": "clm8sgvai000008l794psbkdv",
      "entityType": "WORKSPACE",
      "role": "WORKSPACE_MEMBER",
      "deploymentId": "clm8t5u4q000008jq4qoc3031"
    }
  ]
}
'
{
  "dagRoles": [
    {
      "deploymentId": "clm8t5u4q000008jq4qoc3031",
      "role": "DAG_VIEWER",
      "dagId": "my_dag",
      "dagTag": "team-a"
    }
  ],
  "deploymentRoles": [
    {
      "deploymentId": "clm8t5u4q000008jq4qoc3031",
      "role": "DEPLOYMENT_ADMIN"
    }
  ],
  "organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
  "workspaceRoles": [
    {
      "role": "WORKSPACE_MEMBER",
      "workspaceId": "clm8t5u4q000008jq4qoc3036"
    }
  ]
}

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 update an API token.

tokenId
string
required

The API token you want to update.

Body

application/json

The request body for updating a token.

roles
object[]
required

The roles of the API token, including DAG roles.

Minimum array length: 1

Response

OK

dagRoles
object[]

A list of the subject's DAG roles.

deploymentRoles
object[]

A list of the subject's Deployment roles. Currently only for API tokens.

organizationRole
string

The subject's Organization role.

Example:

"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER"

workspaceRoles
object[]

A list of the subject's Workspace roles.