Sign in
Docs

API reference

Link a pull request

Have a token? Manage tokens in the console
POST
/v1/decisions/spaces/{space_id}/documents/{document_id}/pull-requests

Link a pull request to a document, by repository and number or by its URL, as what implements it, a part of it or a related change. Linking one already linked changes its role. Its state is then kept current from GitHub.

Needs scope decisions:write.

Authorization

bearer
headerAuthorizationBearer <token>

An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.

Path Parameters

space_id*string

The space.

document_id*string

The document's id, or what people call it (RFC 0080.1, prd-39).

Request Body

iohr.decisions.v1.LinkPullRequestRequest; path variables override their fields

application/json
  1. body

iohr.decisions.v1.LinkPullRequestRequest

document_id?string
number?integer
Formatint32
repo?string
role?string
source?string
space_id?string
url?string

Response Body

iohr.decisions.v1.LinkPullRequestResponse

application/json
  1. response

iohr.decisions.v1.LinkPullRequestResponse

created*boolean
pull_request?

iohr.decisions.v1.PullRequest

import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try {  const { value } = await api.decisions.linkPullRequest("<space_id>", "<document_id>", {    repo: "<repo>",    role: "<role>",    source: "<source>",    url: "<url>",  });  console.log(value);} catch (e) {  if (!(e instanceof ApiError)) throw e;  console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`);}

npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.

{  "created": true,  "pull_request": {    "author": "string",    "checks": "string",    "checks_failed": 0,    "checks_passed": 0,    "checks_pending": 0,    "closed_at": "string",    "document_id": "string",    "document_kind": "string",    "document_number": "string",    "forge": "string",    "linked_at": "string",    "linked_by": "string",    "merge_commit": "string",    "merged_at": "string",    "number": 0,    "pull_request_id": "string",    "refresh": "string",    "refreshed_at": "string",    "repo": "string",    "review_decision": "string",    "role": "string",    "source": "string",    "state": "string",    "title": "string",    "updated_at": "string",    "url": "string",    "via": "string"  }}