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

# Get an issue with its events and gap detail

GET https://api.tradeguardins.com/v1/issues/{issueId}

Requires scopes `subcontractors:read` and `compliance:read`.

Reference: https://docs.tradeguardins.com/api-reference/issues/get-issue

## Authentication

- `Authorization` header (bearer token, required) — Session JWT or API key (`ak_...`)

## Request

### Path parameters

- `issueId` (string, required)

## Response

### 200

Issue with append-only event history

- `data` (IssueWithEvents, optional)

## Errors

### 401 Unauthorized Error

Missing, malformed, expired or revoked credential (`unauthenticated`)

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 404 Not Found Error

Resource not found, or not visible to the caller's organization (`not_found`)

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 429 Too Many Requests Error

Rate limit exceeded (`rate_limited`); retry after `Retry-After` seconds

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

## Types

### IssueWithEvents

- `id` (string, optional)
- `organizationId` (string, optional)
- `subcontractorId` (string, optional)
- `requirementId` (string, optional, nullable)
- `complianceRecordId` (string, optional, nullable)
- `enrollmentId` (string, optional, nullable)
- `projectId` (string, optional, nullable) — Set for project work. A subcontractor not cleared for a project has ONE issue for that assignment (`sourceType` project_assignment, `sourceId` = the assignment id) listing every blocking gap; project requirements do not open separate issues.
- `sourceType` (enum, optional)
  - Allowed values: `compliance_record`, `verification_call`, `document_review`, `coverage`, `monitoring_run`, `report_criterion`, `enrollment`, `project_assignment`
- `sourceId` (string, optional, nullable)
- `category` (enum, optional)
  - Allowed values: `non_compliant`, `expired`, `carrier_outreach`, `review_rejected`, `coverage_flag`, `failed_verification`, `report_criterion`, `onboarding`
- `status` (enum, optional)
  - Allowed values: `open`, `acknowledged`, `resolved`, `closed`
- `priority` (enum, optional)
  - Allowed values: `low`, `medium`, `high`, `urgent`
- `title` (string, optional)
- `summary` (string, optional, nullable) — Template-generated plain language, never model-written.
- `whatsWrong` (string, optional) — Plain English: what failed, one sentence per failing check. Written by templates from the gap, never by AI, so the same gap always gives the same text. Use it in messages to the subcontractor. See the guide "Handling issue resolution yourself".
- `whatToAskFor` (string, optional) — Plain English: what to ask the subcontractor or their insurance agent for so the issue closes on its own once the new document passes. When TradeGuard is already reviewing the issue, it says there is nothing to ask for yet.
- `gap` (IssueGap, optional) — Structured gap. For requirement failures it is the checker comparison; for operational issues it carries the trigger's reason and detail.
- `refireCount` (integer, optional) — How many times the same trigger fired while the issue was open.
- `lastFiredAt` (datetime, optional)
- `acknowledgedAt` (datetime, optional, nullable)
- `acknowledgedBy` (string, optional, nullable)
- `resolvedAt` (datetime, optional, nullable)
- `resolvedBy` (string, optional, nullable)
- `resolutionNote` (string, optional, nullable)
- `closedAt` (datetime, optional, nullable)
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)
- `events` (list of IssueEvent, optional)

### ErrorDetailsItems

- `path` (string, optional)
- `message` (string, optional)

### IssueGap

Structured gap. For requirement failures it is the checker comparison; for operational issues it carries the trigger's reason and detail.

- `documentCategory` (string, optional, nullable)
- `policyType` (string, optional, nullable)
- `statusReason` (string, optional, nullable)
- `criteria` (list of IssueGapCriterion, optional)
- `failedKeys` (list of string, optional)
- `checkedAt` (datetime, optional, nullable)

### IssueEvent

Append-only history entry.

- `id` (string, optional)
- `type` (enum, optional)
  - Allowed values: `opened`, `refired`, `acknowledged`, `resolved`, `closed`, `reopened`, `note`, `priority_changed`
- `actorType` (enum, optional)
  - Allowed values: `system`, `user`, `api_key`
- `actorId` (string, optional, nullable)
- `fromStatus` (enum, optional)
  - Allowed values: `open`, `acknowledged`, `resolved`, `closed`
- `toStatus` (enum, optional)
  - Allowed values: `open`, `acknowledged`, `resolved`, `closed`
- `note` (string, optional, nullable)
- `payload` (map from string to any, optional)
- `createdAt` (datetime, optional)

### IssueGapCriterion

One evaluated criterion — required (expected) vs. extracted (actual).

- `key` (string, optional)
- `passed` (boolean, optional)
- `expected` (any, optional) — Required value from the profile
- `actual` (any, optional) — Value extracted from the document / verification
- `message` (string, optional)
- `label` (string, optional) — Plain-English name of the check, when recorded (e.g. "Covered autos").
- `policyType` (string, optional, nullable) — The policy type the check is about

## Examples

**Response**

```json
{
  "data": {
    "id": "string",
    "organizationId": "string",
    "subcontractorId": "string",
    "requirementId": "string",
    "complianceRecordId": "string",
    "enrollmentId": "string",
    "projectId": "string",
    "sourceType": "compliance_record",
    "sourceId": "string",
    "category": "non_compliant",
    "status": "open",
    "priority": "low",
    "title": "General Liability $1M — Non-compliant",
    "summary": "General Liability each-occurrence is $500,000; this profile requires $1,000,000",
    "whatsWrong": "General Liability each-occurrence is $1,000,000; required at least $2,000,000",
    "whatToAskFor": "Ask for an updated certificate of insurance (COI) showing General Liability each-occurrence of at least $2,000,000.",
    "gap": {
      "documentCategory": "string",
      "policyType": "string",
      "statusReason": "string",
      "criteria": [
        {
          "key": "limit:each_occurrence",
          "passed": true,
          "expected": null,
          "actual": null,
          "message": "string",
          "label": "string",
          "policyType": "string"
        }
      ],
      "failedKeys": [
        "string"
      ],
      "checkedAt": "2024-01-15T09:30:00Z"
    },
    "refireCount": 1,
    "lastFiredAt": "2024-01-15T09:30:00Z",
    "acknowledgedAt": "2024-01-15T09:30:00Z",
    "acknowledgedBy": "string",
    "resolvedAt": "2024-01-15T09:30:00Z",
    "resolvedBy": "string",
    "resolutionNote": "string",
    "closedAt": "2024-01-15T09:30:00Z",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "events": [
      {
        "id": "string",
        "type": "opened",
        "actorType": "system",
        "actorId": "string",
        "fromStatus": "open",
        "toStatus": "open",
        "note": "string",
        "payload": {},
        "createdAt": "2024-01-15T09:30:00Z"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.tradeguardins.com/v1/issues/issueId"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.tradeguardins.com/v1/issues/issueId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.tradeguardins.com/v1/issues/issueId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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.tradeguardins.com/v1/issues/issueId")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.tradeguardins.com/v1/issues/issueId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.tradeguardins.com/v1/issues/issueId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.tradeguardins.com/v1/issues/issueId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.tradeguardins.com/v1/issues/issueId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```