---
title: "Create a blockage"
method: POST
path: "/blockages"
tags: ["Blockages"]
---

# Create a blockage

`POST /blockages`

Creates a one-off or recurring blockage. Reference the location and (optional) employee by MyTime id or partner/external id. Include a `schedule` to make the blockage recurring.

## Headers

- `X-Subdomain` string

## Request body

- BlockageRequest
  - `location_id` integer — MyTime id of the location the blockage applies to. Provide this or `location_external_id`.
  - `location_external_id` string — Partner/external id of the location. Resolved server-side to a MyTime location.
  - `employee_id` integer — MyTime id of the employee the blockage applies to. Omit (or send an id that does not resolve) for a location-wide blockage. Provide this or `employee_external_id`.
  - `employee_external_id` string — Partner/external id of the employee. Resolved server-side to a MyTime employee.
  - `begin_at` string, date-time, required — ISO8601 start of the blocked-off window.
  - `end_at` string, date-time, required — ISO8601 end of the blocked-off window.
  - `title` string — Free-form label shown on the calendar (e.g. "Lunch", "Vacation").
  - `description` string — Optional longer note for the blockage.
  - `blockage_type` string — Free-form type. `day_off` marks the window as a day off; any other value is a generic block.
  - `resource_id` integer — Optional MyTime id of a resource (e.g. a room) the blockage reserves.
  - `schedule` BlockageSchedule — Recurrence rule. Include to make the blockage recurring; omit (or send `null`) for a one-off window. On update, omitting this key preserves the existing recurrence.
    - `frequency_interval` integer — How often the blockage repeats, expressed in units of `interval_datatype` (e.g. `2` with `weeks` = every other week).
    - `interval_datatype` 'days' | 'weeks' | 'months' — The unit the recurrence repeats on.
    - `end_date` string, date — Optional ISO8601 date on which the recurrence stops. Omit for an open-ended series.
    - `interval_extra` object — Optional fine-grained recurrence details. For `weeks`, supply `days_of_week` (a map of day index "0"=Sunday..."6"=Saturday to a boolean). For `months`, supply `month_option` ("day_of_month" or "day_of_week") plus the matching `month_day_of_month`, or `month_day_of_week` and `month_week`.

## Response `201`

Created

- object
  - `blockage` BlockageResponse
    - `location_id` integer — MyTime id of the location the blockage applies to. Provide this or `location_external_id`.
    - `location_external_id` string — Partner/external id of the location. Resolved server-side to a MyTime location.
    - `employee_id` integer — MyTime id of the employee the blockage applies to. Omit (or send an id that does not resolve) for a location-wide blockage. Provide this or `employee_external_id`.
    - `employee_external_id` string — Partner/external id of the employee. Resolved server-side to a MyTime employee.
    - `begin_at` string, date-time — ISO8601 start of the blocked-off window.
    - `end_at` string, date-time — ISO8601 end of the blocked-off window.
    - `title` string — Free-form label shown on the calendar (e.g. "Lunch", "Vacation").
    - `description` string — Optional longer note for the blockage.
    - `blockage_type` string — Free-form type. `day_off` marks the window as a day off; any other value is a generic block.
    - `resource_id` integer — Optional MyTime id of a resource (e.g. a room) the blockage reserves.
    - `schedule` BlockageSchedule — Recurrence rule. Include to make the blockage recurring; omit (or send `null`) for a one-off window. On update, omitting this key preserves the existing recurrence.
      - `frequency_interval` integer — How often the blockage repeats, expressed in units of `interval_datatype` (e.g. `2` with `weeks` = every other week).
      - `interval_datatype` 'days' | 'weeks' | 'months' — The unit the recurrence repeats on.
      - `end_date` string, date — Optional ISO8601 date on which the recurrence stops. Omit for an open-ended series.
      - `interval_extra` object — Optional fine-grained recurrence details. For `weeks`, supply `days_of_week` (a map of day index "0"=Sunday..."6"=Saturday to a boolean). For `months`, supply `month_option` ("day_of_month" or "day_of_week") plus the matching `month_day_of_month`, or `month_day_of_week` and `month_week`.
    - `errors` object

## Other responses

- `401` — Unauthorized
- `404` — Not found
- `422` — Invalid parameters

---

[API](https://skmtc.net/mytime/apis/mytime-partners-api.md) · [All operations](https://skmtc.net/mytime/apis/mytime-partners-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mytime/mytime-partners-api/versions/65d3a27fcb1a/schema)
