Use this API to retrieve the file templates available to an entire instance:
Custom CI/CD templates are not available from these endpoints. For templates specific to a project, use the project templates API.
Users with the Guest role can’t access these templates. For more information, see project and group visibility.
List all Dockerfile templates
GET /api/v4/templates/dockerfiles
Lists all Dockerfile templates.
Parameters
| Name | Type | Description |
|---|---|---|
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 a Dockerfile template
GET /api/v4/templates/dockerfiles/{name}
Retrieves a specified Dockerfile template.
Parameters
| Name | Type | Description |
|---|---|---|
namePath, | String | The name of the Dockerfile template |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all .gitignore templates
GET /api/v4/templates/gitignores
Lists all .gitignore templates.
Parameters
| Name | Type | Description |
|---|---|---|
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 a .gitignore template
GET /api/v4/templates/gitignores/{name}
Retrieves a specified .gitignore template.
Parameters
| Name | Type | Description |
|---|---|---|
namePath, | String | The name of the . |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all GitLab CI/CD YAML templates
GET /api/v4/templates/gitlab_ci_ymls
Lists all GitLab CI/CD YAML templates.
Parameters
| Name | Type | Description |
|---|---|---|
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 a GitLab CI/CD YAML template
GET /api/v4/templates/gitlab_ci_ymls/{name}
Retrieves a specified GitLab CI/CD YAML template.
Parameters
| Name | Type | Description |
|---|---|---|
namePath, | String | The name of the Git |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List all license templates
GET /api/v4/templates/licenses
Lists all available license templates.
Parameters
| Name | Type | Description |
|---|---|---|
popularQuery | Boolean | If true,false, |
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 a license template
GET /api/v4/templates/licenses/{name}
Retrieves a specified license template. You can pass parameters to replace the license placeholder. If fullname is omitted and the request is authenticated, the name of the authenticated user replaces the copyright holder placeholder.
Parameters
| Name | Type | Description |
|---|---|---|
namePath, | String | Name of the license template |
projectQuery | String | Name of the copyrighted project |
fullnameQuery | String | Full name of the copyright holder |
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.
APIEntitiesLicense
| Property | Type | Description |
|---|---|---|
conditions | Array of strings | Example:["include- |
content | String | Example:GNU GENERAL PUBLIC LICENSE |
description | String | Example:A simple license |
html_ | String | Example:http: |
key | String | Example:gpl- |
limitations | Array of strings | Example:["liability"] |
name | String | Example:GNU General Public License v3. |
nickname | String | Example:GNU GPLv3 |
permissions | Array of strings | Example:["commercial- |
popular | Boolean | — |
source_ | String | — |
APIEntitiesTemplate
| Property | Type | Description |
|---|---|---|
content | String | Content of the template Example: # Ruby gitignore template |
name | String | Name of the template Example: Ruby |
APIEntitiesTemplatesList
| Property | Type | Description |
|---|---|---|
key | String | Key of the template Example: mit |
name | String | Name of the template Example: MIT License |