Skip to main content
POST
/
client
/
departments
cURL
curl --request POST \
  --url https://sandbox-remote-api.rayda.co/api/v2/client/departments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Business Development",
  "members": [
    "9e0e7675-bc9b-40e1-b1db-4cc6451f7f4e",
    "9e0e7676-4317-4210-a10e-142258410ccc"
  ]
}
'
{
  "success": true,
  "message": "Record created successfully",
  "data": {
    "id": "9e0fe6c9-7d47-4341-a578-a1cf42695e13",
    "company": {
      "id": "9dc21956-ccd8-4ae5-bc77-d167d6d542ed",
      "name": "Rayda"
    },
    "name": "Business Development",
    "member_count": 2,
    "asset_count": 0,
    "created_at": "2025-01-26T17:08:56.000Z",
    "updated_at": "2025-01-26T17:08:56.000Z",
    "head": {
      "name": " ",
      "id": null
    },
    "members": [
      {
        "id": "9e0e7675-bc9b-40e1-b1db-4cc6451f7f4e",
        "first_name": "Jackson",
        "last_name": "Doe",
        "email": "[email protected]",
        "user_departments": [
          {
            "id": "9e0febe1-1ff2-4625-accd-9f43d229ea1d",
            "company_id": "9dc21956-ccd8-4ae5-bc77-d167d6d542ed",
            "user_id": "9e0e7675-bc9b-40e1-b1db-4cc6451f7f4e",
            "department_id": "9e0febe1-148e-4330-ae0c-b333b570d0e9",
            "status": "Active",
            "created_at": "2025-01-26T17:23:10.000Z",
            "updated_at": "2025-01-26T17:23:10.000Z",
            "deleted_at": null
          }
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The department data to create

name
string
required

The name of the department

Example:

"Business Development"

members
array

Array of string containing the user IDs to add to the department

Example:
[
"9e0e7675-bc9b-40e1-b1db-4cc6451f7f4e",
"9e0e7676-4317-4210-a10e-142258410ccc"
]

Response

Record created successfully

success
boolean
Example:

true

message
string
Example:

"Record created successfully"

data
object