> 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 assignment

GET https://api.tradeguardins.com/v1/assignments/{assignmentId}

The subcontractor's job status on the project — **Cleared**, **On
Watch**, **Blocked** or **Pending Review** — with its gaps (blocking and
non-blocking), what expires during the on-site window, and the state of
every project document slot. Independent of the subcontractor's roster
compliance. The assignment id is the `id` returned by
[Attach a subcontractor to a project](https://docs.tradeguardins.com/api-reference/projects/attach-project-subcontractor).
Requires `subcontractors:read` and `projects:read`.

Reference: https://docs.tradeguardins.com/api-reference/assignments/get-assignment

## Authentication

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

## Request

### Path parameters

- `assignmentId` (string, required) — The assignment (project membership) id returned when the subcontractor was attached to the project.

## Response

### 200

The assignment

- `data` (AssignmentDetail, 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`.

### 403 Forbidden Error

The credential lacks the scope or role for this action (`forbidden`)

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

### AssignmentDetail

- `id` (string, optional)
- `projectId` (string, optional)
- `subcontractorId` (string, optional)
- `assignmentStatus` (enum, optional)
  - Allowed values: `active`, `demobilized`, `removed`
- `mobilizeOn` (date, optional, nullable)
- `demobilizeOn` (date, optional, nullable)
- `complianceStatus` (enum, optional) — Job status. Blocked = a mandatory requirement fails or a slot blocks; Pending Review = the project is not Ready or something awaits a verdict; On Watch = something expires during the on-site window; Cleared otherwise.
  - Allowed values: `cleared`, `on_watch`, `blocked`, `pending_review`
- `gaps` (list of AssignmentGap, optional)
- `watch` (list of AssignmentDetailWatchItems, optional) — What expires during the on-site window.
- `onSiteWindow` (AssignmentDetailOnSiteWindow, optional, nullable) — Mobilized date (else project start, else today) to demobilized date (else project end, else today + 60 days).
- `complianceEvaluatedAt` (datetime, optional, nullable)
- `attachedAt` (datetime, optional)
- `detachedAt` (datetime, optional, nullable)
- `project` (AssignmentDetailProject, optional)
- `slots` (list of ProjectDocumentSlot, optional)

### ErrorDetailsItems

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

### AssignmentGap

- `code` (string, optional) — e.g. non_compliant, expired, slot_requested, slot_non_compliant, slot_expired, preferred_not_met, project_not_ready, subcontractor_inactive
- `label` (string, optional) — Requirement title, or e.g. "Project-Specific COI".
- `blocking` (boolean, optional)
- `reason` (string, optional, nullable)
- `source` (AssignmentGapSource, optional) — Where the gap comes from: a requirement (with its stack level), a slot, or the assignment itself.

### AssignmentDetailWatchItems

- `label` (string, optional)
- `expiresOn` (date, optional)

### AssignmentDetailOnSiteWindow

Mobilized date (else project start, else today) to demobilized date (else project end, else today + 60 days).

- `start` (date, optional)
- `end` (date, optional)

### AssignmentDetailProject

- `id` (string, optional)
- `name` (string, optional)
- `externalId` (string, optional, nullable)
- `projectNumber` (string, optional, nullable)
- `coiRequired` (boolean, optional)
- `setupStatus` (enum, optional)
  - Allowed values: `requested`, `in_setup`, `ready`

### ProjectDocumentSlot

- `id` (string, optional)
- `assignmentId` (string, optional, nullable)
- `projectId` (string, optional)
- `subcontractorId` (string, optional)
- `documentType` (enum, optional) — `project_contract` is reserved for a later release and never returned today.
  - Allowed values: `project_coi`, `endorsement`, `other_exhibit`, `project_contract`
- `status` (enum, optional) — Blocking: `requested`, `non_compliant`, `expired`. Satisfied: `compliant`, `waived` (the GC accepted the gap).
  - Allowed values: `requested`, `received_pending_review`, `compliant`, `non_compliant`, `expired`, `superseded`, `waived`
- `documentId` (string, optional, nullable) — The file on the slot (a project-scope document).
- `receivedAt` (datetime, optional, nullable)
- `ingestChannel` (string, optional, nullable)
- `effectiveDate` (datetime, optional, nullable)
- `expirationDate` (datetime, optional, nullable) — The certificate's term — its earliest policy expiration.
- `certificateHolderVerified` (boolean, optional, nullable)
- `projectNumberVerified` (boolean, optional, nullable)
- `endorsementsVerified` (list of string, optional)
- `policiesCovered` (list of ProjectDocumentSlotPoliciesCoveredItems, optional)
- `reviewReasoning` (string, optional, nullable)
- `verdictAt` (datetime, optional, nullable)
- `verdictInferred` (boolean, optional) — Compliant inferred from an otherwise clear assignment (no check exists for this document type).
- `gaps` (list of ProjectDocumentSlotGapsItems, optional) — e.g. "Project-Specific COI" with the failing checks.
- `criteria` (list of ProjectDocumentSlotCriteriaItems, optional) — Every certificate-spec check with expected vs actual.
- `warnings` (list of ProjectDocumentSlotWarningsItems, optional) — e.g. stale_certificate: the same policy number shows different dates on the baseline COI.
- `waived` (ProjectDocumentSlotWaived, optional, nullable)
- `supersededById` (string, optional, nullable) — For a history row
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)

### AssignmentGapSource

Where the gap comes from: a requirement (with its stack level), a slot, or the assignment itself.

### ProjectDocumentSlotPoliciesCoveredItems

### ProjectDocumentSlotGapsItems

### ProjectDocumentSlotCriteriaItems

### ProjectDocumentSlotWarningsItems

### ProjectDocumentSlotWaived

- `at` (datetime, optional)
- `by` (string, optional)
- `reason` (string, optional)

## Examples

**Response**

```json
{
  "data": {
    "id": "string",
    "projectId": "string",
    "subcontractorId": "string",
    "assignmentStatus": "active",
    "mobilizeOn": "2023-01-15",
    "demobilizeOn": "2023-01-15",
    "complianceStatus": "cleared",
    "gaps": [
      {
        "code": "string",
        "label": "string",
        "blocking": true,
        "reason": "string",
        "source": {}
      }
    ],
    "watch": [
      {
        "label": "string",
        "expiresOn": "2023-01-15"
      }
    ],
    "onSiteWindow": {
      "start": "2023-01-15",
      "end": "2023-01-15"
    },
    "complianceEvaluatedAt": "2024-01-15T09:30:00Z",
    "attachedAt": "2024-01-15T09:30:00Z",
    "detachedAt": "2024-01-15T09:30:00Z",
    "project": {
      "id": "string",
      "name": "string",
      "externalId": "string",
      "projectNumber": "string",
      "coiRequired": true,
      "setupStatus": "requested"
    },
    "slots": [
      {
        "id": "string",
        "assignmentId": "string",
        "projectId": "string",
        "subcontractorId": "string",
        "documentType": "project_coi",
        "status": "requested",
        "documentId": "string",
        "receivedAt": "2024-01-15T09:30:00Z",
        "ingestChannel": "string",
        "effectiveDate": "2024-01-15T09:30:00Z",
        "expirationDate": "2024-01-15T09:30:00Z",
        "certificateHolderVerified": true,
        "projectNumberVerified": true,
        "endorsementsVerified": [
          "string"
        ],
        "policiesCovered": [
          {}
        ],
        "reviewReasoning": "string",
        "verdictAt": "2024-01-15T09:30:00Z",
        "verdictInferred": true,
        "gaps": [
          {}
        ],
        "criteria": [
          {}
        ],
        "warnings": [
          {}
        ],
        "waived": {
          "at": "2024-01-15T09:30:00Z",
          "by": "string",
          "reason": "string"
        },
        "supersededById": "string",
        "createdAt": "2024-01-15T09:30:00Z",
        "updatedAt": "2024-01-15T09:30:00Z"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.tradeguardins.com/v1/assignments/assignmentId"

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

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

print(response.json())
```

```javascript
const url = 'https://api.tradeguardins.com/v1/assignments/assignmentId';
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/assignments/assignmentId"

	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/assignments/assignmentId")

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/assignments/assignmentId")
  .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/assignments/assignmentId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.tradeguardins.com/v1/assignments/assignmentId");
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/assignments/assignmentId")! 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()
```