Plans: Every plan for CI upload tokens and read tokens; Core and Plus, and the free trial, for alert destination tokens. While the workspace is read-only, uploads and changes to alert destinations are refused with 402; reading keeps working. Who: owners and admins create and revoke API tokens; every member can see the token list.
Base URL
All endpoints are under https://app.pharussecurity.com/api/v1 and use HTTPS.Authentication
Send the token in theAuthorization header:
- starts with
phr_, followed by 43 letters, digits,-and_, so secret scanners can recognise it; - is shown once, when it is created. Pharus stores only a hash, so a lost token has to be replaced.
PHARUS_TOKEN in your CI system.
Agents such as Claude don’t use these tokens to write. They connect over OAuth and act for one person. See register and draft.
Three kinds of token
The alert destinations token and the read token are both workspace tokens. Each kind works only on its own endpoints: a CI upload token sent to
/api/v1/alert-destinations, or any other token sent to /api/v1/sboms, gets 401.
Create a token
Go to Settings → API tokens and select Create token. The dialog shows Access when you can create both kinds; otherwise it creates the kind your plan and product families allow.- CI upload token
- Alert destinations token
- Read token
1
Describe the token
Under Access, choose Upload SBOMs for one product family. You need at least one product family. Enter a Name, after the pipeline that uses it, for example “GitHub Actions – gateway-g3”. Pick the Product family and when it Expires: In 30 days, In 90 days, In 1 year (the default) or Never.
2
Copy it
Select Create token. Pharus shows the token once, under Copy your token: copy it and add it to your pipeline as the secret
PHARUS_TOKEN. Open pipeline snippets takes you to example steps on the SBOMs page.Revoke or rotate a token
To revoke a token, select Revoke token on its row and confirm. Pipelines and other clients using it get 401 from then on. This can’t be undone. To rotate a token, create a new one with the same access, replace the secret where it is used, check that the new token’s Last used changes, then revoke the old one. Every token stops working when it expires. A CI upload token also stops working while its product family is archived, and a read token when the person who created it leaves the company or stops being an owner or admin. Archived families’ tokens leave the list; they work again if the family is restored, unless they have expired or been revoked meanwhile. An alert destinations token keeps working after a move to Starter: it can still list and remove destinations, but adding one is refused with403.
Requests
- Use HTTPS.
- SBOM and VEX uploads send
POSTwith the file itself as the body, not a form upload and not wrapped in JSON. With curl, use--data-binary. Gzip the body and sendContent-Encoding: gzip; zstd works too. A request may be at most 4 MB as sent, and 50 MB once decompressed. OptionalX-Pharus-*headers add the product version and pipeline details. See upload an SBOM. - Alert destinations take a JSON body on
POST, sent withContent-Type: application/json. See alert destinations.
Responses
Responses are JSON. A successful upload returns202 Accepted for a new SBOM and 200 OK when Pharus already has the same file for that family, so a retry is safe. Listing alert destinations returns 200 OK, adding one 201 Created and removing one 204 No Content. The read endpoints return 200 OK.
Errors have this shape:
error is a stable code you can test for. message is an English explanation for your log. detail is only there when Pharus has more to say. A 400 with invalid_request from the alert destinations endpoints adds fields, which says what is wrong with each field.
Status codes
The Dependency-Track endpoint has a few codes of its own. See Dependency-Track. Each alert destinations endpoint lists its own on alert destinations.
402 when the workspace is read-only
When the free trial or the subscription ends without a new one, the workspace moves to Free and becomes read-only. When the owners close it, it is closed. In both cases every upload, and every request to add or remove an alert destination, gets402 with billing_lapsed, and the message says which: a Free workspace needs an owner to subscribe under Settings → Billing, and a closed one needs an owner to reopen it in company settings. Listing alert destinations and the read endpoints still work.
A 402 makes a CI step that uses curl --fail-with-body fail visibly, instead of the SBOM being dropped without a trace. See billing.
Rate limits
Each token can make 60 requests per hour, counted together across the endpoints it can use: for a CI upload token,POST /api/v1/sboms, POST /api/v1/vex and the Dependency-Track endpoint’s BOMs; for an alert destinations token, GET, POST and DELETE on /api/v1/alert-destinations. A read token can make 600 requests per hour across the read endpoints, as can an agent’s connection, which can also make 60 writes per hour. Every authenticated request counts, whether or not it stores anything: duplicates, rejected files, Dependency-Track test notifications and refused changes too. Dependency-Track’s analysis decisions have a separate limit of 1 000 per hour per token.
Past the limit, Pharus answers 429 with rate_limited and a Retry-After header with the number of seconds to wait.