> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/_mcp/server.

# Update an issue

PATCH https://api.pensar.dev/issues/{issueId}
Content-Type: application/json

Close an issue, mark it a false positive, reopen it, or change its endpoint. A status or duplicate change is also applied to the issue’s linked GitHub, Linear and Notion tickets.

**Closing.** Send `closedDisposition` with every close that is not a plain fix. Reopening clears the disposition and the rest of the close record. `false-positive` is a status, so it never carries a disposition.

**Duplicates.** Send `status: "closed"`, `closedDisposition: "duplicate"` and `duplicateOf` naming another issue in the workspace. `duplicateOf` is refused with any other disposition, and the original cannot itself be a duplicate. Closing an issue that has duplicates as a duplicate moves them onto the new original. Reopening the issue or changing its disposition clears the link.

**Endpoint.** Setting `endpointId` also sets the issue’s application; `null` clears both.

Errors: `400` for an invalid value, no update fields, or an inconsistent duplicate; `403` in workspaces where Pensar owns the verdict (move the issue to `in-review` instead); `404` when the issue, `duplicateOf` original or endpoint is not in the workspace; `409` when another finding in the same pentest has the same name and endpoint.

Requires the `issues:write` API key scope.

Reference: https://docs.pensar.dev/api/api-reference/issues/update-issue

## Authentication

- `Authorization` header (bearer token, required) — A workspace API key, sent as `Authorization: Bearer`.
- `x-api-key` header (required) — A workspace API key, sent as `x-api-key`.

## Request

### Path parameters

- `issueId` (string, required) — Issue UUID or label, e.g. `VULN-000123`.

### Body (application/json)

This endpoint expects an UpdateIssueRequest.

- `status` (enum, optional)
  - Allowed values: `open`, `closed`, `false-positive`, `in-review`
- `closedDisposition` (enum, optional) — Structured close verdict. Send one whenever a close is not a plain fix; a finding closed without one reads as resolved.
  - Allowed values: `resolved`, `duplicate`, `wont-fix`, `out-of-scope`, `risk-accepted`
- `duplicateOf` (string, optional) — The original issue, as a UUID or label. Required with, and only with, `closedDisposition: "duplicate"`.
- `closedReason` (string, optional) — Free-text reason for closing.
- `closedComments` (string, optional)
- `endpointId` (string, optional, nullable) — Endpoint in this workspace to associate. Also sets the issue's application. `null` clears both; omit to leave unchanged.
- `userFlaggedFalsePositive` (boolean, optional, deprecated) — Use `status: "false-positive"`.
- `userFlaggedFalsePositiveReason` (string, optional, deprecated) — Use `closedReason`.

## Response

### 200

The updated issue.

- `success` (boolean, required)
- `issue` (UpdateIssueResponseIssue, required)

## Errors

### 400 Bad Request Error

The request is invalid. `error` names the field.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 403 Forbidden Error

The credential lacks the required scope or is not allowed this action.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 404 Not Found Error

The resource does not exist in this workspace.

- `error` (string, required) — What went wrong, naming the offending value when useful.

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `error` (string, required) — What went wrong, naming the offending value when useful.

## Types

### UpdateIssueResponseIssue

- `id` (string, required)
- `name` (string, required, nullable)
- `status` (enum, required)
  - Allowed values: `open`, `closed`, `false-positive`, `in-review`
- `severity` (enum, required)
  - Allowed values: `critical`, `high`, `medium`, `low`
- `userFlaggedFalsePositive` (boolean, required)
- `closedAt` (datetime, required, nullable)
- `closedReason` (string, required, nullable)
- `closedDisposition` (enum, required, nullable) — Structured close verdict. `other` appears only on findings closed before it was retired and cannot be written.
  - Allowed values: `resolved`, `duplicate`, `wont-fix`, `out-of-scope`, `risk-accepted`, `other`
- `duplicateOf` (string, required, nullable)
- `endpointId` (string, required, nullable)
- `applicationId` (string, required, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "success": true,
  "issue": {
    "id": "string",
    "name": "string",
    "status": "open",
    "severity": "critical",
    "userFlaggedFalsePositive": true,
    "closedAt": "2024-01-15T09:30:00Z",
    "closedReason": "string",
    "closedDisposition": "resolved",
    "duplicateOf": "string",
    "endpointId": "string",
    "applicationId": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.pensar.dev/issues/issueId"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.pensar.dev/issues/issueId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pensar.dev/issues/issueId"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.pensar.dev/issues/issueId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.pensar.dev/issues/issueId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.pensar.dev/issues/issueId', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.pensar.dev/issues/issueId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.pensar.dev/issues/issueId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```