---
title: "Create a scheduled freeze"
method: POST
path: "/repos/{owner}/{repository}/scheduled_freeze"
tags: ["scheduled_freeze"]
---

# Create a scheduled freeze

`POST /repos/{owner}/{repository}/scheduled_freeze`

Create a scheduled freeze for the repository specified in the path

## Path parameters

- `owner` string, required — The owner of the repository
- `repository` string, required — The name of the repository

## Request body

- CreateScheduledQueueFreezePayload
  - `reason` string, required — The reason for the scheduled freeze.
  - `start` string, date-time, nullable, required — When the scheduled freeze begins (date and time in ISO 8601 format without TZ). Begins now if the attribute is null.
  - `end` string, date-time, nullable — When the scheduled freeze ends (date and time in ISO 8601 format without TZ).
  - `timezone` string, required — Timezone where the freeze is expected to happen.
  - `matching_conditions` union[] — List of conditions used to match pull requests that need to be frozen during the scheduled freeze. Defaults to an empty list, which matches all pull requests.
    - union
      - MatchingConditionsDictInput
        - `and` union[]
          - union
            - MatchingConditionsDictInput — recursive
            - string
        - `or` union[]
          - union
            - MatchingConditionsDictInput — recursive
            - string
        - `not` MatchingConditionsDictInput — recursive
      - string
  - `exclude_conditions` union[] — List of conditions used to exclude pull requests from the scheduled freeze. Pull requests matching these conditions will not be frozen.
    - union
      - MatchingConditionsDictInput
        - `and` union[]
          - union
            - MatchingConditionsDictInput — recursive
            - string
        - `or` union[]
          - union
            - MatchingConditionsDictInput — recursive
            - string
        - `not` MatchingConditionsDictInput — recursive
      - string

## Response `201`

Successful Response

- ScheduledFreezeObjectResponse
  - `id` string, uuid, required
  - `reason` string, required
  - `start` string, date-time, required
  - `end` string, date-time, nullable, required
  - `timezone` string, required
  - `matching_conditions` union[], required
    - union
      - MatchingConditionsDictOutput
        - `and` union[]
          - union
            - MatchingConditionsDictOutput — recursive
            - string
        - `or` union[]
          - union
            - MatchingConditionsDictOutput — recursive
            - string
        - `not` MatchingConditionsDictOutput — recursive
      - string
  - `exclude_conditions` union[]
    - union
      - MatchingConditionsDictOutput
        - `and` union[]
          - union
            - MatchingConditionsDictOutput — recursive
            - string
        - `or` union[]
          - union
            - MatchingConditionsDictOutput — recursive
            - string
        - `not` MatchingConditionsDictOutput — recursive
      - string

## Other responses

- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `422` — Unprocessable entity

---

[API](https://skmtc.net/mergify/apis/mergify-api.md) · [All operations](https://skmtc.net/mergify/apis/mergify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mergify/mergify-api/revisions/ae394a06c465/schema)
