Sign in
Docs

API reference

List pull requests

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

The pull requests linked to a document, or to every document of a space, newest link first, with their state as last read from GitHub (title, author, draft, open, closed or merged, the review decision, the checks, when it merged and as which commit), the document each is on, and counts by state.

Needs scope decisions:read.

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.

Query Parameters

document_id?string

The document's id, or what people call it (RFC 0080.1, prd-39). Leave it out for the whole space.

repo?string

Only this repository (owner/name).

state?string

Only this state: unknown, draft, open, closed, merged, or active (draft and open).

page_size?integer

For the whole space: 0 means 50, at most 200.

Formatint32
page_token?string
compact?boolean

Each pull request as its id, repository, number, URL, state, title and document only.

Response Body

iohr.decisions.v1.ListPullRequestsResponse

application/json
  1. response

iohr.decisions.v1.ListPullRequestsResponse

counts?

iohr.decisions.v1.PullRequestCounts

next_page_token*string
pull_requests*array<>
import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try {  for await (const pullRequest of api.decisions.allListPullRequestsGet("<space_id>")) {    console.log(pullRequest);  }} 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.

{  "counts": {    "closed": 0,    "draft": 0,    "failing": 0,    "merged": 0,    "open": 0,    "total": 0,    "unknown": 0  },  "next_page_token": "string",  "pull_requests": [    {      "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"    }  ]}