Skip to content

Retrieve a template of a particular type

GET
/api/v4/projects/{id}/templates/{type}/{name}

Retrieves a template of a specified type for a project.

id
required
One of:
string

The ID or URL-encoded path of the project

type
required
string
>= 1 characters
Allowed values: dockerfiles gitignores gitlab_ci_ymls licenses issues merge_requests

The type (dockerfiles|gitignores|gitlab_ci_ymls|licenses|issues|merge_requests) of the template

name
required
string

The key of the template, as obtained from the collection endpoint.

Example
MIT
source_template_project_id
integer
nullable

The project id where a given template is being stored. This is useful when multiple templates from different projects have the same name

Example
1
project
string
nullable

The project name to use when expanding placeholders in the template. Only affects licenses

Example
GitLab
fullname
string
nullable

The full name of the copyright holder to use when expanding placeholders in the template. Only affects licenses

Example
GitLab B.V.

OK

Media type application/json
object
key
string
name
string
nickname
string
html_url
string
source_url
string
popular
boolean
description
string
conditions
Array<string>
permissions
Array<string>
limitations
Array<string>
content
string
Example
{
"key": "gpl-3.0",
"name": "GNU General Public License v3.0",
"nickname": "GNU GPLv3",
"html_url": "http://choosealicense.com/licenses/gpl-3.0",
"description": "A simple license",
"conditions": [
"include-copyright"
],
"permissions": [
"commercial-use"
],
"limitations": [
"liability"
],
"content": "GNU GENERAL PUBLIC LICENSE"
}

Bad Request

Unauthorized

Not found