Skip to main content

Draft bindings

Generated from apiome-rest/openapi.yaml (API version 1.204.1) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: draft-bindings · 7 operations

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/bindings​

List a project's branch-to-draft bindings

A page of the project's bindings, newest first — active ones and the released rows that are their history.

Filters combine: version (revision id or version label) and active (true for the live bindings, false for released ones).

Requires projects:view.

Operation id: list_bindings_v1_tenants__tenant_slug__projects__project_ref__bindings_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
versionquerystring or nullnoRevision id or version label.
activequeryboolean or nullnoActive (true) or released (false) bindings only.
limitqueryintegernoPage size.
offsetqueryintegernoBindings to skip.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for list a project's branch-to-draft bindings.application/json BindingListResponse
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/bindings/{binding_id}​

Read one binding

A binding with its outstanding sync candidates and the ones already settled.

Requires projects:view.

Operation id: read_binding_v1_tenants__tenant_slug__projects__project_ref__bindings__binding_id__get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
binding_idpathstringyesPath parameter identifying the binding id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for read one binding.application/json DraftBindingDetail
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/versions/{version_ref}/binding​

Read a version's repository binding

Where a version stands: its active binding with everything outstanding on it, and the bindings it has had before.

Requires projects:view.

Operation id: read_version_binding_v1_tenants__tenant_slug__projects__project_ref__versions__version_ref__binding_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
version_refpathstringyesPath parameter identifying the version ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for read a version's repository binding.application/json VersionBindingStatus
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/versions/{version_ref}/binding​

Bind a draft version to a repository ref

Make this draft the API review unit of one repository ref and source path. The ref is resolved and the selection read through a stored credential before anything is written — that read is the authorization check, and it is what produces the commit and the sha256: source digest the binding records.

Name the repository with either repository_id (a registered tenant repository, whose linked-account credential authorizes the read) or repo_url (with an optional linked_account_id of your own). Credentials are never accepted in the body.

A published version cannot be bound (409 binding-version-published), and a version has at most one active binding: pass replace: true to release the current one and bind anew, or the request is refused with 409 binding-already-bound. The released row stays as history.

Requires versions:edit.

Operation id: bind_version_v1_tenants__tenant_slug__projects__project_ref__versions__version_ref__binding_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
version_refpathstringyesPath parameter identifying the version ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for bind a draft version to a repository ref.

Responses

StatusDescriptionBody
201Successful response for bind a draft version to a repository ref.application/json DraftBindingDetail
422Validation Errorapplication/json HTTPValidationError

DELETE /v1/tenants/{tenant_slug}/projects/{project_ref}/versions/{version_ref}/binding​

Release a version's repository binding

Stop this draft being the review unit of its ref. The binding row is kept — stamped released, with who released it and when — and any outstanding sync candidates on it are superseded, because a released binding can never act on one.

Requires versions:edit.

Operation id: release_version_binding_v1_tenants__tenant_slug__projects__project_ref__versions__version_ref__binding_delete

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
version_refpathstringyesPath parameter identifying the version ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for release a version's repository binding.application/json DraftBindingRecord
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/versions/{version_ref}/binding/candidates/{candidate_id}​

Settle an outstanding sync candidate

Decide what happens to an observed ref update.

applied records that the draft is in sync with the candidate's commit: the source is re-read at that commit — so the digest stored is one that was actually fetched — and the binding's synchronized pair advances to it, which is the base the next update is compared against. It does not modify the draft; three-way synchronization (GNC-2.3) settles a candidate this way after it has applied the changes.

dismissed leaves the binding exactly where it is.

A candidate settles once: a settled one is refused with 409 binding-candidate-resolved.

Requires versions:edit.

Operation id: resolve_binding_candidate_v1_tenants__tenant_slug__projects__project_ref__versions__version_ref__binding_candidates__candidate_id__post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
version_refpathstringyesPath parameter identifying the version ref segment.
candidate_idpathstringyesPath parameter identifying the candidate id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for settle an outstanding sync candidate.

Responses

StatusDescriptionBody
200Successful response for settle an outstanding sync candidate.application/json DraftBindingDetail
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/versions/{version_ref}/binding/check​

Check whether the bound ref has moved

Ask the provider where the bound ref is now. When it has moved, a sync candidate is recorded — the commit and digest the binding is at, and the commit the ref moved to — and nothing about the draft changes. When it has not, the request is refused with 409 binding-unchanged.

