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

# Clear a manual override and queue a fresh evaluation

DELETE https://api.tradeguardins.com/v1/compliance/{complianceRecordId}/override

Removes the manual override. The status is left unchanged
(`statusReason` becomes "Manual override cleared; re-evaluation queued")
until the queued background check writes the computed verdict. Side
effects: a check-log entry, a `compliance_record.override_cleared` audit
event and one queued compliance check. No request body.

A record with no override is a no-op: `200` with the record unchanged.

Authorization: the `org:admin` role (dashboard sessions), or scopes
`compliance:read` **and** `compliance:override` (API keys); otherwise `403`.


Reference: https://docs.tradeguardins.com/api-reference/compliance/clear-compliance-override

## Authentication

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

## Request

### Path parameters

- `complianceRecordId` (string, required)

## Response

### 200

Override cleared; a re-check is queued

- `data` (ComplianceRecord, optional)

## Errors

### 400 Bad Request Error

Malformed request (`bad_request`, `invalid_identifier`)

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

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

### ComplianceRecord

- `id` (string, optional)
- `subcontractorId` (string, optional)
- `requirementId` (string, optional)
- `complianceProfileEnrollmentId` (string, optional)
- `status` (enum, optional)
  - Allowed values: `pending`, `compliant`, `compliant_pending_verification`, `non_compliant`, `expired`, `under_review`, `not_applicable`
- `met` (boolean, optional) — Whether the requirement is actually met. A track-only requirement (`enforcementLevel: preferred`) never blocks, so one the subcontractor doesn't meet still reads `status: compliant`; `met` is `false` for it. `met` is `true` for `compliant` and `compliant_pending_verification` otherwise (including a manual override to compliant), and `false` for every other status.
- `statusReason` (string, optional, nullable)
- `lastCheckedAt` (datetime, optional, nullable)
- `nextCheckAt` (datetime, optional, nullable)
- `expiresAt` (datetime, optional, nullable)
- `checkResult` (CheckResultDetails, optional) — The evaluation behind a compliance record's status. Extra properties may appear.
- `overrideStatus` (enum, optional, nullable) — Set while a manual override is in force (compliant or non_compliant).
  - Allowed values: `pending`, `compliant`, `compliant_pending_verification`, `non_compliant`, `expired`, `under_review`, `not_applicable`
- `overrideReason` (string, optional, nullable)
- `overrideBy` (string, optional, nullable) — Operator identity (Clerk user id or API key subject).
- `overrideByType` (enum, optional, nullable)
  - Allowed values: `user`, `api_key`
- `overrideAt` (datetime, optional, nullable)
- `overrideFingerprint` (string, optional, nullable) — Internal evidence hash; do not rely on its format.
- `metadata` (ComplianceRecordMetadata, optional)
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)

### ErrorDetailsItems

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

### CheckResultDetails

The evaluation behind a compliance record's status. Extra properties may appear.

- `documentCategory` (string, optional)
- `policyType` (string, optional, nullable)
- `criteria` (CheckResultDetailsCriteria, optional) — The requirement criteria evaluated.
- `checkedAt` (datetime, optional)
- `criteriaResults` (list of CriterionResult, optional)
- `passRate` (CheckResultDetailsPassRate, optional)
- `warnings` (list of string, optional)
- `informationNeeded` (list of ReportInformationNeeded, optional) — A Secretary of State or license check that can't run yet ("Waiting on information"), and what to add to the subcontractor.
- `licenseDetermination` (CheckResultDetailsLicenseDetermination, optional) — For a license check on a subcontractor with no license number, TradeGuard's research on whether this trade needs a license where they work, with its sources.
- `enforcement` (CheckResultDetailsEnforcement, optional) — How the requirement's enforcement level shaped this verdict.
- `changesSinceLastCheck` (list of string, optional) — What changed since the previous Secretary of State or license check, e.g. an entity that is no longer active or a registered name that changed.

### ComplianceRecordMetadata

### CheckResultDetailsCriteria

The requirement criteria evaluated.

### CriterionResult

One check on a compliance record: what was required, what the certificate shows, and the outcome. `passed` is true exactly when `outcome` is `pass` or `waived`. Rows written before TG-1307 have only `key`, `passed`, `expected`, `actual` and `message`.

