---
title: "Creation / Updating of the candidates availabilty"
method: POST
path: "/candidate/{candidate_id}/availability"
tags: ["Candidate Availability"]
---

# Creation / Updating of the candidates availabilty

`POST /candidate/{candidate_id}/availability`

- This route returns warnings for items it was not able to create / update and NOT a 400
- Any items that do not result in an error, will be created / updated even if there are warnings on other items

## Request body

- CandidateAvailabilityUpsert
  - `arrAvailability` CandidateAvailabilityPayloadItem[], required
    - `sEarly` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `sLate` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `sNight` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `dAvailabilityDate` string, date, required

## Response `200`

The availability object containing the changes and warnings for the request

- CandidateAvailabilityUpsertReturn
  - `arrAvailability` CandidateAvailabilityReturn[], required
    - `sEarly` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `sLate` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `sNight` 'Unknown' | 'Available' | 'Unavailable' | 'Booked', required
    - `dAvailabilityDate` string, date, required
    - `sCandidateId` string, required
    - `dtCreated` string, date-time, required
    - `dtModified` string, date-time, required
    - `id` string, required
  - `arrWarnings` CandidateAvailabilityUpsertWarningReturn[]
    - `dAvailabilityDate` string, date
    - `sProperty` 'sEarly' | 'sLate' | 'sNight' | 'arrAvailabilityDate'
    - `arrMessages` CandidateAvailabilityUpsertPropertyMessageItem[]
      - `sMessage` string
      - `sCode` 'INVALID_STATE_TRANSITION_FROM_UNKNOWN_TO_BOOKED' | 'INVALID_STATE_TRANSITION_FROM_AVAILABLE_TO_BOOKED' | 'INVALID_STATE_TRANSITION_FROM_UNAVAILABLE_TO_BOOKED' | 'INVALID_STATE_TRANSITION_FROM_BOOKED_TO_UNKNOWN' | 'INVALID_STATE_TRANSITION_FROM_BOOKED_TO_AVAILABLE' | 'INVALID_STATE_TRANSITION_FROM_BOOKED_TO_UNAVAILABLE' | 'PAST_UPDATES_NOT_ALLOWED'

## Other responses

- `400` — Validation Error. Usually caused by a missing or invalid parameters.
- `401` — Authorization Error. Thrown if the user does not have access to resource.
- `default` — unexpected error

---

[API](https://skmtc.dev/staffshift/apis/staffshift-api-gateway.md) · [All operations](https://skmtc.dev/staffshift/apis/staffshift-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/staffshift/staffshift-api-gateway/revisions/6e2cb83db3a9/schema)
