Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Role

Duplicate a role

Returns

Returns a resource object of type role.

Examples

POST https://site-api.datocms.com/roles/:role_id/duplicate HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/roles/:role_id/duplicate' \
-X POST \
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/roles/:role_id/duplicate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": {
"type": "role",
"id": "34",
"attributes": {
"name": "Editor",
"can_edit_site": true,
"can_edit_favicon": true,
"can_edit_schema": true,
"can_manage_menu": true,
"can_manage_users": true,
"can_manage_shared_filters": true,
"can_manage_upload_collections": true,
"can_manage_environments": true,
"can_manage_webhooks": true,
"environments_access": "primary_only",
"can_manage_sso": true,
"can_access_audit_log": true,
"can_manage_workflows": true,
"can_edit_environment": true,
"can_promote_environments": true,
"can_manage_build_triggers": true,
"can_manage_access_tokens": true,
"can_perform_site_search": true,
"can_access_build_events_log": true,
"positive_item_type_permissions": [
{
"environment": "main",
"action": "all"
}
],
"negative_item_type_permissions": [
{
"environment": "main",
"action": "all"
}
],
"positive_upload_permissions": [
{
"action": "all",
"environment": "main"
}
],
"negative_upload_permissions": [
{
"action": "all",
"environment": "main"
}
],
"positive_build_trigger_permissions": [
{}
],
"negative_build_trigger_permissions": [
{}
]
},
"relationships": {
"inherits_permissions_from": {
"data": [
{
"type": "role",
"id": "34"
}
]
}
},
"meta": {
"final_permissions": {
"can_edit_site": true,
"can_edit_favicon": true,
"can_edit_schema": true,
"can_manage_menu": true,
"can_manage_users": true,
"can_manage_environments": true,
"can_manage_webhooks": true,
"environments_access": "primary_only",
"can_manage_sso": true,
"can_access_audit_log": true,
"can_manage_workflows": true,
"can_edit_environment": true,
"can_promote_environments": true,
"can_manage_shared_filters": true,
"can_manage_build_triggers": true,
"can_manage_upload_collections": true,
"can_manage_access_tokens": true,
"can_perform_site_search": true,
"can_access_build_events_log": true,
"positive_item_type_permissions": [
{
"environment": "main",
"action": "all"
}
],
"negative_item_type_permissions": [
{
"environment": "main",
"action": "all"
}
],
"positive_upload_permissions": [
{
"action": "all",
"environment": "main"
}
],
"negative_upload_permissions": [
{
"action": "all",
"environment": "main"
}
],
"positive_build_trigger_permissions": [
{}
],
"negative_build_trigger_permissions": [
{}
]
}
}
}
}