Skip to main content
Plans: Every plan. Refused with 402 while the workspace is read-only. Who: anyone with an API token for the product family; owners and admins create tokens.
POST /api/v1/sboms stores one SBOM for the product family the token belongs to, then matches it within seconds. Send the same file again and Pharus answers with the SBOM it already has, so retries are safe.

Example

--fail-with-body makes curl exit with an error on any 4xx or 5xx answer and still print Pharus’ message, so a failed upload fails the CI step.

Headers

The commit, branch, repository and run link show in the Pipeline card on the SBOM’s page in Pharus.

Query parameters

Body

The raw SBOM file, plain or gzipped. Not a multipart form, and not wrapped in another JSON object.
  • CycloneDX JSON 1.4, 1.5, 1.6 or 1.7, or SPDX JSON 2.2 or 2.3.
  • At most 4 MB as sent, and 50 MB decompressed. Gzip keeps most SBOMs far below the first limit.
  • At most 50 000 components.
Without a version in the header or the query, Pharus uses the product version in the SBOM. A new SBOM for a version replaces the active SBOM of that version in the family; SBOMs of other versions stay active. See what happens after an SBOM arrives.

Responses

202 Accepted

A new SBOM was stored. Matching runs after the response.

200 OK

The family already has an SBOM with exactly these bytes. Nothing new was stored, and the response describes the SBOM Pharus has.

Errors

Errors return { "error", "message" }, sometimes with detail. See the error format. Pharus checks in this order: the token, the rate limit, the body’s size and encoding, the workspace, whether the file is a duplicate, and then the SBOM itself.

API introduction

GitHub Actions

Azure Pipelines

GitLab CI