Skip to main content
PUT
/
app
/
v1
/
organizations
/
{organizationId}
/
roles
/
{roleId}
Update Role
curl --request PUT \
  --url https://api.example.com/app/v1/organizations/{organizationId}/roles/{roleId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "permissions": {}
}
'

Path Parameters

organizationId
string
required
Organization ID
roleId
string
required
Role ID

Request Body

name
string
Updated role name
description
string
Updated description
permissions
object
Updated permission settings (partial updates supported)

Example Request

{
  "description": "Updated role description",
  "permissions": {
    "content": {
      "publish": true
    }
  }
}

Response

Returns the updated Role object.
{
  "id": "role123",
  "name": "editor",
  "description": "Updated role description",
  "permissions": {
    "organizations": { "read": true, "update": false, "delete": false },
    "content": { "create": true, "read": true, "update": true, "publish": true, "delete": true }
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T14:00:00Z"
}

Error Responses

Role Not Found

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Role not found"
  }
}

Role Name Already Exists

{
  "error": {
    "code": "ROLE_NAME_ALREADY_EXISTS",
    "message": "Role with name \"editor\" already exists"
  }
}

Code Examples

curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123/roles/role123" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated role description",
    "permissions": {
      "content": { "publish": true }
    }
  }'