---
title: "Create or deprecate an NPM package"
method: PUT
path: "/api/v4/projects/{id}/packages/npm/{package_name}"
tags: ["packages_npm"]
---

# Create or deprecate an NPM package

`PUT /api/v4/projects/{id}/packages/npm/{package_name}`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/packages/npm/{package_name}`
- Auth: none declared

Creates or deprecates an NPM package for a specified project. Deprecate support was added in GitLab 16.0.

## Path parameters

- `id` string, required
- `package_name` string, required

## Request body

- PutApiV4ProjectsIdPackagesNpmPackageName: Create or deprecate an NPM package
  - `file` string, binary, required: The package file to be published (generated by Multipart middleware)

## Response `200`

Create or deprecate an NPM package

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
