curl --request PUT \
--url https://api.example.com/v1/organizations/{organizationId}/roles/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": {}
}
'Update an existing 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": {}
}
'{
"description": "Updated role description",
"permissions": {
"content": {
"publish": true
}
}
}
{
"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": {
"code": "NOT_FOUND",
"message": "Role not found"
}
}
{
"error": {
"code": "ROLE_NAME_EXISTS",
"message": "A role with this name already exists"
}
}
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 }
}
}'