- `key` (string, required) — Stable id of the check, e.g. `limit:each_occurrence`, `endorsement:additional_insured`, `expiration_date`.
- `passed` (boolean, required)
- `expected` (any, required) — The requirement's value (any JSON type).
- `actual` (any, required) — The value found, or `null` when it is not on the certificate (any JSON type).
- `message` (string, required) — Plain-English line built from the values (never AI-written).
- `field` (string, optional) — Certificate field the value came from, e.g. `general_liability.each_occurrence`.
- `label` (string, optional) — Plain-English name of the check, e.g. `Each Occurrence`.
- `rule` (string, optional) — Comparison used, e.g. `gte` (at least), `lte` (at most), `equals`, `one_of`, `present`, `includes`, `name_match`, `not_expired`. New values may be added.
- `outcome` (enum, optional) — The outcome of one check (TG-1307). `pass` / `fail`: the certificate clearly does or doesn't meet the requirement. `not_on_certificate`: the field is blank on the certificate (never read as 0 or "no"); not passing. `needs_review`: the system couldn't tell what the certificate says (read with under 70% confidence, or ambiguous); a TradeGuard operator decides, and the record reads `under_review` meanwhile. `waived`: the check is waived for this policy; counts as passing. `waiting_on_sub`: waiting on an answer from the subcontractor; not passing. `waiting_on_information`: a Secretary of State or license check can't run until information is added to the subcontractor (see `checkResult.informationNeeded`); not passing, and the record reads `pending`. New values may be added; treat an unknown value as not passing.
  - Allowed values: `pass`, `fail`, `not_on_certificate`, `needs_review`, `waived`, `waiting_on_sub`, `waiting_on_information`
- `policyType` (string, optional, nullable)
- `evidence` (CriterionResultEvidence, optional, nullable) — Where on the certificate the value was read, when known.
- `confidence` (double, optional, nullable) — How sure the certificate reader was of this value (0 to 1), when known. Under 0.70 the outcome is `needs_review`.
- `deferral` (CriterionResultDeferral, optional) — Set when a check is **due at renewal**: it waits, reads `outcome: waived` (counts as met) and its `message` starts with the reason and date. * An endorsement check (the enrollment's `enforceEndorsementsAtRenewal`): "Endorsement due at renewal (\<date>)", no `kind`. * A missing policy the GC deferred (the enrollment's `missingPoliciesAtRenewal`), and the endorsement checks on that policy: "Policy due at renewal (\<date>)", `kind: missing_policy`.

### CheckResultDetailsPassRate

- `passed` (integer, optional)
- `total` (integer, optional)

### ReportInformationNeeded

- `field` (enum, required) — The subcontractor field to fill in. New values may be added.
  - Allowed values: `companyName`, `businessAddress.state`, `tradeCategory`, `licenses[].state`
- `label` (string, required) — What to add, in plain English.

### CheckResultDetailsLicenseDetermination

For a license check on a subcontractor with no license number, TradeGuard's research on whether this trade needs a license where they work, with its sources.

- `required` (boolean, optional, nullable) — `true` a license is required, `false` none is required, `null` couldn't be determined.
- `trade` (string, optional, nullable)
- `jurisdiction` (CheckResultDetailsLicenseDeterminationJurisdiction, optional, nullable)
- `licenseType` (string, optional, nullable)
- `licensingAuthority` (string, optional, nullable)
- `reasoning` (string, optional, nullable)
- `sources` (list of CheckResultDetailsLicenseDeterminationSourcesItems, optional)

### CheckResultDetailsEnforcement

How the requirement's enforcement level shaped this verdict.

- `level` (enum, optional)
  - Allowed values: `required`, `preferred`, `conditional`
- `met` (boolean, optional) — Whether the evidence met the requirement, before enforcement. `false` on a track-only (`preferred`) requirement that reads `compliant`.
- `rawStatus` (string, optional) — The status before enforcement, for a track-only requirement or one waiting on the sub's answer.
- `conditionKey` (string, optional, nullable)
- `conditionMet` (boolean, optional, nullable) — `null` while the sub hasn't answered the condition's question.

### CriterionResultEvidence

Where on the certificate the value was read, when known.

- `documentId` (string, optional)
- `page` (integer, optional)
- `text` (string, optional)

### CriterionResultDeferral

Set when a check is **due at renewal**: it waits, reads `outcome: waived` (counts as met) and its `message` starts with the reason and date. * An endorsement check (the enrollment's `enforceEndorsementsAtRenewal`): "Endorsement due at renewal (\<date>)", no `kind`. * A missing policy the GC deferred (the enrollment's `missingPoliciesAtRenewal`), and the endorsement checks on that policy: "Policy due at renewal (\<date>)", `kind: missing_policy`.

