Skip to main content

PR back

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

Tag: pr-back · 4 operations

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/pr-back​

Open a pull request syncing a project version back to its repository

Renders one version of the project and opens a pull request into the repository's source files on apiome/pr-back-<project>-<base>, built on the latest base branch. Each file gets back only the paths and schemas it defines (multi-repository projects); content no file defines belongs to the precedence-1 file. The description is each file's change report (the project's change report templates), and new pull requests get the repository's reviewers.

Idempotent. One pull request per project and base branch: updated when the open one was refreshed, unchanged when it already carries exactly this sync, up_to_date when the base branch already holds the rendered files (nothing written), opened otherwise. dryRun: true answers preview with the title, description and commit message, writing nothing.

Failures are outcomes. A revoked token, a refused push or a rate limit answers 200 with status: failed, an errorCode and an actionable log.

Requires versions:publish (projects:view for a dry run). Every pull request opened is audited as repository.pr_back_opened, every one refreshed as repository.pr_back_updated.

Operation id: pr_back_project_v1_tenants__tenant_slug__projects__project_ref__pr_back_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project 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 open a pull request syncing a project version back to its repository.

Responses

StatusDescriptionBody
200Successful response for open a pull request syncing a project version back to its repository.application/json PrBackOutcomeModel
403The repository's settings do not let the project PR back.—
404Unknown project, version or repository.—
409The project has no source file the repository can receive.—
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/pr-back/repositories​

List the repositories a project can PR back into

Every repository the project was imported from, with its source files, whether the project may open pull requests into it (eligible) and, when it may not, why (reasonCode, reason).

Requires projects:view.

Operation id: list_pr_back_repositories_v1_tenants__tenant_slug__projects__project_ref__pr_back_repositories_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project 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 list the repositories a project can pr back into.application/json PrBackRepositoriesResponse
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/repositories/{repository_id}/pr-back-settings​

Read a repository's PR-back settings

Which Apiome projects may open pull requests into the repository (allow list or deny list), the pull requests' target branch, the commit message template and the reviewers. configured: false means the repository has no settings, so no project may PR back.

Requires imports:view.

Operation id: get_pr_back_settings_v1_tenants__tenant_slug__repositories__repository_id__pr_back_settings_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
repository_idpathstringyesConnected repository identifier.
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 repository's pr-back settings.application/json PrBackSettingsResponse
422Validation Errorapplication/json HTTPValidationError

PUT /v1/tenants/{tenant_slug}/repositories/{repository_id}/pr-back-settings​

Save a repository's PR-back settings

Replaces the repository's PR-back settings. projectPolicy: allow lets only projectIds open pull requests into the repository; deny lets every project except them. targetBranch blank uses the branch the files were imported from. commitMessageTemplate is Mustache over project, version, repository, branch and fileCount; blank uses the default. reviewers are GitHub logins or org/team slugs, requested on every pull request PR-back opens.

Requires imports:edit. Audited as repository.pr_back_settings.update.

Operation id: put_pr_back_settings_v1_tenants__tenant_slug__repositories__repository_id__pr_back_settings_put

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
repository_idpathstringyesConnected repository identifier.
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 save a repository's pr-back settings.

Responses

StatusDescriptionBody
200Successful response for save a repository's pr-back settings.application/json PrBackSettingsResponse
404Unknown repository.—
422Invalid policy, branch, template, reviewer or project id.—

Schemas used​

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.

PrBackOutcomeModel​

What a PR-back did.

PropertyTypeRequiredDescription
statusstringyespreview, opened, updated, unchanged, up_to_date or failed.
dryRunbooleanyesDry Run.
projectIdstringyesProject ID.
versionIdstringyesVersion ID.
versionLabelstring or nullnoVersion Label.
repositoryIdstringyesRepository ID.
repositoryFullNamestring or nullnoRepository Full Name.
baseBranchstring or nullnoBase Branch.
branchNamestring or nullnoBranch Name.
baseShastring or nullnoBase Sha.
commitShastring or nullnoCommit Sha.
pullRequestNumberinteger or nullnoPull Request Number.
pullRequestUrlstring or nullnoPull Request URL.
titlestring or nullnoTitle.
bodystring or nullnoThe pull request description (change report).
commitMessagestring or nullnoCommit Message.
reviewersarray of stringnoReviewers.
filesarray of PrBackFileReportnoFiles.
skippedarray of stringnoSkipped.
logarray of objectnoLog.
errorCodestring or nullnoError Code.
errorMessagestring or nullnoError Message.

PrBackRepositoriesResponse​

The repositories a project was imported from.

PropertyTypeRequiredDescription
projectIdstringyesProject ID.
repositoriesarray of PrBackRepositoryEntrynoRepositories.

PrBackRequest​

Body for a PR-back.

PropertyTypeRequiredDescription
repositoryIdstringyesRepository ID.
versionstring or nullnoRevision id or version label; the newest when omitted.
dryRunbooleannoCompare and describe; write nothing.

PrBackSettingsPutRequest​

Body for saving a repository's PR-back settings (replaces them whole).

PropertyTypeRequiredDescription
projectPolicystringnoallow or deny.
projectIdsarray of stringnoProject ids.
targetBranchstring or nullnoBlank for the import branch.
commitMessageTemplatestring or nullnoMustache template with {{project}}, {{version}}, {{repository}}, {{branch}} and {{fileCount}}. Blank for the default.
reviewersarray of stringnoGitHub logins (octocat) or teams (acme/api-reviewers).

PrBackSettingsResponse​

A repository's PR-back settings.

PropertyTypeRequiredDescription
repositoryIdstringyesRepository ID.
configuredbooleanyesFalse when the repository has no settings — no project may PR back.
projectPolicystringyesallow: only the listed projects may PR back. deny: every project except them.
projectsarray of PrBackProjectRefnoProjects.
targetBranchstring or nullnoBase branch of the pull requests; null for the branch the files were imported from.
commitMessageTemplatestring or nullnoMustache template; null for the default.
defaultCommitMessageTemplatestringnoDefault Commit Message Template.
reviewersarray of stringnoReviewers.
updatedAtstring (date-time) or nullnoUpdated At.