Group badges API
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Use this API to interact with group badges. For more information, see group badges.
Badges support placeholders that are replaced in real time in both the link and image URL. The following placeholders are available:
%{project_path}: replaced by the project path.%{project_title}: replaced by the project title.%{project_name}: replaced by the project name.%{project_id}: replaced by the project ID.%{project_namespace}: replaced by the project’s namespace full path.%{group_name}: replaced by the project’s top-level group name.%{gitlab_server}: replaced by the project’s server name.%{gitlab_pages_domain}: replaced by the domain name hosting GitLab Pages.%{default_branch}: replaced by the project default branch.%{commit_sha}: replaced by the project’s last commit SHA.%{latest_tag}: replaced by the project’s last tag.
Because these endpoints aren’t inside a project’s context, the information used to replace the placeholders comes from the first group’s project by creation date. If the group has no project, the original URL with the placeholders is returned.
List all group badges
Lists badges for a specified group.
GET /groups/:id/badges| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the group |
name | string | no | Name of the badges to return (case-sensitive). |
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/groups/:id/badges?name=Coverage"Example response:
[
{
"name": "Coverage",
"id": 1,
"link_url": "http://example.com/ci_status.svg?project=%{project_path}&ref=%{default_branch}",