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 | The domain of the Git |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items 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 | The 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 | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
pages_ | Boolean | Whether to force HTTPS |
pages_ | String | Set pages primary domain |
pages_ | Boolean | Whether to use unique domain |
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 | The 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 | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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 | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auto_ | Boolean | Enables automatic generation of SSL certificates issued by Let’s Encrypt for custom domains Default: false |
certificate | String (binary) or string | The certificate |
domainRequired | String | The domain |
key | String (binary) or string | The key |
user_ | String | — |
user_ | String | — |
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 | The ID or URL- |
domainPath, | String | The 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 | The ID or URL- |
domainPath, | String | The domain |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
auto_ | Boolean | Enables automatic generation of SSL certificates issued by Let’s Encrypt for custom domains |
certificate | String (binary) or string | The certificate |
key | String (binary) or string | The key |
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 | The ID or URL- |
domainPath, | String | The 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 | The ID or URL- |
domainPath, | String | The 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 | — |