---
title: "Edit, label, assign, link, close or reopen an issue"
description: "Any of the fields, in one call; each change is its own timeline item\nand the call is one event. Add and remove lists are set operations.\n`state: closed` takes `state_reason` (default `completed`); setting\nthe state it already has changes nothing. `body` with `base_version`\nis refused with 409 `edited` (and `current`) when the body moved;\nwithout it the last writer wins.\n"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.gitpando.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Pando API › issues

`PATCH /v1/monorepos/{owner}/{monorepo}/issues/{number}`

Any of the fields, in one call; each change is its own timeline item
and the call is one event. Add and remove lists are set operations.
`state: closed` takes `state_reason` (default `completed`); setting
the state it already has changes nothing. `body` with `base_version`
is refused with 409 `edited` (and `current`) when the body moved;
without it the last writer wins.

## Authentication

Requires one of the following:

- `credential`, http, header `Authorization`
- `session`, apiKey, in cookie

## Path parameters

- `updateIssue.path.owner` (string, required) — The monorepo's owner, a namespace (a person's login or an organization). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
- `updateIssue.path.monorepo` (string, required) — The monorepo's name within its owner (or an old name). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
- `updateIssue.path.number` (integer, required)
  - min 1

## Request body

_Required._

- `updateIssue.title` (string, optional)
  - minLength 1; maxLength 256
- `updateIssue.body` (string, optional)
  - maxLength 65536
- `updateIssue.base_version` (integer, optional)
- `updateIssue.project` (string | null, optional)
- `updateIssue.state` (string, optional)
  - one of `"open"`, `"closed"`
- `updateIssue.state_reason` (string, optional)
  - one of `"completed"`, `"not_planned"`
- `updateIssue.add_labels` (array<string>, optional)
- `updateIssue.remove_labels` (array<string>, optional)
- `updateIssue.add_assignees` (array<string>, optional)
- `updateIssue.remove_assignees` (array<string>, optional)
- `updateIssue.link` (array<object>, optional)
  - `updateIssue.link.repo` (string, required) — A repo's name.
  - `updateIssue.link.branch` (string, required)
- `updateIssue.unlink` (array<object>, optional)
  - `updateIssue.unlink.repo` (string, required) — A repo's name.
  - `updateIssue.unlink.branch` (string, required)

## Example request

```json
{
  "title": "string",
  "body": "string",
  "base_version": 0,
  "project": "string",
  "state": "open",
  "state_reason": "completed",
  "add_labels": [
    "string"
  ],
  "remove_labels": [
    "string"
  ],
  "add_assignees": [
    "string"
  ],
  "remove_assignees": [
    "string"
  ],
  "link": [
    {
      "repo": "string",
      "branch": "string"
    }
  ],
  "unlink": [
    {
      "repo": "string",
      "branch": "string"
    }
  ]
}
```

## Code samples

### cURL

