Create or publish a package by slug
PUT/packages
Create a package, or publish a new revision of an existing one, in a single idempotent call keyed on nrn and slug.
- When
nrnhas no package with that slug, creates the package and returns201.nameis required. To publish the first revision in the same call, sendcomponentswith an explicitversion;bumpneeds a prior revision, so it can't be used here. - Otherwise, applies the call to the existing package and returns
200: it publishes a new revision when you sendcomponents, and updatesvisible_toordefault_revision_idwhen you send them.nameis ignored on this path; rename a package withPATCH.
version (explicit semver) and bump (patch, minor or major, relative to the latest revision) are mutually exclusive, and either one must be paired with components. With merge_components (default true) the components overlay the current bill of materials by name; with false the body must list the complete new bill of materials. default: true promotes the published revision in the same call.
PUT is the pipeline-friendly call. It needs no package id, creates the package on the first run, and every later run publishes against the same nrn and slug, so re-running it is safe. Use PATCH /packages/{id} when you already have the id, or to rename the package.
ℹ️ Note: Publishing a bill of materials identical to the latest revision's doesn't create a new revision. Publishing an existing version with a different bill of materials fails with
409.
Request
Responses
- 200
- 201
- 4XX
- 5XX
The existing package after the call.
The package was created, with its first revision when the call sent components and version.
Client error responses due to invalid input, missing parameters or insufficient permissions.
Server error responses.