Use this API to administer and use GitLab Pages, including managing custom domains.
GitLab Pages must be enabled to use these endpoints.
List all Pages domains
GET /api/v4/pages/domains
Lists all Pages domains on the instance. You must have administrator access to the instance.
Parameters
| Name | Type | Description |
|---|---|---|
domainQuery | String | Domain of the Git |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
Retrieve Pages settings for a project
GET /api/v4/projects/{id}/pages
Retrieves Pages settings for a specified project. You must have the Maintainer or Owner role for the project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Update Pages settings for a project
PATCH /api/v4/projects/{id}/pages
Updates Pages settings for a specified project. You must have the Maintainer or Owner role for the project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
pages_ | Boolean | If true, |
pages_ | String | Primary domain, |
pages_ | Boolean | If true, |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Unpublish Pages
DELETE /api/v4/projects/{id}/pages
Unpublishes Pages from a specified project. You must have the Maintainer or Owner role for the project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
List all Pages domains in a project
GET /api/v4/projects/{id}/pages/domains
Lists all Pages domains in a specified project. You must have permissions to view Pages domains.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Create Pages domain
POST /api/v4/projects/{id}/pages/domains
Creates a Pages domain in a specified project. You must have permissions to create Pages domains.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auto_ | Boolean | If true,Default: false |
certificate | String (binary) or string | Certificate in PEM format with intermediates following in most specific to least specific order |
domainRequired | String | Custom domain |
key | String (binary) or string | Certificate key in PEM format |
user_ | String | All or none of user_,user_ must be provided |
user_ | String | All or none of user_,user_ must be provided |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Retrieve a Pages domain
GET /api/v4/projects/{id}/pages/domains/{domain}
Retrieves a Pages domain from a specified project. You must have permissions to view Pages domains.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
domainPath, | String | Custom domain |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Update Pages domain
PUT /api/v4/projects/{id}/pages/domains/{domain}
Updates a specified Pages domain in a project. You must have permissions to change an existing Pages domain.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
domainPath, | String | Custom domain |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auto_ | Boolean | If true, |
certificate | String (binary) or string | Certificate in PEM format with intermediates following in most specific to least specific order |
key | String (binary) or string | Certificate key in PEM format |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Delete Pages domain
DELETE /api/v4/projects/{id}/pages/domains/{domain}
Deletes a specified Pages domain in a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
domainPath, | String | Custom domain |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Resource deleted | — |
400 | Bad Request | — |
404 | Not Found | — |
Verify Pages domain
PUT /api/v4/projects/{id}/pages/domains/{domain}/verify
Verifies a specified Pages domain in a project. You must have permissions to update Pages domains.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
domainPath, | String | Custom domain to verify |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesPagesDomain
| Property | Type | Description |
|---|---|---|
auto_ | String | — |
certificate | APIEntities | — |
domain | String | — |
enabled_ | String | — |
url | String | — |
verification_ | String | — |
verified | String | — |
APIEntitiesPagesDomainBasic
| Property | Type | Description |
|---|---|---|
auto_ | String | — |
certificate_ | APIEntities | — |
domain | String | — |
enabled_ | String | — |
project_ | String | — |
url | String | — |
verification_ | String | — |
verified | String | — |
APIEntitiesPagesDomainCertificate
| Property | Type | Description |
|---|---|---|
certificate | String | — |
certificate_ | String | — |
expired | String | — |
subject | String | — |
APIEntitiesPagesDomainCertificateExpiration
| Property | Type | Description |
|---|---|---|
expiration | String | — |
expired | String | — |