Create unavailability event

POST /employees/{id}/unavailability-event

Create unavailability event for employee

Headers

  • Authorization string

    Bearer token used for authorization

    Minimum length is 1.

  • X-Correlation-Id string

    Unique identifier to allow referencing a particular transaction or event chain

    Minimum length is 1.

Path parameters

  • id string Required

    Primary identifier of the requested resource

    Minimum length is 1.

application/json

Body Required

  • end string(date-time) Required

    Minimum length is 1.

  • start string(date-time) Required

    Minimum length is 1.

  • answers array[object] | null
    Hide answers attributes Show answers attributes object
    • value string | null

      Minimum length is 1.

    • selectedAnswerOptions array[object] | null
      Hide selectedAnswerOptions attribute Show selectedAnswerOptions attribute object
      • id string Required

        Minimum length is 1.

    • files array[object] | null
      Hide files attribute Show files attribute object
      • id string Required

        Minimum length is 1.

    • questionId string Required

      Minimum length is 1.

Responses

  • 201 application/json

    Successful operation

    Hide response attribute Show response attribute object
    • data object Required

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • answers array[object] Required
        Hide answers attributes Show answers attributes object
        • value string | null

          Minimum length is 1.

        • selectedAnswerOptions array[object] | null
          Hide selectedAnswerOptions attribute Show selectedAnswerOptions attribute object
          • id string Required

            Minimum length is 1.

        • files array[object] | null
          Hide files attribute Show files attribute object
          • id string Required

            Minimum length is 1.

        • id string Required

          Minimum length is 1.

        • form object Required

          Additional properties are NOT allowed.

          Hide form attribute Show form attribute object
          • id string Required

            Minimum length is 1.

        • question object Required

          Additional properties are NOT allowed.

          Hide question attribute Show question attribute object
          • id string Required

            Minimum length is 1.

        • answerType string Required

          Values are APPOINTMENT_CANCELLATION, APPOINTMENT_COMPLETION, CALLBACK_REQUEST, QUALIFICATION, SUBJECT_QUESTIONNAIRE, or UNAVAILABILITY.

        • createdAt string(date-time) Required

          Minimum length is 1.

        • updatedAt string(date-time) Required

          Minimum length is 1.

      • id string Required

        Minimum length is 1.

      • employee object Required

        Additional properties are NOT allowed.

        Hide employee attribute Show employee attribute object
        • id string Required

          Minimum length is 1.

      • start string(date-time) | null

        Minimum length is 1.

      • startDate string | null

        Minimum length is 1.

      • end string(date-time) | null

        Minimum length is 1.

      • endDate string | null

        Minimum length is 1.

      • type string Required

        Values are APPOINTMENT, EXTERNAL_CALENDAR, LISTING_EXCLUSIVITY, or USER_DEFINED.

      • externalId string | null

        Minimum length is 1, maximum length is 255.

      • createdAt string(date-time) Required

        Minimum length is 1.

      • updatedAt string(date-time) Required

        Minimum length is 1.

  • 404 application/json

    Resource not found

    Hide response attribute Show response attribute object
    • errors array[object] Required

      At least 1 element.

      Hide errors attributes Show errors attributes object
      • message string Required

        Minimum length is 1.

      • code string Required

        Minimum length is 1.

      • type string Required

        Minimum length is 1.

      • statusCode string Required

        Minimum length is 1.

POST /employees/{id}/unavailability-event
curl \
 --request POST 'https://api.development.pexipengage.com/enterprises/acme/employees/1234/unavailability-event' \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" \
 --header "X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002" \
 --data '{"end":"2025-05-04T09:42:00Z","start":"2025-05-04T09:42:00Z","answers":[{"value":"A colleague","selectedAnswerOptions":[{"id":"123"}],"files":[{"id":"123"}],"questionId":"123"}]}'
Request examples
# Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002

# Payload
{
  "end": "2025-05-04T09:42:00Z",
  "start": "2025-05-04T09:42:00Z",
  "answers": [
    {
      "value": "A colleague",
      "selectedAnswerOptions": [
        {
          "id": "123"
        }
      ],
      "files": [
        {
          "id": "123"
        }
      ],
      "questionId": "123"
    }
  ]
}
Response examples (201)
{
  "data": {
    "answers": [
      {
        "value": "A colleague",
        "selectedAnswerOptions": [
          {
            "id": "123"
          }
        ],
        "files": [
          {
            "id": "123"
          }
        ],
        "id": "123",
        "form": {
          "id": "123"
        },
        "question": {
          "id": "123"
        },
        "answerType": "SUBJECT_QUESTIONNAIRE",
        "createdAt": "2022-08-17T19:05:21.362Z",
        "updatedAt": "2022-08-17T19:05:21.362Z"
      }
    ],
    "id": "123",
    "employee": {
      "id": "123"
    },
    "start": "2022-08-01T00:00:00.000Z",
    "startDate": "2022-08-01",
    "end": "2022-08-17T00:00:00.000Z",
    "endDate": "2022-08-17",
    "type": "USER_DEFINED",
    "externalId": "ABCD1234",
    "createdAt": "2022-08-17T19:05:21.362Z",
    "updatedAt": "2022-08-17T19:05:21.362Z"
  }
}
Response examples (404)
{
  "errors": [
    {
      "message": "string",
      "code": "string",
      "type": "string",
      "statusCode": "string"
    }
  ]
}