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

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

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

The NuGet V3 Feed Service Index

GET /api/v4/groups/{id}/-/packages/nuget/index

Retrieves a list of available API resources. This endpoint can be accessed without authentication. The URLs in the response use the same route prefix as the request. With the group-level prefix, the URLs contain /groups/:id/-. This feature was introduced in GitLab 12.6

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group

Responses

CodeDescriptionSchema
200OKAPIEntitiesNugetServiceIndex
400Bad Request—
404Not Found—

The NuGet Metadata Service - Package name level

GET /api/v4/groups/{id}/-/packages/nuget/metadata/{package_name}/index

Retrieves metadata for a specified package. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group
package_name
Path, required
StringThe NuGet package name
Example: MyNuGetPkg

Responses

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

The NuGet Metadata Service - Package name and version level

GET /api/v4/groups/{id}/-/packages/nuget/metadata/{package_name}/{package_version}

Retrieves metadata for a specified package version. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group
package_name
Path, required
StringThe NuGet package name
Example: MyNuGetPkg
package_version
Path, required
StringThe NuGet package version
Pattern: [^\/]+
Example: 1.0.0

Responses

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

The NuGet Search Service

GET /api/v4/groups/{id}/-/packages/nuget/query

Searches for NuGet packages in the repository based on a specified query. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group
q
Query
StringSearch term
Example: MyNuGet
skip
Query
IntegerNumber of results to skip
Default: 0
Example: 1
take
Query
IntegerNumber of results to return
Default: 20
Example: 1
prerelease
Query
BooleanIf true, includes prerelease versions in the results
Default: true

Responses

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

The NuGet Symbol File Download Endpoint

GET /api/v4/groups/{id}/-/packages/nuget/symbolfiles/{file_name}/{signature}/{same_file_name}

Downloads a specified debugging symbol file (.pdb). Requires the Symbolchecksum header with the SHA256 checksum of the file, in the format SHA256:<checksum>. This feature was introduced in GitLab 16.7

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group
file_name
Path, required
StringThe symbol file name
Pattern: [^\/]+
Example: mynugetpkg.pdb
signature
Path, required
StringThe symbol file signature
Pattern: [^\/]+
Example: k813f89485474661234z7109cve5709eFFFFFFFF
same_file_name
Path, required
StringThe symbol file name. Must match the ‘file_name’ parameter

Responses

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

The NuGet V2 Feed Service Index

GET /api/v4/groups/{id}/-/packages/nuget/v2

Retrieves an XML document that represents the service index of the NuGet v2 source feed. This endpoint can be accessed without authentication. This feature was introduced in GitLab 16.2

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group

Responses

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

The NuGet V2 Feed Package $metadata endpoint

GET /api/v4/groups/{id}/-/packages/nuget/v2/$metadata

Returns metadata for the available endpoints in a NuGet v2 feed, as an OData EDMX XML document. This endpoint can be accessed without authentication. This feature was introduced in GitLab 16.3

Parameters

NameTypeDescription
id
Path, required
Integer or stringID of the group

Responses

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

Upload a NuGet v3 package file for a project

PUT /api/v4/projects/{id}/packages/nuget

Uploads a NuGet v3 package file for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Request body (multipart/form-data)

PropertyTypeDescription
package
Required
String (binary)The package file to be published (generated by Multipart middleware)

Responses

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

The NuGet Package Authorize endpoint

PUT /api/v4/projects/{id}/packages/nuget/authorize

This feature was introduced in GitLab 14.1

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

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

The NuGet Content Service - index request

GET /api/v4/projects/{id}/packages/nuget/download/{package_name}/index

Retrieves the index for a specified package, which includes a list of available versions. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Example: mynugetpkg.1.3.0.17.nupkg

Responses

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

The NuGet Content Service - content request

GET /api/v4/projects/{id}/packages/nuget/download/{package_name}/{package_version}/{package_filename}

Downloads a specified NuGet package file for a project. The package metadata service provides this URL. This endpoint exists only at the project-level route prefix, so a request with the group-level prefix returns 404. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Example: mynugetpkg.1.3.0.17.nupkg
package_version
Path, required
StringThe NuGet package version
Pattern: [^\/]+
Example: 1.3.0.17
package_filename
Path, required
StringThe NuGet package filename
Pattern: [^\/]+
Example: mynugetpkg.1.3.0.17.nupkg

Responses

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

The NuGet V3 Feed Service Index

GET /api/v4/projects/{id}/packages/nuget/index

Retrieves a list of available API resources. This endpoint can be accessed without authentication. The URLs in the response use the same route prefix as the request. With the group-level prefix, the URLs contain /groups/:id/-. This feature was introduced in GitLab 12.6

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

CodeDescriptionSchema
200OKAPIEntitiesNugetServiceIndex
400Bad Request—
404Not Found—

The NuGet Metadata Service - Package name level

GET /api/v4/projects/{id}/packages/nuget/metadata/{package_name}/index

Retrieves metadata for a specified package. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Example: MyNuGetPkg

Responses

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

The NuGet Metadata Service - Package name and version level

