Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
name
required

user role name

Validations:

  • Must be a String

description
optional

user role description

Validations:

  • Must be a String

Examples

// Not admin user
POST /api/v2/admin/user_roles/:user_role_id
401
// User role not found
POST /api/v2/admin/user_roles/not-found-id
404
{
  "error": "UserRole not found"
}
// Successful request
POST /api/v2/admin/user_roles/5
{
  "name": "updated name"
}
200
{
  "user_role": {
    "name": "updated name",
    "id": 5,
    "created_at": "2023-11-27T09:42:49.675Z",
    "updated_at": "2023-11-27T09:42:49.937Z",
    "description": null,
    "users": [],
    "permissions": [
      {
        "id": 157,
        "rule": "ASSET_CREATE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.680Z",
        "updated_at": "2023-11-27T09:42:49.680Z",
        "description": "Create and add media",
        "requires": []
      },
      {
        "id": 158,
        "rule": "ASSET_UPLOAD",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.686Z",
        "updated_at": "2023-11-27T09:42:49.686Z",
        "description": "Upload to placeholders",
        "requires": []
      },
      {
        "id": 159,
        "rule": "ASSET_EDIT",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.691Z",
        "updated_at": "2023-11-27T09:42:49.691Z",
        "description": "Edit details",
        "requires": []
      },
      {
        "id": 160,
        "rule": "ASSET_MOVE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.696Z",
        "updated_at": "2023-11-27T09:42:49.696Z",
        "description": "Move",
        "requires": []
      },
      {
        "id": 161,
        "rule": "ASSET_DELETE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.701Z",
        "updated_at": "2023-11-27T09:42:49.701Z",
        "description": "Delete and restore",
        "requires": []
      },
      {
        "id": 162,
        "rule": "ASSET_REMOVE_MEDIA",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.706Z",
        "updated_at": "2023-11-27T09:42:49.706Z",
        "description": "Remove media",
        "requires": []
      },
      {
        "id": 163,
        "rule": "ASSET_EDIT_CUSTOM_FIELDS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.712Z",
        "updated_at": "2023-11-27T09:42:49.712Z",
        "description": "Edit custom fields",
        "requires": []
      },
      {
        "id": 164,
        "rule": "ASSET_REVIEW_CREATE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.717Z",
        "updated_at": "2023-11-27T09:42:49.717Z",
        "description": "Create approval",
        "requires": []
      },
      {
        "id": 165,
        "rule": "ASSET_REVIEW",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.722Z",
        "updated_at": "2023-11-27T09:42:49.722Z",
        "description": "Approve or reject",
        "requires": []
      },
      {
        "id": 166,
        "rule": "ASSET_SHARE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.726Z",
        "updated_at": "2023-11-27T09:42:49.726Z",
        "description": "Share",
        "requires": []
      },
      {
        "id": 167,
        "rule": "ASSET_CREATE_SHAREABLE_LINK",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.730Z",
        "updated_at": "2023-11-27T09:42:49.730Z",
        "description": "Create shareable link",
        "requires": []
      },
      {
        "id": 168,
        "rule": "ASSET_EDIT_ARTICLE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.735Z",
        "updated_at": "2023-11-27T09:42:49.735Z",
        "description": "Edit article",
        "requires": []
      },
      {
        "id": 169,
        "rule": "ASSET_CROP",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.740Z",
        "updated_at": "2023-11-27T09:42:49.740Z",
        "description": "Crop",
        "requires": []
      },
      {
        "id": 170,
        "rule": "PROJECT_CREATE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.745Z",
        "updated_at": "2023-11-27T09:42:49.745Z",
        "description": "Create",
        "requires": []
      },
      {
        "id": 171,
        "rule": "PROJECT_EDIT",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.749Z",
        "updated_at": "2023-11-27T09:42:49.749Z",
        "description": "Edit details",
        "requires": []
      },
      {
        "id": 172,
        "rule": "PROJECT_MOVE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.753Z",
        "updated_at": "2023-11-27T09:42:49.753Z",
        "description": "Move",
        "requires": []
      },
      {
        "id": 173,
        "rule": "PROJECT_DELETE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.756Z",
        "updated_at": "2023-11-27T09:42:49.756Z",
        "description": "Delete and restore",
        "requires": []
      },
      {
        "id": 174,
        "rule": "PROJECT_EDIT_CUSTOM_FIELDS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.759Z",
        "updated_at": "2023-11-27T09:42:49.759Z",
        "description": "Edit custom fields",
        "requires": []
      },
      {
        "id": 175,
        "rule": "PROJECT_EDIT_MEMBERS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.762Z",
        "updated_at": "2023-11-27T09:42:49.762Z",
        "description": "Edit members",
        "requires": []
      },
      {
        "id": 176,
        "rule": "PROJECT_SEE_PUBLIC",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.765Z",
        "updated_at": "2023-11-27T09:42:49.765Z",
        "description": "See public projects",
        "requires": []
      },
      {
        "id": 177,
        "rule": "COLLECTION_CREATE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.768Z",
        "updated_at": "2023-11-27T09:42:49.768Z",
        "description": "Create",
        "requires": []
      },
      {
        "id": 178,
        "rule": "COLLECTION_EDIT",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.771Z",
        "updated_at": "2023-11-27T09:42:49.771Z",
        "description": "Edit details",
        "requires": []
      },
      {
        "id": 179,
        "rule": "COLLECTION_ADD_ASSET",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.774Z",
        "updated_at": "2023-11-27T09:42:49.774Z",
        "description": "Add assets",
        "requires": []
      },
      {
        "id": 180,
        "rule": "COLLECTION_REMOVE_ASSET",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.777Z",
        "updated_at": "2023-11-27T09:42:49.777Z",
        "description": "Remove assets",
        "requires": []
      },
      {
        "id": 181,
        "rule": "COLLECTION_DELETE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.781Z",
        "updated_at": "2023-11-27T09:42:49.781Z",
        "description": "Delete",
        "requires": []
      },
      {
        "id": 182,
        "rule": "COLLECTION_EDIT_MEMBERS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.784Z",
        "updated_at": "2023-11-27T09:42:49.784Z",
        "description": "Edit members",
        "requires": []
      },
      {
        "id": 183,
        "rule": "COLLECTION_SEE_PUBLIC",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.787Z",
        "updated_at": "2023-11-27T09:42:49.787Z",
        "description": "See public collections",
        "requires": []
      },
      {
        "id": 184,
        "rule": "DROP_FOLDER_CREATE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.790Z",
        "updated_at": "2023-11-27T09:42:49.790Z",
        "description": "Create",
        "requires": [
          "LOADER_VIEW"
        ]
      },
      {
        "id": 185,
        "rule": "DROP_FOLDER_EDIT",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.793Z",
        "updated_at": "2023-11-27T09:42:49.793Z",
        "description": "Edit details",
        "requires": []
      },
      {
        "id": 186,
        "rule": "DROP_FOLDER_ADD_ASSETS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.799Z",
        "updated_at": "2023-11-27T09:42:49.799Z",
        "description": "Add assets",
        "requires": []
      },
      {
        "id": 187,
        "rule": "DROP_FOLDER_DELETE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.804Z",
        "updated_at": "2023-11-27T09:42:49.804Z",
        "description": "Delete",
        "requires": []
      },
      {
        "id": 188,
        "rule": "DROP_FOLDER_EDIT_MEMBERS",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.809Z",
        "updated_at": "2023-11-27T09:42:49.809Z",
        "description": "Edit members",
        "requires": []
      },
      {
        "id": 189,
        "rule": "DROP_FOLDER_SEE_PUBLIC",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.814Z",
        "updated_at": "2023-11-27T09:42:49.814Z",
        "description": "See public drop folders",
        "requires": []
      },
      {
        "id": 190,
        "rule": "LOADER_VIEW",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.819Z",
        "updated_at": "2023-11-27T09:42:49.819Z",
        "description": "View the list of loaders",
        "requires": []
      },
      {
        "id": 191,
        "rule": "LOADER_MONITOR",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.824Z",
        "updated_at": "2023-11-27T09:42:49.824Z",
        "description": "Monitor",
        "requires": [
          "LOADER_VIEW"
        ]
      },
      {
        "id": 192,
        "rule": "LOADER_RESTORE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.829Z",
        "updated_at": "2023-11-27T09:42:49.829Z",
        "description": "Restore",
        "requires": [
          "LOADER_VIEW"
        ]
      },
      {
        "id": 193,
        "rule": "PLUGIN_ENABLE",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.834Z",
        "updated_at": "2023-11-27T09:42:49.834Z",
        "description": "Enable plugins",
        "requires": []
      },
      {
        "id": 194,
        "rule": "ACTIONS_VIEW",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.838Z",
        "updated_at": "2023-11-27T09:42:49.838Z",
        "description": "View actions",
        "requires": []
      },
      {
        "id": 195,
        "rule": "ACTIONS_START",
        "has_permission": false,
        "user_role_id": 5,
        "created_at": "2023-11-27T09:42:49.843Z",
        "updated_at": "2023-11-27T09:42:49.843Z",
        "description": "Launch actions",
        "requires": [
          "ACTIONS_VIEW"
        ]
      }
    ]
  }
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters