Skip to content

Trust a GitHub repository's Actions runs to upload SBOMs (admin)

POST
/v1/orgs/{org}/trusted-publishers
curl --request POST \
--url https://example.com/v1/orgs/example/trusted-publishers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "repository": "example", "repository_owner_id": 1, "repository_id": 1, "workflow": "example", "ref_pattern": "example", "environment": "example" }'

Runs of the repository may then call POST /v1/orgs/{org}/sbom-uploads with their OIDC token instead of an API key. The repository is pinned by GitHub’s numeric IDs, which survive renames. For a public repository they are looked up on GitHub; for a private one, send them (gh api repos/OWNER/NAME --jq '.owner.id, .id'). Workflow, ref pattern and environment are optional restrictions; all that are set must match.

org
required
string

Organization (tenant) slug, e.g. alpenrobotik

Media typeapplication/json
object
repository
required

Owner/name

string
repository_owner_id

Private repositories only

integer format: int64
repository_id

Private repositories only

integer format: int64
workflow

Workflow file, e.g. release.yml or .github/workflows/release.yml

string
ref_pattern

Glob on the git ref, e.g. refs/tags/v*

string
environment

GitHub environment the job must run in

string

Example generated

{
"repository": "example",
"repository_owner_id": 1,
"repository_id": 1,
"workflow": "example",
"ref_pattern": "example",
"environment": "example"
}

Created

Media typeapplication/json
object
id
required
string format: uuid
repository_owner_id
required
integer format: int64
repository_id
required
integer format: int64
repository
required

Owner/name when it was added; matching uses the IDs

string
workflow

E.g. .github/workflows/release.yml; absent: any workflow

string
ref_pattern

E.g. refs/tags/v*; absent: any ref

string
environment

Absent: any environment, or none

string
created_by

User who added it

string
created_at
required
string format: date-time

Example generated

{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"repository_owner_id": 1,
"repository_id": 1,
"repository": "example",
"workflow": "example",
"ref_pattern": "example",
"environment": "example",
"created_by": "example",
"created_at": "2026-04-15T12:00:00Z"
}

Invalid repository

Caller is not an admin

The same rule exists already

Over the operation’s rate-limit budget (x-affectra-budget): code request.rateLimited with params.budget. Wait Retry-After seconds before trying again.

Media typeapplication/problem+json

Every error answer, Content-Type application/problem+json. The web app and integrations translate code; detail is English, for people reading curl output or CI logs, and may change wording at any time. Match on code, never on detail.

object
status
required

The HTTP status

integer
code
required

Stable error codes. A code is never renamed; new ones may be added, so a client falls back to detail for a code it doesn’t know. Another organization’s object answers notFound, the same as a missing one.

string
Allowed values: notFound internal request.invalidJson request.invalid request.alreadyExists request.timeInvalid auth.required auth.csrfMissing email.invalid accounts.passwordUnavailable locale.invalid request.rateLimited auth.sessionRequired auth.roleTooLow auth.githubTokenUploadOnly org.suspended org.required request.fieldRequired request.textInvalid request.timeout server.notReady catalog.unavailable report.invalid report.wrongTenant settings.csafNamespaceInvalid settings.digestHourInvalid settings.timeZoneInvalid sbom.invalid sbom.limitExceeded sbom.signatureInvalid sbom.signatureRequired sbom.signatureUnavailable upload.hardwareRevisionRenamed upload.malformed upload.unexpectedPart upload.sbomMissing upload.tooLarge upload.unreadable provenance.invalid provenance.sbomAttestation provenance.signatureRequired provenance.unavailable vex.vulnerabilityInvalid vex.statusInvalid vex.justificationUnknown vex.justificationNotAllowed vex.justificationRequired vex.actionRequired vex.statementTooLong vex.csafNamespaceRequired vex.csafNoStatements release.hasVexStatements finding.refInvalid mapping.purlInvalid mapping.purlVersioned mapping.purlCoveredByOsv mapping.cpeFieldInvalid mapping.builtIn mapping.csafProviderUnknown mapping.csafKindInvalid mapping.csafValueInvalid feeds.notSubscribable accounts.setupEmailLimit member.exists member.joined member.roleInvalid member.ownerGrantDenied member.ownerChangeDenied member.ownerRemoveDenied member.lastOwner github.orgInvalid github.teamInvalid github.roleInvalid github.adminRequired key.nameInvalid key.roleInvalid key.purposeInvalid product.keyInvalid product.keyExists product.keyLocked product.supportEndsInvalid alias.reportedInvalid alias.exists publisher.repositoryInvalid publisher.fieldTooLong publisher.idsIncomplete publisher.repositoryNotFound publisher.githubUnreachable publisher.workflowInvalid publisher.refPatternPrefix publisher.refPatternInvalid publisher.exists graph.vulnerabilityUnknown graph.timeout proposal.evidenceUnknown proposal.evidenceTooLarge proposal.kindInvalid proposal.basisInvalid proposal.notCarryOver proposal.basisMismatch proposal.notPending proposal.sourceSuperseded proposal.ownProposal proposal.fourEyes proposal.personRequired proposal.batchTooLarge proposal.vulnerabilityChanged proposal.reportedChanged proposal.releaseUnknown proposal.evidenceMissing notifications.unavailable notifications.findingsInvalid notifications.tokenInvalid webhook.urlRejected webhook.limitReached webhook.formatUnavailable webhook.headerInvalid webhook.eventTypesInvalid webhook.disabled events.cursorInvalid
detail
required

What went wrong

string
params
required

Values the code’s message needs, e.g. {“field”: “version”}. Only values the caller sent or may see. Empty when the message needs none.

object
key
additional properties
any

Example

{
"code": "notFound"
}
Retry-After
integer
>= 1

Seconds until a request would be allowed again, at least 1

GitHub could not be reached to look up the repository