Freeze Periods API
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
You can use the Freeze Periods API to manipulate GitLab Freeze Period entries.
Permissions and security
Users with Reporter permissions or greater can read Freeze Period API endpoints. Only users with the Maintainer role can modify Freeze Periods.
List freeze periods
Paginated list of freeze periods, sorted by created_at
in ascending order.
GET /projects/:id/freeze_periods
Attribute | Type | Required | Description |
---|---|---|---|
id | integer/string | yes | The ID or URL-encoded path of the project. |
Example request:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/19/freeze_periods"
Example response:
[
{
"id":1,
"freeze_start":"0 23 * * 5",
"freeze_end":"0 8 * * 1",
"cron_timezone":"UTC",
"created_at":"2020-05-15T17:03:35.702Z",
"updated_at":"2020-05-15T17:06:41.566Z"
}
]
Get a freeze period by a freeze_period_id
Get a freeze period for the given freeze_period_id
.
GET /projects/:id/freeze_periods/:freeze_period_id
Attribute | Type | Required | Description |
---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
freeze_period_id | integer | yes | The ID of the freeze period. |
Example request:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/19/freeze_periods/1"
Example response:
{
"id":1,
"freeze_start":"0 23 * * 5",
"freeze_end":"0 8 * * 1",
"cron_timezone":"UTC",
"created_at":"2020-05-15T17:03:35.702Z",
"updated_at":"2020-05-15T17:06:41.566Z"
}
Create a freeze period
Create a freeze period.
POST /projects/:id/freeze_periods
Attribute | Type | Required | Description |
---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
freeze_start | string | yes | Start of the freeze period in cron format. |
freeze_end | string | yes | End of the freeze period in cron format. |
cron_timezone | string | no | The time zone for the cron fields, defaults to UTC if not provided. |
Example request:
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: <your_access_token>" \
--data '{ "freeze_start": "0 23 * * 5", "freeze_end": "0 7 * * 1", "cron_timezone": "UTC" }' \
--request POST "https://gitlab.example.com/api/v4/projects/19/freeze_periods"
Example response:
{
"id":1,
"freeze_start":"0 23 * * 5",
"freeze_end":"0 7 * * 1",
"cron_timezone":"UTC",
"created_at":"2020-05-15T17:03:35.702Z",
"updated_at":"2020-05-15T17:03:35.702Z"
}
Update a freeze period
Update a freeze period for the given freeze_period_id
.
PUT /projects/:id/freeze_periods/:freeze_period_id
Attribute | Type | Required | Description |
---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
freeze_period_id | integer | yes | The ID of the freeze period. |
freeze_start | string | no | Start of the freeze period in cron format. |
freeze_end | string | no | End of the freeze period in cron format. |
cron_timezone | string | no | The time zone for the cron fields. |
Example request:
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: <your_access_token>" \
--data '{ "freeze_end": "0 8 * * 1" }' \
--request PUT "https://gitlab.example.com/api/v4/projects/19/freeze_periods/1"
Example response:
{
"id":1,
"freeze_start":"0 23 * * 5",
"freeze_end":"0 8 * * 1",
"cron_timezone":"UTC",
"created_at":"2020-05-15T17:03:35.702Z",
"updated_at":"2020-05-15T17:06:41.566Z"
}
Delete a freeze period
Delete a freeze period for the given freeze_period_id
.
DELETE /projects/:id/freeze_periods/:freeze_period_id
Attribute | Type | Required | Description |
---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
freeze_period_id | integer | yes | The ID of the freeze period. |
Example request:
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/19/freeze_periods/1"
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support