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

Path Parameters

organizationId
string
required
Organization ID
id
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_EXISTS",
    "message": "A role with this name already exists"
  }
}

Code Examples

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