Conan v2 API
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Version history
-
Introduced in GitLab 17.11 with a flag named
conan_package_revisions_support
. Disabled by default.
The availability of this feature is controlled by a feature flag. For more information, see the history.
For Conan v1 operations, see Conan v1 API.
Use this API to interact with the Conan v2 package manager. For more information, see Conan packages in the package registry or Conan 2 package manager client.
Generally, these endpoints are used by the Conan 2 package manager client and are not meant for manual consumption.
-
These endpoints do not adhere to the standard API authentication methods. See each route for details on how credentials are expected to be passed. Undocumented authentication methods might be removed in the future.
-
The Conan registry is not FIPS compliant and is disabled when FIPS mode is enabled. These endpoints all return
404 Not Found
.
Create an authentication token
Creates a JSON Web Token (JWT) for use as a Bearer header in other requests.
"Authorization: Bearer <token>
The Conan 2 package manager client automatically uses this token.
GET /projects/:id/packages/conan/v2/users/authenticate
Attribute | Type | Required | Description |
---|---|---|---|
id |
string | Conditionally | The project ID or full project path. Required only for the project endpoint. |
Generate a base64-encoded Basic Auth token:
echo -n "<username>:<personal_access_token>"|base64
Use the base64-encoded Basic Auth token to get a JWT token:
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
Example response:
eyJhbGciOiJIUzI1NiIiheR5cCI6IkpXVCJ9.eyJhY2Nlc3NfdG9rZW4iOjMyMTQyMzAsqaVzZXJfaWQiOjQwNTkyNTQsImp0aSI6IjdlNzBiZTNjLWFlNWQtNDEyOC1hMmIyLWZiOThhZWM0MWM2OSIsImlhd3r1MTYxNjYyMzQzNSwibmJmIjoxNjE2NjIzNDMwLCJleHAiOjE2MTY2MjcwMzV9.QF0Q3ZIB2GW5zNKyMSIe0HIFOITjEsZEioR-27Rtu7E
Verify authentication credentials
Verifies the validity of Basic Auth credentials or a Conan JWT generated from the Conan v1 /authenticate
endpoint.
GET /projects/:id/packages/conan/v2/users/check_credentials
Attribute | Type | Required | Description |
---|---|---|---|
id |
string | yes | The project ID or full project path. |
curl --request GET \
--header "Authorization: Bearer <authenticate_token>" \
--url "https://gitlab.example.com/api/v4/projects/<project_id>/packages/conan/v2/users/check_credentials"
Example response:
ok
Search for a Conan package
Searches the project for a Conan package with a specified name.
GET /projects/:id/packages/conan/v2/conans/search?q=:query
Attribute | Type | Required | Description |
---|---|---|---|
id |
string | yes | The project ID or full project path. |
query |
string | yes | Search query. You can use * as a wildcard. |
curl --request GET \
--header "Authorization: Bearer <authenticate_token>" \
--url "https://gitlab.example.com/api/v4/projects/9/packages/conan/v2/conans/search?q=Hello*"
Example response:
GET /projects/:id/packages/conan/v2/users/authenticate
```0
## Get latest recipe revision
Gets the revision hash and creation date of the latest package recipe.
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```1
| Attribute | Type | Required | Description |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```2
Example response:
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```3
## List all recipe revisions
Lists all revisions for a package recipe.
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```4
| Attribute | Type | Required | Description |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```5
Example response:
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```6
## List all recipe files
Lists all recipe files from the package registry.
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```7
| Attribute | Type | Required | Description |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```8
Example response:
```plaintext
GET /projects/:id/packages/conan/v2/users/authenticate
```9
## Get a recipe file
Gets a recipe file from the package regitry.
```shell
echo -n "<username>:<personal_access_token>"|base64
```0
| Attribute | Type | Required | Description |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
| `file_name` | string | yes | The name and file extension of the requested file. |
```shell
echo -n "<username>:<personal_access_token>"|base64
```1
You can also write the output to a file by using:
```shell
echo -n "<username>:<personal_access_token>"|base64
```2
This example writes to `conanfile.py` in the current directory.
## Upload a recipe file
Uploads a recipe file to the package registry.
```shell
echo -n "<username>:<personal_access_token>"|base64
```3
| Attribute | Type | Required | Description |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
| `file_name` | string | yes | The name and file extension of the requested file. |
```shell
echo -n "<username>:<personal_access_token>"|base64
```4
Example response:
```shell
echo -n "<username>:<personal_access_token>"|base64
```5
## Get latest package revision
Gets the revision hash and creation date of the latest package revision for a specific recipe revision and package reference.
```shell
echo -n "<username>:<personal_access_token>"|base64
```6
| Attribute | Type | Required | Description |
|---------------------------|--------|----------|-------------|
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
| `conan_package_reference` | string | yes | Reference hash of a Conan package. Conan generates this value. |
```shell
echo -n "<username>:<personal_access_token>"|base64
```7
Example response:
```shell
echo -n "<username>:<personal_access_token>"|base64
```8
## Get a package file
Gets a package file from the package registry.
```shell
echo -n "<username>:<personal_access_token>"|base64
```9
| Attribute | Type | Required | Description |
| ------------------------- | ---- | -------- | ----------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
| `conan_package_reference` | string | yes | Reference hash of a Conan package. Conan generates this value. |
| `package_revision` | string | yes | Revision of the package. Does not accept a value of `0`. |
| `file_name` | string | yes | The name and file extension of the requested file. |
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```0
You can also write the output to a file by using:
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```1
This example writes to `conaninfo.txt` in the current directory.
## Upload a package file
Uploads a package file to the package registry.
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```2
| Attribute | Type | Required | Description |
| ------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
| `recipe_revision` | string | yes | Revision of the recipe. Does not accept a value of `0`. |
| `conan_package_reference` | string | yes | Reference hash of a Conan package. Conan generates this value. |
| `package_revision` | string | yes | Revision of the package. Does not accept a value of `0`. |
| `file_name` | string | yes | The name and file extension of the requested file. |
Provide the file context in the request body:
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```3
Example response:
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```4
## Get package references metadata
Gets the metadata for all package references of a package.
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```5
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | yes | The project ID or full project path. |
| `package_name` | string | yes | Name of a package. |
| `package_version` | string | yes | Version of a package. |
| `package_username` | string | yes | Conan username of a package. This attribute is the `+`-separated full path of your project. |
| `package_channel` | string | yes | Channel of a package. |
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```6
Example response:
```shell
curl --request GET \
--header 'Authorization: Basic <base64-encoded-token>' \
--url "https://gitlab.example.com/api/v4/packages/conan/v2/users/authenticate"
```7
The response includes the following metadata for each package reference:
- `settings`: The build settings used for the package.
- `options`: The package options.
- `requires`: The required dependencies for the package.
- `recipe_hash`: The hash of the recipe.