Modify departments

POST /api-v1/department/tree

Headers

  • TARGET-ORGANIZATION-ID integer(int32)

    ID of organization, for which the operation must be performed

  • WEAL-TOKEN string Required

    API token (can be retrieved from account settings)

application/json

Body Required

departments

  • children array[object]
  • id integer
  • isDeleted boolean
  • name string
  • parentId integer
  • position integer(int32)

Responses

  • 200 */*

    OK

    Hide response attributes Show response attributes object
    • data object
    • error object
      Hide error attributes Show error attributes object
      • errorCode string

        Values are NO_ERROR, NOT_IMPLEMENTED_YET, CONTACT_NOT_FOUND, FIELD_REQUIRED, VALIDATION_ERROR, DUPLICATION_ERROR, UNIQUE_CONSTRAINT_VIOLATION, WRONG_PASSWORD_FORMAT, WRONG_PASSWORD, ACTION_DENIED, NOT_FOUND, EXPECTED_ONE_FILE, UNIQUE_VIOLATION, CONTENT_EMPTY, INVALID_TYPE, CONVERSION_ERROR, FILE_PARSE_EXCEPTION, or IN_USE.

      • errorDetailValues array[object]
        Hide errorDetailValues attributes Show errorDetailValues attributes object
        • data string
        • errorCode string
        • fieldName string
        • isSevere boolean
    • valid boolean
  • 400

    400 Bad Request

  • 401

    401 Unauthorized

  • 403

    403 Access Denied

  • 404

    404 Not Found

  • 500

    500 Internal Server Error

POST /api-v1/department/tree
curl \
 --request POST 'https://wyzio.app/api-v1/department/tree' \
 --header "Content-Type: application/json" \
 --header "TARGET-ORGANIZATION-ID: 42" \
 --header "WEAL-TOKEN: string" \
 --data '[{"children":[{}],"id":42,"isDeleted":true,"name":"string","parentId":42,"position":42}]'
Request examples
# Headers
TARGET-ORGANIZATION-ID: 42
WEAL-TOKEN: string

# Payload
[
  {
    "children": [
      {}
    ],
    "id": 42,
    "isDeleted": true,
    "name": "string",
    "parentId": 42,
    "position": 42
  }
]
Response examples (200)
{
  "data": {},
  "error": {
    "errorCode": "NO_ERROR",
    "errorDetailValues": [
      {
        "data": "string",
        "errorCode": "string",
        "fieldName": "string",
        "isSevere": true
      }
    ]
  },
  "valid": true
}