ApiToken

Update API token roles

POST
Update Workspace and Organization roles for an API token.

Path parameters

organizationIdstringRequired
The ID of the Organization where you want to update an API token.
tokenIdstringRequired
The API token you want to update.

Request

This endpoint expects an object.
roles
list of objectsRequired
The roles of the API token.

Response

This endpoint returns an object
deploymentRoles
list of objectsOptional
A list of the subject's Deployment roles. Currently only for API tokens.
organizationRole
enumOptional
The subject's Organization role.
Allowed values: ORGANIZATION_OWNERORGANIZATION_BILLING_ADMINORGANIZATION_MEMBER
workspaceRoles
list of objectsOptional
A list of the subject's Workspace roles.
POST
1curl -X POST https://api.astronomer.io/iam/v1beta1/organizations/organizationId/tokens/tokenId/roles \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "roles": [
6 {
7 "entityId": "clm8sgvai000008l794psbkdv",
8 "entityType": "DEPLOYMENT",
9 "role": "WORKSPACE_MEMBER"
10 }
11 ]
12}'
200Successful
1{
2 "deploymentRoles": [
3 {
4 "deploymentId": "clm8t5u4q000008jq4qoc3031",
5 "role": "DEPLOYMENT_ADMIN"
6 }
7 ],
8 "organizationRole": "ORGANIZATION_OWNER",
9 "workspaceRoles": [
10 {
11 "role": "WORKSPACE_OWNER",
12 "workspaceId": "clm8t5u4q000008jq4qoc3036"
13 }
14 ]
15}