Project Aliases API
Introduced in GitLab Premium 12.1.
All methods require administrator authorization.
List all project aliases
Get a list of all project aliases:
GET /project_aliases
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases"
Example response:
[
{
"id": 1,
"project_id": 1,
"name": "gitlab-foss"
},
{
"id": 2,
"project_id": 2,
"name": "gitlab"
}
]
Get project alias’ details
Get details of a project alias:
GET /project_aliases/:name
Attribute | Type | Required | Description |
---|---|---|---|
name
| string | yes | The name of the alias |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab"
Example response:
{
"id": 1,
"project_id": 1,
"name": "gitlab"
}
Create a project alias
Add a new alias for a project. Responds with a 201 when successful, 400 when there are validation errors (e.g. alias already exists):
POST /project_aliases
Attribute | Type | Required | Description |
---|---|---|---|
project_id
| integer/string | yes | The ID or path of the project. |
name
| string | yes | The name of the alias. Must be unique. |
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=1" --form "name=gitlab"
or
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases" --form "project_id=gitlab-org/gitlab" --form "name=gitlab"
Example response:
{
"id": 1,
"project_id": 1,
"name": "gitlab"
}
Delete a project alias
Removes a project aliases. Responds with a 204 when project alias exists, 404 when it doesn’t:
DELETE /project_aliases/:name
Attribute | Type | Required | Description |
---|---|---|---|
name
| string | yes | The name of the alias |
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/project_aliases/gitlab"
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc