Get PullRequest (By ID)

Request

GET

https://api.sourcecraft.tech/pulls/id:{pull_request_id}

Path parameters

Name

Description

pull_request_id

Type: string

Example: ``

Query parameters

Name

Description

pull_request_slug

Type: string

Example: ``

Responses

200 OK

A successful response.

Body

application/json
{
  "id": "example",
  "slug": "example",
  "author": {
    "id": "example",
    "slug": "example"
  },
  "updated_by": null,
  "title": "example",
  "description": "example",
  "repository": {
    "id": "example",
    "slug": "example",
    "organization": {
      "id": "example",
      "slug": "example"
    }
  },
  "merge_info": {
    "merger": null,
    "merge_parameters": {
      "rebase": true,
      "squash": true,
      "delete_branch": true
    },
    "target_commit_hash": "example",
    "error": "example",
    "merge_commit_hash": "example"
  },
  "source_branch": "example",
  "target_branch": "example",
  "status": "draft",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z",
  "labels": [
    {
      "id": "example",
      "slug": "example",
      "name": "example",
      "color": "example"
    }
  ],
  "source": {
    "label": "example",
    "ref": "example",
    "sha": "example"
  },
  "target": null
}

Name

Description

author

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

created_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

description

Type: string

Example: example

id

Type: string

Example: example

labels

Type: LabelEmbedded[]

Example
[
  {
    "id": "example",
    "slug": "example",
    "name": "example",
    "color": "example"
  }
]

merge_info

Type: MergeInfo

Example
{
  "merger": {
    "id": "example",
    "slug": "example"
  },
  "merge_parameters": {
    "rebase": true,
    "squash": true,
    "delete_branch": true
  },
  "target_commit_hash": "example",
  "error": "example",
  "merge_commit_hash": "example"
}

repository

Type: RepositoryEmbedded

Example
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}

slug

Type: string

Example: example

source

Type: PullRequestBranch

Example
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}

source_branch

Type: string

Example: example

status

Type: PullRequest.Status

Enum: draft, open, discarded, merging, merged

target

Type: PullRequestBranch

Example
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}

target_branch

Type: string

Example: example

title

Type: string

Example: example

updated_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

updated_by

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

UserEmbedded

Name

Description

id

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example"
}

RepositoryEmbedded

Name

Description

id

Type: string

Example: example

organization

Type: OrganizationEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}

MergeParameters

Name

Description

delete_branch

Type: boolean

rebase

Type: boolean

squash

Type: boolean

Example
{
  "rebase": true,
  "squash": true,
  "delete_branch": true
}

MergeInfo

Name

Description

error

Type: string

Example: example

merge_commit_hash

Type: string

Example: example

merge_parameters

Type: MergeParameters

Example
{
  "rebase": true,
  "squash": true,
  "delete_branch": true
}

merger

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

target_commit_hash

Type: string

Example: example

Example
{
  "merger": {
    "id": "example",
    "slug": "example"
  },
  "merge_parameters": {
    "rebase": true,
    "squash": true,
    "delete_branch": true
  },
  "target_commit_hash": "example",
  "error": "example",
  "merge_commit_hash": "example"
}

PullRequest.Status

Type: string

Enum: draft, open, discarded, merging, merged

LabelEmbedded

Name

Description

color

Type: string

Example: example

id

Type: string

Example: example

name

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example",
  "name": "example",
  "color": "example"
}

PullRequestBranch

Name

Description

label

Type: string

Example: example

ref

Type: string

Example: example

sha

Type: string

Example: example

Example
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}

default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": {}
}

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example

Предыдущая
Следующая