Create unavailability

POST /employees/{id}/unavailability

Create unavailability

Headers

  • Bearer token used for authorization

    Minimum length is 1.

  • 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

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

        Additional properties are allowed.

POST /employees/{id}/unavailability
curl \
 -X POST https://api.development.pexipengage.com/enterprises/acme/employees/1234/unavailability \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" \
 -H "X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002" \
 -d '{"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": {
    "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": {}
    }
  ]
}