Scheduled Freeze
Schedule merge queue freezes for maintenance or release windows.
Get scheduled freezes #
/repos/{owner}/{repository}/scheduled_freeze
Get all the ongoing or scheduled freezes for the repository specified in the path
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
Example Response
{
"scheduled_freezes": [
{
"id": "string",
"reason": "string",
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"timezone": "string",
"matching_conditions": null,
"exclude_conditions": null
}
]
}
403 Forbidden
404 Not found
409 Conflict
422 Unprocessable entity
Example Request
curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze" \
-H "Authorization: Bearer <token>"
Create a scheduled freeze #
/repos/{owner}/{repository}/scheduled_freeze
Create a scheduled freeze for the repository specified in the path
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The reason for the scheduled freeze.
When the scheduled freeze begins (date and time in ISO 8601 format without TZ). Begins now if the attribute is null.
When the scheduled freeze ends (date and time in ISO 8601 format without TZ).
Timezone where the freeze is expected to happen.
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.
List of conditions used to exclude pull requests from the scheduled freeze. Pull requests matching these conditions will not be frozen.
201 Successful Response
Example Response
{
"id": "string",
"reason": "string",
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"timezone": "string",
"matching_conditions": [
{
"and": null,
"or": null,
"not": {}
}
],
"exclude_conditions": [
{
"and": null,
"or": null,
"not": {}
}
]
}
403 Forbidden
404 Not found
409 Conflict
422 `CONFIGURATION_INVALID`: The repository's Mergify configuration is invalid. `extended_repository` names the repository its `extends` points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no `error_code`.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string",
"extended_repository": "string"
}
Example Request
curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"reason": "string",
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"timezone": "string",
"matching_conditions": [
{
"and": null,
"or": null,
"not": {}
}
],
"exclude_conditions": [
{
"and": null,
"or": null,
"not": {}
}
]
}'
Update a scheduled freeze #
/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}
Update an existing scheduled freeze on the repository specified in the path. Only the fields provided in the request body will be updated.
freeze_id
string <uuid>
required
The scheduled freeze `id`
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The reason for the scheduled freeze.
When the scheduled freeze begins (date and time in ISO 8601 format without TZ). Can only be updated if the scheduled freeze has not yet begun. Set to null to start now.
When the scheduled freeze ends (date and time in ISO 8601 format without TZ). Set to null for an indefinite freeze.
Timezone where the freeze is expected to happen.
List of conditions used to match pull requests that need to be frozen during the scheduled freeze.
List of conditions used to exclude pull requests from the scheduled freeze. Pull requests matching these conditions will not be frozen.
200 Successful Response
Example Response
{
"id": "string",
"reason": "string",
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"timezone": "string",
"matching_conditions": [
{
"and": null,
"or": null,
"not": {}
}
],
"exclude_conditions": [
{
"and": null,
"or": null,
"not": {}
}
]
}
400 The scheduled freeze `start` attribute cannot be updated, because the scheduled freeze has already started
403 Forbidden
404 The scheduled freeze with the given id does not exist
409 Conflict
422 `CONFIGURATION_INVALID`: The repository's Mergify configuration is invalid. `extended_repository` names the repository its `extends` points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no `error_code`.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string",
"extended_repository": "string"
}
Example Request
curl -X PATCH "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"reason": "string",
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"timezone": "string",
"matching_conditions": [
{
"and": null,
"or": null,
"not": {}
}
],
"exclude_conditions": [
{
"and": null,
"or": null,
"not": {}
}
]
}'
Delete a scheduled freeze #
/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}
Delete an existing scheduled freeze on the repository specified in the path
freeze_id
string <uuid>
required
The scheduled freeze `id`
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The reason for the deletion
204 Successful Response
403 Forbidden
404 The scheduled freeze with the given id does not exist
409 Conflict
422 `CONFIGURATION_INVALID`: The repository's Mergify configuration is invalid. `extended_repository` names the repository its `extends` points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no `error_code`.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string",
"extended_repository": "string"
}
Example Request
curl -X DELETE "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"delete_reason": "string"
}'
Delete a scheduled freeze #
/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}/delete
Delete an existing scheduled freeze on the repository specified in the path
freeze_id
string <uuid>
required
The scheduled freeze `id`
repository
string
required
The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner
string
required
The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
The reason for the deletion
204 Successful Response
403 Forbidden
404 The scheduled freeze with the given id does not exist
409 Conflict
422 `CONFIGURATION_INVALID`: The repository's Mergify configuration is invalid. `extended_repository` names the repository its `extends` points to when the error is in that repository's configuration file, and is null otherwise, including when the error only appears once the two configurations are merged. The route's other 422s carry no `error_code`.
CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE IP_ALLOW_LIST_NOT_CONFIGURED NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PIPELINE_NAME_TAKEN PIPELINE_NOT_FOUND PIPELINE_RUN_NOT_FOUND PULL_REQUEST_NOT_QUEUED RETRY_RULE_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_RETRY_NOT_CONFIGURED TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "CONFIGURATION_BRANCH_REFUSED",
"documentation_url": "string",
"extended_repository": "string"
}
Example Request
curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id/delete" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"delete_reason": "string"
}'
Was this page helpful?
Thanks for your feedback!