Create unavailability

POST /employees/{id}/unavailability

Create unavailability

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

  • startDate string Required

    Minimum length is 1.

  • endDate 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.

  • 422 application/json

    Business validation failed

    • UNAVAILABILITY_OVERLAP

    See Error codes

    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.

      • arguments object | null
POST /employees/{id}/unavailability
curl \
 --request POST 'https://api.development.pexipengage.com/enterprises/acme/employees/1234/unavailability' \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" \
 --header "X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002" \
 --data '{"startDate":"2023-08-01","endDate":"2023-08-14"}'
Request examples
# Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002

# Payload
{
  "startDate": "2023-08-01",
  "endDate": "2023-08-14"
}
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"
    }
  ]
}
Response examples (422)
{
  "errors": [
    {
      "message": "string",
      "code": "string",
      "type": "string",
      "statusCode": "string",
      "arguments": {}
    }
  ]
}

Create unavailability

DELETE /employees/{employeeId}/unavailability/{id}

Create unavailability

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

  • employeeId string Required

    Minimum length is 1.

  • id string Required

    Minimum length is 1.

application/json

Body Required

  • startDate string Required

    Minimum length is 1.

  • endDate string Required

    Minimum length is 1.

Responses

  • 204

    Successful operation

  • 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.

DELETE /employees/{employeeId}/unavailability/{id}
curl \
 --request DELETE 'https://api.development.pexipengage.com/enterprises/acme/employees/123/unavailability/123' \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" \
 --header "X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002" \
 --data '{"startDate":"2023-08-01","endDate":"2023-08-14"}'
Request examples
# Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002

# Payload
{
  "startDate": "2023-08-01",
  "endDate": "2023-08-14"
}
Response examples (404)
{
  "errors": [
    {
      "message": "string",
      "code": "string",
      "type": "string",
      "statusCode": "string"
    }
  ]
}