v1

latestOpenAPI 3.1.02026-07-24170121.2 MB

Assign Roles

post/v1/roles/assign

Headers

Acceptstring required

Indicates which content types, expressed as MIME types, the client is able to understand.

Content-Typestring required

Indicates the media type of the resource sent in the HTTP message body. <br /><br /><b>Possible Values:</b><br /> application/json<br />application/x-www-form-urlencoded

Request body

user_idstring required

IDs of the user.

roles_idsstring[] required

IDs of roles that should be attached to the User.

Response

200

Example response

{
  "data": {
    "object": "User",
    "id": "v68VRv6Zn62RZ2J4",
    "real_id": 26807,
    "name": "Notification",
    "email": "notification@payarc.com",
    "created_at": 1704976789,
    "updated_at": 1704976789,
    "readable_created_at": "9 months ago",
    "readable_updated_at": "9 months ago",
    "response_content": true,
    "username": "Notification",
    "role": {
      "id": 1507,
      "name": "test_guard",
      "guard_name": "api",
      "display_name": "test Guard (api)",
      "description": "for test",
      "created_at": "2024-01-11T12:36:26.000000Z",
      "updated_at": "2024-01-11T12:36:26.000000Z",
      "account_id": 24,
      "name_export": "test_guard",
      "display_name_export": "test Guard (api)",
      "created_at_export": "2024-01-11 12:36:26",
      "role_id_export": "QzjbMaEjmRbaKmLR",
      "description_export": "for test",
      "pivot": {
        "model_id": 26807,
        "role_id": 1507,
        "model_type": "App\\Containers\\AppSection\\User\\Models\\User"
      }
    }
  },
  "meta": {
    "include": [
      "roles"
    ]
  }
}