# Put provider calendar timeslots

This endpoint sets the complete list of available slots for a specific provider on a specific date. Each request must include the entire set of slots for that date. If a provider wishes to list times at multiple locations for a single date, each location must have its own timeslot object added to the array. A new request made for the same provider and date will overwrite the previous set of slots. If you send an empty array, all slots for that provider across all locations on that date will be deleted.
**Note**: The timeslots are stored in an eventually consistent data store. This means there is a small
possibility that a fetch might not include recently created slots if you fetch timeslots immediately after inserting them.
**Parameter Validations**:
* The user must have access to the specified `provider_id`.

**Validations for each timeslot in the request body**:
* `slot.provider_id`:
  * Must match the `provider_id` specified in the endpoint parameter.
* `slot.start_time`:
  * Must be a valid "local date-time" string in ISO 8601 format, e.g., `2024-09-15T12:13:00`. The seconds component is optional.
  * The date component must match the `date` parameter.
* `slot.time_zone`:
  * Must be a valid IANA time zone ID (e.g., `America/New_York` or `America/Denver`).

Endpoint: PUT /v1/providers/{provider_id}/calendar/timeslots
Version: 1.177

## Path parameters:

  - `provider_id` (string, required)

## Query parameters:

  - `date` (string, required)
    The date for which to put timeslots in YYYY-MM-DD format.

## Request fields (application/json):

  - `timeslots` (array, required)

  - `timeslots.provider_id` (string, required)
    Provider id
    Example: pr_abc123-def456_wxyz7890

  - `timeslots.location_id` (string, required)
    Location id
    Example: lo_abc123-def456_wxyz7890

  - `timeslots.start_time` (string, required)
    the local date and time within the timezone. The seconds may be omitted.
    Example: 2024-10-16T09:30:00

  - `timeslots.time_zone` (string, required)
    The IANA time zone id of the appointment. Must be valid.
    Example: America/New_York

  - `timeslots.allowed_visit_reason_ids` (array)
    Restrict the timeslot to these visit reasons. Both `null` and an empty array will not restrict the timeslot.
Can work in conjunction with `excluded_visit_reason_ids`. `allowed_visit_reason_ids` are superceded by `excluded_visit_reason_ids`.
So if a visit reason is included in both `allowed_visit_reason_ids` and `excluded_visit_reason_ids`, the net effect is that visit reason
being excluded.
| allowed | excluded | => Result |
|  --- | --- | --- |
| null | null | all visit reasons allowed |
| [A,B] | null | only A & B are allowed |
| null | [A,B] | all visit reasons except A & B are allowed |
| [A,B] | [B,C] | only A is allowed (C is irrelevant) |
| [A,B] | [A,B] | No visit reasons allowed, unbookable timeslot |
    Example: ["pc_TlZW-r06U0W3pCsIGtSI5B"]

  - `timeslots.excluded_visit_reason_ids` (array)
    Exclude these visit reasons. Both `null` and an empty array means no visit reasons will be excluded.
Can work in conjunction with `allowed_visit_reason_ids`. `allowed_visit_reason_ids` are superceded by `excluded_visit_reason_ids`.
So if a visit reason is included in both `allowed_visit_reason_ids` and `excluded_visit_reason_ids`, the net effect is that visit reason
being excluded.
| allowed | excluded | => Result |
|  --- | --- | --- |
| null | null | all visit reasons allowed |
| [A,B] | null | only A & B are allowed |
| null | [A,B] | all visit reasons except A & B are allowed |
| [A,B] | [B,C] | only A is allowed (C is irrelevant) |
| [A,B] | [A,B] | No visit reasons allowed, unbookable timeslot |
    Example: ["pc_TAZW-r16U0B3pZeIutSI3L"]

  - `timeslots.patient_type` (string)
    Whether or not the patient has been to the provider's practice.
    Enum: "existing", "new"

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `errors` (object)

  - `errors.not_found_location_ids` (array, required)
    Location IDs that were not found on the Zocdoc side.

## Response 400:

  - `400` (unknown)
    Invalid request parameters.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 404:

  - `404` (unknown)
    Not found