This is the same thing a push to the ref does through the repository webhook; it exists so a binding can be reconciled without waiting for one.

Requires versions:edit.

Operation id: check_version_binding_v1_tenants__tenant_slug__projects__project_ref__versions__version_ref__binding_check_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
version_refpathstringyesPath parameter identifying the version ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for check whether the bound ref has moved.application/json DraftBindingDetail
422Validation Errorapplication/json HTTPValidationError

Schemas used​

BindingListResponse​

A page of a project's bindings.

PropertyTypeRequiredDescription
bindingsarray of DraftBindingRecordnoBindings, newest first.
countintegeryesHow many bindings this page holds.
totalintegeryesHow many bindings match the filters in all.
limitintegeryesThe page size used.
offsetintegeryesThe offset used.

DraftBindingCreate​

Bind a draft version to a repository ref and source path.

Exactly one of repository_id and repo_url identifies the repository: a registered tenant repository (whose stored linked-account credential authorizes the read) or a URL, for a public repository or one the caller's own linked account can reach. A credential is never accepted in the body.

PropertyTypeRequiredDescription
repository_idstring or nullnoRegistered tenant repository to bind to.
repo_urlstring or nullnoRepository URL, when no registered repository is used.
refstring or nullnoBranch or tag; defaults to the repository's default branch.
pathstringnoPath or glob selecting the source; empty selects the whole tree.
linked_account_idstring or nullnoThe caller's own linked account whose stored token authorizes the read.
replacebooleannoRelease the version's current binding and bind it anew. Without it a version that is already bound is refused with binding-already-bound.

DraftBindingDetail​

A binding with what is outstanding on it and what has already been settled.

PropertyTypeRequiredDescription
bindingDraftBindingRecordyesBinding.
pendingarray of SyncCandidateRecordnoOutstanding sync candidates, newest first.
historyarray of SyncCandidateRecordnoSettled candidates, newest first — applied, dismissed, and superseded.

DraftBindingRecord​

One stored binding — active or released.

PropertyTypeRequiredDescription
idstringyesThe binding id.
tenant_idstringyesTenant that owns the resource.
project_idstringyesProject identifier the resource belongs to.
version_idstringyesThe bound draft version (revision).
version_labelstring or nullnoThe version's label, e.g. 1.2.0.
repository_idstring or nullnoThe registered tenant repository the binding was authorized through; null once that registration is removed, which leaves the binding readable but unusable.
providerstringyesgithub, gitlab, or bitbucket.
repo_full_namestringyesLowercased owner/name.
repo_urlstringyesCanonical repository URL.
refstringyesBranch or tag the draft is the review unit of.
pathstringnoPath or glob selecting the source; empty is the whole tree.
commit_shastringyesCommit the binding is currently synchronized with.
source_digeststringyessha256: digest of the selected source at commit_sha.
synchronized_atstring (date-time)yesWhen commit_sha / source_digest last moved.
browse_urlstring or nullnoHuman URL for the bound source at commit_sha.
activebooleanyesTrue while this is the draft's binding.
created_bystring or nullnoWho bound it; null once that user is deleted.
created_by_namestring or nullnoTheir display name.
created_atstring (date-time)yesCreation timestamp (ISO 8601).
updated_atstring (date-time)yesLast update timestamp (ISO 8601).
released_atstring (date-time) or nullnoWhen it stopped being the draft's binding; null while it is.
released_bystring or nullnoWho released it.
release_reasonenum "replaced", "unbound", "repository_removed" or nullnoreplaced, unbound, or repository_removed.
pending_candidate_countintegernoOutstanding sync candidates on this binding.

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.

SyncCandidateResolve​

Settle an outstanding sync candidate.

Attributes: status: applied — the draft is now in sync with the candidate's commit, so the binding's synchronized pair advances to it — or dismissed, which leaves the binding exactly where it is. note: Why, kept with the settled row.

PropertyTypeRequiredDescription
statusenum "applied", "dismissed"yesStatus.
notestring or nullnoNote.

VersionBindingStatus​

Where one version stands with respect to a repository.

PropertyTypeRequiredDescription
version_idstringyesProject version identifier or semantic version label, depending on context.
version_labelstring or nullnoVersion Label.
publishedbooleanyesPublished versions cannot be bound; an existing binding stays readable.
boundbooleanyesWhether the version has an active binding.
bindingDraftBindingDetail or nullnoThe active binding, when there is one.
releasedarray of DraftBindingRecordnoPreviously active bindings, newest first.