- `until` (date, optional) — The date the check applies again. For an endorsement, the policy's expiration date (sooner if the renewal certificate arrives). For a missing policy, the sub's next renewal: the earliest expiration date among its policies on file (sooner if a renewed policy arrives).
- `originalOutcome` (enum, optional) — The outcome of one check (TG-1307). `pass` / `fail`: the certificate clearly does or doesn't meet the requirement. `not_on_certificate`: the field is blank on the certificate (never read as 0 or "no"); not passing. `needs_review`: the system couldn't tell what the certificate says (read with under 70% confidence, or ambiguous); a TradeGuard operator decides, and the record reads `under_review` meanwhile. `waived`: the check is waived for this policy; counts as passing. `waiting_on_sub`: waiting on an answer from the subcontractor; not passing. `waiting_on_information`: a Secretary of State or license check can't run until information is added to the subcontractor (see `checkResult.informationNeeded`); not passing, and the record reads `pending`. New values may be added; treat an unknown value as not passing.
  - Allowed values: `pass`, `fail`, `not_on_certificate`, `needs_review`, `waived`, `waiting_on_sub`, `waiting_on_information`
- `kind` (enum, optional) — `missing_policy` for a missing policy due at renewal; absent for an endorsement.
  - Allowed values: `missing_policy`

### CheckResultDetailsLicenseDeterminationJurisdiction

- `state` (string, optional)
- `city` (string, optional, nullable)

### CheckResultDetailsLicenseDeterminationSourcesItems

- `url` (string, optional)
- `title` (string, optional, nullable)

## Examples

**Response**

```json
{
  "data": {
    "id": "string",
    "subcontractorId": "string",
    "requirementId": "string",
    "complianceProfileEnrollmentId": "string",
    "status": "pending",
    "met": true,
    "statusReason": "string",
    "lastCheckedAt": "2024-01-15T09:30:00Z",
    "nextCheckAt": "2024-01-15T09:30:00Z",
    "expiresAt": "2024-01-15T09:30:00Z",
    "checkResult": {
      "documentCategory": "string",
      "policyType": "string",
      "criteria": {},
      "checkedAt": "2024-01-15T09:30:00Z",
      "criteriaResults": [
        {
          "key": "string",
          "passed": true,
          "expected": null,
          "actual": null,
          "message": "string",
          "field": "string",
          "label": "string",
          "rule": "string",
          "outcome": "pass",
          "policyType": "string",
          "evidence": {
            "documentId": "string",
            "page": 1,
            "text": "string"
          },
          "confidence": 0.5,
          "deferral": {
            "until": "2023-01-15",
            "originalOutcome": "pass",
            "kind": "missing_policy"
          }
        }
      ],
      "passRate": {
        "passed": 1,
        "total": 1
      },
      "warnings": [
        "string"
      ],
      "informationNeeded": [
        {
          "field": "companyName",
          "label": "string"
        }
      ],
      "licenseDetermination": {
        "required": true,
        "trade": "string",
        "jurisdiction": {
          "state": "string",
          "city": "string"
        },
        "licenseType": "string",
        "licensingAuthority": "string",
        "reasoning": "string",
        "sources": [
          {
            "url": "string",
            "title": "string"
          }
        ]
      },
      "enforcement": {
        "level": "required",
        "met": true,
        "rawStatus": "string",
        "conditionKey": "string",
        "conditionMet": true
      },
      "changesSinceLastCheck": [
        "string"
      ]
    },
    "overrideStatus": "pending",
    "overrideReason": "string",
    "overrideBy": "string",
    "overrideByType": "user",
    "overrideAt": "2024-01-15T09:30:00Z",
    "overrideFingerprint": "string",
    "metadata": {},
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.tradeguardins.com/v1/compliance/complianceRecordId/override"

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

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

print(response.json())
```

```javascript
const url = 'https://api.tradeguardins.com/v1/compliance/complianceRecordId/override';
const options = {method: 'DELETE', 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/compliance/complianceRecordId/override"

	req, _ := http.NewRequest("DELETE", 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/compliance/complianceRecordId/override")

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

request = Net::HTTP::Delete.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.delete("https://api.tradeguardins.com/v1/compliance/complianceRecordId/override")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.tradeguardins.com/v1/compliance/complianceRecordId/override', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.tradeguardins.com/v1/compliance/complianceRecordId/override");
var request = new RestRequest(Method.DELETE);
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/compliance/complianceRecordId/override")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```