GET /api/v4/projects/{id}/packages/nuget/metadata/{package_name}/{package_version}

Retrieves metadata for a specified package version. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Example: MyNuGetPkg
package_version
Path, required
StringThe NuGet package version
Pattern: [^\/]+
Example: 1.0.0

Responses

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

The NuGet Search Service

GET /api/v4/projects/{id}/packages/nuget/query

Searches for NuGet packages in the repository based on a specified query. This feature was introduced in GitLab 12.8

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
q
Query
StringSearch term
Example: MyNuGet
skip
Query
IntegerNumber of results to skip
Default: 0
Example: 1
take
Query
IntegerNumber of results to return
Default: 20
Example: 1
prerelease
Query
BooleanIf true, includes prerelease versions in the results
Default: true

Responses

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

The NuGet Symbol File Download Endpoint

GET /api/v4/projects/{id}/packages/nuget/symbolfiles/{file_name}/{signature}/{same_file_name}

Downloads a specified debugging symbol file (.pdb). Requires the Symbolchecksum header with the SHA256 checksum of the file, in the format SHA256:<checksum>. This feature was introduced in GitLab 16.7

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
file_name
Path, required
StringThe symbol file name
Pattern: [^\/]+
Example: mynugetpkg.pdb
signature
Path, required
StringThe symbol file signature
Pattern: [^\/]+
Example: k813f89485474661234z7109cve5709eFFFFFFFF
same_file_name
Path, required
StringThe symbol file name. Must match the ‘file_name’ parameter

Responses

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

Upload a NuGet symbol package file

PUT /api/v4/projects/{id}/packages/nuget/symbolpackage

Uploads a specified NuGet symbol package file (.snupkg) for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Request body (multipart/form-data)

PropertyTypeDescription
package
Required
String (binary)The package file to be published (generated by Multipart middleware)

Responses

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

The NuGet Symbol Package Authorize endpoint

PUT /api/v4/projects/{id}/packages/nuget/symbolpackage/authorize

This feature was introduced in GitLab 14.1

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

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

The NuGet V2 Feed Service Index

GET /api/v4/projects/{id}/packages/nuget/v2

Retrieves an XML document that represents the service index of the NuGet v2 source feed. This endpoint can be accessed without authentication. This feature was introduced in GitLab 16.2

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

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

Upload a NuGet v2 package file for a project

PUT /api/v4/projects/{id}/packages/nuget/v2

Uploads a NuGet v2 package file for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Request body (multipart/form-data)

PropertyTypeDescription
package
Required
String (binary)The package file to be published (generated by Multipart middleware)

Responses

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

The NuGet V2 Feed Package $metadata endpoint

GET /api/v4/projects/{id}/packages/nuget/v2/$metadata

Returns metadata for the available endpoints in a NuGet v2 feed, as an OData EDMX XML document. This endpoint can be accessed without authentication. This feature was introduced in GitLab 16.3

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

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

The NuGet V2 Feed Package Authorize endpoint

PUT /api/v4/projects/{id}/packages/nuget/v2/authorize

This feature was introduced in GitLab 16.2

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project

Responses

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

The NuGet Package Delete endpoint

DELETE /api/v4/projects/{id}/packages/nuget/{package_name}/{package_version}

Deletes a specified NuGet package. This feature was introduced in GitLab 16.5

Parameters

NameTypeDescription
id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Pattern: ^[\-+._a-zA-Z0-9]+$
Example: mynugetpkg
package_version
Path, required
StringThe NuGet package version
Pattern: ^(?:(0|[1-9]\d*))\.(?:(0|[1-9]\d*))(\.(?:(0|[1-9]\d*)))?(\.\d*)?(?:(?:-((?:\d*[a-zA-Z\-][0-9a-zA-Z\-]*|[1-9]\d*|0)(?:\.(?:\d*[a-zA-Z\-][0-9a-zA-Z\-]*|[1-9]\d*|0))*))?(?:\+([0-9a-zA-Z\-]+(?:\.[0-9a-zA-Z\-]+)*))?)$
Example: 1.0.1

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

The NuGet V2 Feed Find Packages by ID endpoint

GET /api/v4/projects/{project_id}/packages/nuget/v2/FindPackagesById()

Returns an OData XML document that contains information about the package with the given name. The endpoint does not receive an authentication token, so it cannot return the latest version of the package. The version must be provided when a package is installed or upgraded with the NuGet v2 feed. This feature was introduced in GitLab 16.4

Parameters

NameTypeDescription
project_id
Path, required
String or integerID of the project
id
Query, required
StringName of the NuGet package
Pattern: ^[\-+._a-zA-Z0-9]+$
Example: mynugetpkg

Responses

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

The NuGet V2 Feed Enumerate Packages endpoint

GET /api/v4/projects/{project_id}/packages/nuget/v2/Packages()

Returns an OData XML document that contains information about the package with the given name. The endpoint does not receive an authentication token, so it cannot return the latest version of the package. The version must be provided when a package is installed or upgraded with the NuGet v2 feed. This feature was introduced in GitLab 16.4

Parameters

