Use this API to interact with the Composer package manager client.

This API is used by the Composer package manager client and is generally not meant for manual consumption.

These endpoints do not adhere to the standard API authentication methods. See the Composer package registry documentation for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.

List all packages for a group

GET /api/v4/group/{id}/-/packages/composer/p/{sha}

Lists all repository packages for a specified group. Composer V2 is recommended over V1.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the group
sha
Path, required
StringProvider SHA from the repository URL templates response
Example: 673594f85a55fe3c0eb45df7bd2fa9d95a1601ab

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not Found—

Composer v2 packages p2 endpoint for a group’s package versions metadata

GET /api/v4/group/{id}/-/packages/composer/p2/{package_name}

Retrieves the list of versions and metadata for a specified package for a group. This feature was introduced in GitLab 13.1

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the group
package_name
Path, required
StringThe Composer package name
Example: my-composer-package

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not Found—

Retrieve repository URL templates

GET /api/v4/group/{id}/-/packages/composer/packages

Retrieves the repository URL templates for requesting individual packages for a group. Composer V1 and V2 both use this endpoint. If the User-Agent header contains Composer/2, the endpoint returns the V2 response, which contains only packages and the metadata-url template. Composer V2 is recommended over V1.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the group

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not Found—

Composer packages endpoint for a group’s package versions metadata

GET /api/v4/group/{id}/-/packages/composer/{package_name}

Retrieves the list of versions and metadata for a specified package for a group. Composer V2 is recommended over V1. This feature was introduced in GitLab 12.1

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the group
package_name
Path, required
StringThe Composer package name, followed by $ and the SHA digest of the package from the V1 packages list. URL-encode $ as %24
Example: my-composer-package

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not Found—

Create a package

POST /api/v4/projects/{id}/packages/composer

Creates a Composer package from a specified Git tag or branch for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
branchStringName of the branch to target for the package. Exactly one of tag, branch must be provided
Example: release
tagStringName of the tag to target for the package. Exactly one of tag, branch must be provided
Example: v1.0.0

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Composer package endpoint to download a package archive

GET /api/v4/projects/{id}/packages/composer/archives/{package_name}

Downloads a specified Composer package archive for a project. The V1 and V2 package metadata responses provide this URL. The request must include a .zip file extension. This feature was introduced in GitLab 13.1

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
sha
Query, required
StringTarget SHA of the requested package version
Example: 673594f85a55fe3c0eb45df7bd2fa9d95a1601ab
package_name
Path, required
StringThe Composer package name
Example: my-composer-package

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—