Skip to main content
POST
/
organizations
/
{id}
/
roles
Create organization role
curl --request POST \
  --url https://api.wacht.dev/organizations/{id}/roles \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --cookie session_id= \
  --data 'name=Project Manager' \
  --data-urlencode permissions%5B0%5D=organization:read \
  --data-urlencode permissions%5B1%5D=organization:manage_members
{
  "id": "444444444444444444",
  "organization_id": "123456789012345678",
  "name": "Admin",
  "permissions": [
    "organization:admin",
    "organization:manage_members"
  ],
  "is_system_role": false,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

session_id
string
cookie
required

Session-based authentication using cookies

Path Parameters

id
string<uint64>
required

Organization ID

Body

application/x-www-form-urlencoded
name
string
required

Role name

Required string length: 2 - 100
Example:

"Project Manager"

permissions
string[]
required

List of permissions

Example:
[
"organization:read",
"organization:manage_members"
]

Response

Role created successfully

id
string<uint64>

Role ID

Example:

"444444444444444444"

organization_id
string<uint64>

Organization ID

Example:

"123456789012345678"

name
string

Role name

Example:

"Admin"

permissions
string[]

Role permissions

Example:
[
"organization:admin",
"organization:manage_members"
]
is_system_role
boolean

Whether this is a system role

Example:

false

created_at
string<date-time>
updated_at
string<date-time>