NameTypeDescription
project_id
Path, required
String or integerID of the project
$filter
Query, required
StringOData filter expression with the NuGet package name, in the form tolower(Id) eq '<package_name>'
Pattern: ^[\-+._a-zA-Z0-9]+$
Example: mynugetpkg

Responses

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

The NuGet V2 Feed Single Package Metadata endpoint

GET /api/v4/projects/{project_id}/packages/nuget/v2/Packages(Id='{package_name}',Version='{package_version}')

Returns an OData XML document that contains information about the package with the given name and version. This feature was introduced in GitLab 16.4

Parameters

NameTypeDescription
project_id
Path, required
String or integerID of the project
package_name
Path, required
StringThe NuGet package name
Pattern: ^[\-+._a-zA-Z0-9]+$
Example: mynugetpkg
package_version
Path, required
StringThe NuGet package version
Pattern: ^(?:(0|[1-9]\d*))\.(?:(0|[1-9]\d*))(\.(?:(0|[1-9]\d*)))?(\.\d*)?(?:(?:-((?:\d*[a-zA-Z\-][0-9a-zA-Z\-]*|[1-9]\d*|0)(?:\.(?:\d*[a-zA-Z\-][0-9a-zA-Z\-]*|[1-9]\d*|0))*))?(?:\+([0-9a-zA-Z\-]+(?:\.[0-9a-zA-Z\-]+)*))?)$
Example: 1.3.0.17

Responses

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

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesNugetDependency

PropertyTypeDescription
@idStringExample: http://gitlab.com/Sandbox.App/1.0.0.json#dependency
@typeStringExample: PackageDependency
idStringExample: Dependency
rangeStringExample: 2.0.0

APIEntitiesNugetDependencyGroup

PropertyTypeDescription
@idStringExample: http://gitlab.com/Sandbox.App/1.0.0.json#dependencygroup
@typeStringExample: PackageDependencyGroup
dependenciesArray of APIEntitiesNugetDependency—
targetFrameworkStringExample: fwk test

APIEntitiesNugetPackageMetadata

PropertyTypeDescription
@idStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata/MyNuGetPkg/1.3.0.17.json
catalogEntryAPIEntitiesNugetPackageMetadataCatalogEntry—
packageContentStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/download/MyNuGetPkg/1.3.0.17/helloworld.1.3.0.17.nupkg

APIEntitiesNugetPackageMetadataCatalogEntry

PropertyTypeDescription
@idStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata/MyNuGetPkg/1.3.0.17.json
authorsStringExample: Authors
dependencyGroupsArray of APIEntitiesNugetDependencyGroup—
descriptionStringExample: Description
iconUrlStringExample: http://sandbox.com/icon
idStringExample: MyNuGetPkg
licenseUrlStringExample: http://sandbox.com/license
packageContentStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/download/MyNuGetPkg/1.3.0.17/helloworld.1.3.0.17.nupkg
projectUrlStringExample: http://sandbox.com/project
publishedStringExample: 2023-05-08T17:23:25Z
summaryStringExample: Description
tagsStringExample: tag#1 tag#2
versionStringExample: 1.3.0.17

APIEntitiesNugetPackagesMetadata

PropertyTypeDescription
countIntegerExample: 1
itemsArray of APIEntitiesNugetPackagesMetadataItem—

APIEntitiesNugetPackagesMetadataItem

PropertyTypeDescription
@idStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata/MyNuGetPkg/1.3.0.17.json
countIntegerExample: 1
itemsArray of APIEntitiesNugetPackageMetadata—
lowerStringExample: 1.3.0.17
upperStringExample: 1.3.0.17

APIEntitiesNugetPackagesVersions

PropertyTypeDescription
versionsArray of stringsExample: ["1.3.0.17"]

APIEntitiesNugetSearchResult

PropertyTypeDescription
@typeStringExample: Package
authorsStringExample: Authors
descriptionStringExample: Description
iconUrlStringExample: http://sandbox.com/icon
idStringExample: MyNuGetPkg
licenseUrlStringExample: http://sandbox.com/license
projectUrlStringExample: http://sandbox.com/project
summaryStringExample: Description
tagsStringExample: tag#1 tag#2
titleStringExample: MyNuGetPkg
totalDownloadsIntegerExample: 1
verifiedBoolean—
versionStringExample: 1.3.0.17
versionsArray of APIEntitiesNugetSearchResultVersion—

APIEntitiesNugetSearchResults

PropertyTypeDescription
dataArray of APIEntitiesNugetSearchResult—
totalHitsIntegerExample: 1

APIEntitiesNugetSearchResultVersion

PropertyTypeDescription
@idStringExample: https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata/MyNuGetPkg/1.3.0.17.json
downloadsIntegerExample: 1
versionStringExample: 1.3.0.17

APIEntitiesNugetServiceIndex

PropertyTypeDescription
resourcesArray of objectsExample: [{"@id":"https://gitlab.com/api/v4/projects/1/packages/nuget/query","@type":"SearchQueryService","comment":"Filter and search for packages by keyword."}]
versionStringExample: 1.3.0.17