---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/api-ref/User-or-PullRequest/ListUserPullRequestsByID.md
  - https://sourcecraft.dev/portal/docs/ru/api-ref/User-or-PullRequest/ListUserPullRequestsByID.md
  - href: en/api-ref/User-or-PullRequest/ListUserPullRequestsByID.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

<div class="openapi">

# List User Pull Requests (By User ID)

<!-- markdownlint-disable-file -->

Lists pull requests related to a user identified by UUID.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://api.sourcecraft.tech/users/id:{user_id}/pulls
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_user_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_page_size_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uint64&gt;

The maximum number of pull requests to return. The service may return fewer than
this value

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_page_token_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

A page token, received from a previous call.
Provide this to retrieve the subsequent page.

When paginating, all other parameters must match
the call that provided the page token.

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_role_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Role by which PRs should be selected: author, reviewer or any

_Enum:_{.json-schema-reset .json-schema-value} `author`, `reviewer`, `any`
{.table-cell}
||
||

_sort_by_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Ordering options: comma separated list of fields. For example: "name, created_at"
Default sorting order is ascending. To specify descending order for a field,
append a "-" prefix; for example: "name, -created_at"
Redundant space characters in the syntax are insignificant. "foo, -bar", " foo , -bar", and "foo,bar"
are all equivalent.
Available fields: title, created_at, updated_at

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_user_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__200">

## 200 OK

A successful response.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "pull_requests": [
    {
      "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
        },
        "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
    }
  ],
  "next_page_token": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_next_page_token_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_pull_requests_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [PullRequest](#entity-PullRequest)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "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
      },
      "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
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### UserEmbedded {#entity-UserEmbedded}

#|
|| **Name** | **Description** ||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### RepositoryEmbedded {#entity-RepositoryEmbedded}

#|
|| **Name** | **Description** ||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_organization_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [OrganizationEmbedded](#entity-OrganizationEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### MergeParameters {#entity-MergeParameters}

#|
|| **Name** | **Description** ||
||

_rebase_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean
{.table-cell}
||
||

_squash_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "rebase": true,
  "squash": true
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### MergeInfo {#entity-MergeInfo}

#|
|| **Name** | **Description** ||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_merge_commit_hash_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_merge_parameters_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [MergeParameters](#entity-MergeParameters)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "rebase": true,
  "squash": true
}
```

{% endcut %}
{.table-cell}
||
||

_merger_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UserEmbedded](#entity-UserEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_target_commit_hash_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "merger": {
    "id": "example",
    "slug": "example"
  },
  "merge_parameters": {
    "rebase": true,
    "squash": true
  },
  "target_commit_hash": "example",
  "error": "example",
  "merge_commit_hash": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### PullRequest.Status {#entity-PullRequest.Status}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `draft`, `open`, `discarded`, `merging`, `merged`

</div>

<div class="openapi-entity">

### LabelEmbedded {#entity-LabelEmbedded}

#|
|| **Name** | **Description** ||
||

_color_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_name_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example",
  "name": "example",
  "color": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### PullRequestBranch {#entity-PullRequestBranch}

#|
|| **Name** | **Description** ||
||

_label_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_ref_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_sha_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### PullRequest {#entity-PullRequest}

#|
|| **Name** | **Description** ||
||

_author_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UserEmbedded](#entity-UserEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_created_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_description_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_labels_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [LabelEmbedded](#entity-LabelEmbedded)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "id": "example",
    "slug": "example",
    "name": "example",
    "color": "example"
  }
]
```

{% endcut %}
{.table-cell}
||
||

_merge_info_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [MergeInfo](#entity-MergeInfo)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "merger": {
    "id": "example",
    "slug": "example"
  },
  "merge_parameters": {
    "rebase": true,
    "squash": true
  },
  "target_commit_hash": "example",
  "error": "example",
  "merge_commit_hash": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_repository_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [RepositoryEmbedded](#entity-RepositoryEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example",
  "organization": {
    "id": "example",
    "slug": "example"
  }
}
```

{% endcut %}
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_source_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [PullRequestBranch](#entity-PullRequestBranch)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_source_branch_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [PullRequest.Status](#entity-PullRequest.Status)

_Enum:_{.json-schema-reset .json-schema-value} `draft`, `open`, `discarded`, `merging`, `merged`
{.table-cell}
||
||

_target_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [PullRequestBranch](#entity-PullRequestBranch)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "label": "example",
  "ref": "example",
  "sha": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_target_branch_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_title_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_updated_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_updated_by_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UserEmbedded](#entity-UserEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "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
    },
    "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
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__default">

## default

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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: unknown

_Example:_{.json-schema-reset .json-schema-example} `null`
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_request_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.