```curl
curl --request PATCH \
  --url https://app.gitpando.com/v1/monorepos/string/string/issues/1 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "string",
  "body": "string",
  "base_version": 0,
  "project": "string",
  "state": "open",
  "state_reason": "completed",
  "add_labels": [
    "string"
  ],
  "remove_labels": [
    "string"
  ],
  "add_assignees": [
    "string"
  ],
  "remove_assignees": [
    "string"
  ],
  "link": [
    {
      "repo": "string",
      "branch": "string"
    }
  ],
  "unlink": [
    {
      "repo": "string",
      "branch": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/issues/1';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    title: 'string',
    body: JSON.stringify('string'),
    base_version: 0,
    project: 'string',
    state: 'open',
    state_reason: 'completed',
    add_labels: ['string'],
    remove_labels: ['string'],
    add_assignees: ['string'],
    remove_assignees: ['string'],
    link: [{repo: 'string', branch: 'string'}],
    unlink: [{repo: 'string', branch: 'string'}]
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.gitpando.com/v1/monorepos/string/string/issues/1"

payload = {
    "title": "string",
    "body": "string",
    "base_version": 0,
    "project": "string",
    "state": "open",
    "state_reason": "completed",
    "add_labels": ["string"],
    "remove_labels": ["string"],
    "add_assignees": ["string"],
    "remove_assignees": ["string"],
    "link": [
        {
            "repo": "string",
            "branch": "string"
        }
    ],
    "unlink": [
        {
            "repo": "string",
            "branch": "string"
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The issue now.

#### Example

```json
{
  "number": 0,
  "title": "string",
  "state": "open",
  "state_reason": "completed",
  "project": "string",
  "project_path": "string",
  "labels": [
    {
      "name": "string",
      "color": "gray",
      "description": "string"
    }
  ],
  "assignees": [
    "string"
  ],
  "author": "string",
  "comments": 0,
  "tasks": {
    "done": 0,
    "total": 0
  },
  "linked_branches": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "closed_at": "2019-08-24T14:15:22Z",
  "closed_by": "string",
  "closed_by_merge": {
    "repo": "string",
    "repo_path": "string",
    "branch": "string",
    "merge_commit": "string"
  },
  "body": "string",
  "body_version": 0,
  "machine": "string",
  "links": [
    {
      "repo": "string",
      "repo_path": "string",
      "branch": "string",
      "sources": [
        "link"
      ],
      "sha": "string",
      "linked_by": "string",
      "branch_state": "open",
      "merged_at": "2019-08-24T14:15:22Z",
      "closed_issue": true
    }
  ],
  "participants": [
    "string"
  ],
  "reactions": [
    {
      "content": "+1",
      "count": 0,
      "by": [
        "string"
      ]
    }
  ]
}
```

- `updateIssue.response.200.number` (integer, required)
- `updateIssue.response.200.title` (string, required)
- `updateIssue.response.200.state` (string, required)
  - one of `"open"`, `"closed"`
- `updateIssue.response.200.state_reason` (string | null, required)
  - one of `"completed"`, `"not_planned"`, `null`
- `updateIssue.response.200.project` (string | null, required) — A repo's name; null for the monorepo as a whole.
- `updateIssue.response.200.project_path` (string | null, required)
- `updateIssue.response.200.labels` (array<object>, required)
  - `updateIssue.response.200.labels.name` (string, required) — 1 to 50 characters, unique ignoring case.
  - `updateIssue.response.200.labels.color` (string, required) — Each theme sets the eight from its own tokens (no red, so a label never reads as a failure).
    - one of `"gray"`, `"orange"`, `"yellow"`, `"green"`, `"teal"`, `"blue"`, `"purple"`, `"pink"`
  - `updateIssue.response.200.labels.description` (string | null, required)
- `updateIssue.response.200.assignees` (array<string>, required)
- `updateIssue.response.200.author` (string, required)
- `updateIssue.response.200.comments` (integer, required)
- `updateIssue.response.200.tasks` (object | null, required) — `- [ ]` and `- [x]` lines in the body; null without a task list.
  - `updateIssue.response.200.tasks.done` (integer, optional)
  - `updateIssue.response.200.tasks.total` (integer, optional)
- `updateIssue.response.200.linked_branches` (integer, required)
- `updateIssue.response.200.created_at` (string, required)
  - format `date-time`
- `updateIssue.response.200.updated_at` (string, required)
  - format `date-time`
- `updateIssue.response.200.closed_at` (string | null, required)
  - format `date-time`
- `updateIssue.response.200.closed_by` (string | null, required)
- `updateIssue.response.200.closed_by_merge` (one of, required)
  - one of: [IssueMerge](/api/schemas/IssueMerge/), `null`
- `updateIssue.response.200.body` (string, required)
- `updateIssue.response.200.body_version` (integer, required) — Goes up by one on every body edit.
- `updateIssue.response.200.machine` (string | null, required) — The machine that opened it.
- `updateIssue.response.200.links` (array<object>, required)
  - `updateIssue.response.200.links.repo` (string, required)
  - `updateIssue.response.200.links.repo_path` (string, required)
  - `updateIssue.response.200.links.branch` (string, required)
  - `updateIssue.response.200.links.sources` (array<string>, required)
    - one of `"link"`, `"title"`, `"commit"`
  - `updateIssue.response.200.links.sha` (string | null, required) — `commit`: the newest commit on the branch naming the issue.
  - `updateIssue.response.200.links.linked_by` (string | null, required) — `link`: who linked it.
  - `updateIssue.response.200.links.branch_state` (string, required)
    - one of `"open"`, `"ready"`, `"conflicts"`, `"failing"`, `"merged"`, `"deleted"`
  - `updateIssue.response.200.links.merged_at` (string | null, required)
    - format `date-time`
  - `updateIssue.response.200.links.closed_issue` (boolean, required) — This branch's merge closed the issue.
- `updateIssue.response.200.participants` (array<string>, required)
- `updateIssue.response.200.reactions` (array<object>, required) — Those given at least once, in GitHub's order.
  - `updateIssue.response.200.reactions.content` (string, required)
    - one of `"+1"`, `"-1"`, `"laugh"`, `"hooray"`, `"confused"`, `"heart"`, `"rocket"`, `"eyes"`
  - `updateIssue.response.200.reactions.count` (integer, required)
  - `updateIssue.response.200.reactions.by` (array<string>, required) — Logins

### 400

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `updateIssue.response.400.error` (object, required)
  - `updateIssue.response.400.error.code` (string, required)
  - `updateIssue.response.400.error.message` (string, required)
  - `updateIssue.response.400.error.paths` (array<string>, optional)
  - `updateIssue.response.400.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `updateIssue.response.400.error.checks.sha` (string | null, required)
    - `updateIssue.response.400.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `updateIssue.response.400.error.checks.required` (array | null, required) — Null while unknown.
    - `updateIssue.response.400.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `updateIssue.response.400.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `updateIssue.response.400.error.checks.statuses.sha` (string, required)
      - `updateIssue.response.400.error.checks.statuses.context` (string, required)
      - `updateIssue.response.400.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `updateIssue.response.400.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `updateIssue.response.400.error.checks.statuses.target_url` (string | null, optional)
      - `updateIssue.response.400.error.checks.statuses.description` (string | null, optional)
      - `updateIssue.response.400.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `updateIssue.response.400.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `updateIssue.response.400.error.checks.missing` (array<string>, optional)

### 404

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `updateIssue.response.404.error` (object, required)
  - `updateIssue.response.404.error.code` (string, required)
  - `updateIssue.response.404.error.message` (string, required)
  - `updateIssue.response.404.error.paths` (array<string>, optional)
  - `updateIssue.response.404.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `updateIssue.response.404.error.checks.sha` (string | null, required)
    - `updateIssue.response.404.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `updateIssue.response.404.error.checks.required` (array | null, required) — Null while unknown.
    - `updateIssue.response.404.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `updateIssue.response.404.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `updateIssue.response.404.error.checks.statuses.sha` (string, required)
      - `updateIssue.response.404.error.checks.statuses.context` (string, required)
      - `updateIssue.response.404.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `updateIssue.response.404.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `updateIssue.response.404.error.checks.statuses.target_url` (string | null, optional)
      - `updateIssue.response.404.error.checks.statuses.description` (string | null, optional)
      - `updateIssue.response.404.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `updateIssue.response.404.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `updateIssue.response.404.error.checks.missing` (array<string>, optional)

### 409

`edited`: the body moved since `base_version`; `current` is the issue now.

### 413

`too_large`.


Source: https://docs.gitpando.com/api/issues/updateIssue/index.md
