Skip to main content
POST
/
organizations
/
{organizationId}
/
roles
Create a custom role
curl --request POST \
  --url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Deployment_Viewer",
  "permissions": [
    "deployment.get"
  ],
  "scopeType": "DEPLOYMENT",
  "description": "Subject can only view deployments.",
  "restrictedWorkspaceIds": [
    "cldbvzoi20182g8odxt8ehi5i"
  ]
}
'
{
  "createdAt": "2022-11-22T04:37:12Z",
  "createdBy": {
    "id": "clm8qv74h000008mlf08scq7k",
    "apiTokenName": "my-token",
    "avatarUrl": "https://avatar.url",
    "fullName": "Jane Doe",
    "subjectType": "USER",
    "username": "user1@company.com"
  },
  "id": "cluc9tapx000901qn2xrgqdmn",
  "name": "Deployment_Viewer",
  "permissions": [
    "deployment.get"
  ],
  "restrictedWorkspaceIds": [
    "cldbvzoi20182g8odxt8ehi5i"
  ],
  "scopeType": "DEPLOYMENT",
  "updatedAt": "2022-11-22T04:37:12Z",
  "updatedBy": {
    "id": "clm8qv74h000008mlf08scq7k",
    "apiTokenName": "my-token",
    "avatarUrl": "https://avatar.url",
    "fullName": "Jane Doe",
    "subjectType": "USER",
    "username": "user1@company.com"
  },
  "description": "Subject can only view deployments."
}

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 create the custom role.

Body

application/json

The request body for creating the custom role.

name
string
required

The role's name.

Example:

"Deployment_Viewer"

permissions
string[]
required

The permissions included in the role.

Minimum array length: 1
Example:
["deployment.get"]
scopeType
enum<string>
required

The scope of the role.

Available options:
DEPLOYMENT,
DAG
Example:

"DEPLOYMENT"

description
string

The role's description.

Example:

"Subject can only view deployments."

restrictedWorkspaceIds
string[]

The IDs of the Workspaces that the role is restricted to.

Example:
["cldbvzoi20182g8odxt8ehi5i"]

Response

OK

createdAt
string<date-time>
required

The time the role was created.

Example:

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

createdBy
object
required
id
string
required

The role's ID.

Example:

"cluc9tapx000901qn2xrgqdmn"

name
string
required

The role's name.

Example:

"Deployment_Viewer"

permissions
string[]
required

The role's permissions.

Example:
["deployment.get"]
restrictedWorkspaceIds
string[]
required

The IDs of Workspaces that the role is restricted to.

Example:
["cldbvzoi20182g8odxt8ehi5i"]
scopeType
enum<string>
required

The role's scope.

Available options:
DEPLOYMENT,
WORKSPACE,
ORGANIZATION
Example:

"DEPLOYMENT"

updatedAt
string<date-time>
required

The time the role was last updated.

Example:

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

updatedBy
object
required
description
string

The role's description.

Example:

"Subject can only view deployments."