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

# Cancel a Verification

PUT https://api.truework-sandbox.com/verification-requests/{verification_request_id}/cancel
Content-Type: application/json

Cancels a Verification request, provided the request is not already in a terminal State.

Reference: https://www.truework.com/docs/api-reference/previous-versions/2020-12-07/cancel-a-verification

## Authentication

- `Authorization` header (bearer token, required) — Bearer tokens conform to the [RFC6750](https://datatracker.ietf.org/doc/html/rfc6750#section-2.1) spec. Production API keys (secret keys) are prefixed with `tw_sk_` and sandbox keys are prefixed with `tw_sk_test_`. If your secret key is published, you should rotate your API keys. Truework.JS publishable keys are prefixed with `tw_pk_` and `tw_pk_test` respectively. **Examples** - For Authorization Headers: `Authorization: Bearer tw_sk_test_e508eb797edb95ade85284bcb54dd49ed45db1be` - For the "try it now" `token` field, input only the token itself, omitting `Bearer `.

## Servers

- `https://api.truework-sandbox.com` (Sandbox, default)
- `https://api.truework.com` (Production)

## Request

### Path parameters

- `verification_request_id` (string, required) — Verification ID

### Headers

- `Accept` (enum, optional, default: application/json) — Specify the content type and version that the API should use. It's recommended to include this to avoid breaking changes.
  - Allowed values: `application/json`, `application/json; version=2020-12-07`

### Body (application/json)

This endpoint expects a CancelRequestPutVMinimumVersion.

- `cancellation_reason` (enum, required) — | VALUE | DESCRIPTION | | -------------------- | ---------------------------------------------------------------------------------------------------- | | immediate | Can be used to cancel a request directly after submitting, before Truework has started processing it | | high-turnaround-time | The request is taking longer than expected | | competitor | You preferred a competitor for this request | | wrong-info | The request that is submitted contains information that is wrong | | other | No other reason in the list fits the cancellation reason |
  - Allowed values: `immediate`, `high-turnaround-time`, `competitor`, `wrong-info`, `other`
- `cancellation_details` (string, optional, nullable) — Free form text on the details; can be blank

## Response

### 200

OK

- `branch_id` (string, required, nullable) — The branch id associated with the verification request
- `cancellation_details` (string, required, nullable) — The details for the cancellation; only present when state is canceled
- `cancellation_reason` (enum, required, nullable) — | VALUE | DESCRIPTION | | -------------------- | ---------------------------------------------------------------------------------------------------- | | immediate | Can be used to cancel a request directly after submitting, before Truework has started processing it | | high-turnaround-time | The request is taking longer than expected | | competitor | You preferred a competitor for this request | | wrong-info | The request that is submitted contains information that is wrong | | other | No other reason in the list fits the cancellation reason |
  - Allowed values: `immediate`, `high-turnaround-time`, `competitor`, `wrong-info`, `other`
- `created` (datetime, required)
- `date_of_completion` (datetime, required, nullable) — The date when this verification was completed in ISO 8601 format
- `id` (string, required)
- `loan_id` (string, required, nullable) — The loan id associated with the verification request
- `price` (MoneyAmountVMinimumVersion, required) — Currently we only support USD as currency. Currency amounts are represented as strings with two decimal precision, e.g. "34.95".
- `state` (enum, required) — The state helps convey where the verification request is in the Truework process. It will be returned in the JSON objects returned from this endpoint. The initial state of all Schemas is pending-approval, and will switch to processing once Truework begins to process the request. However, it may switch back to pending-approval if it is pending approval by the target. The states completed, canceled, invalid are all terminal states of a Verification. A Report is only available when it is in the completed state. A Verification will enter the state canceled when either Truework or an API user cancels the request. The invalid state indicates that there are issues with the data e.g. we could not locate the employee at a given employer, or could not find the employer itself. | VALUE | DESCRIPTION | | ---------------- | ------------------------------------------------------------------------------------------------------- | | pending-approval | The initial state after creation; the Truework team has not started working on this request yet | | action-required | A user action is required to continue processing this request; visit the dashboard for more information | | invalid | Contains invalid information that prevents the verification request from being processed by Truework | | processing | The Truework team is currently working on the verification request | | completed | The verification request has been completed and a report can be found from the reports endpoint | | canceled | Truework denied processing of the request or the verifier no longer wants the request to be processed |
  - Allowed values: `pending-approval`, `action-required`, `invalid`, `processing`, `completed`, `canceled`
- `turnaround_time` (_TurnaroundTime, required) — We use data from thousands of verification requests to estimate the duration between creation and completion of a request. For a provided company, upper_bound and lower_bound are the time estimates (in hours) that this particular request will take to be fully processed by Truework. May be an empty if an estimate does not exist for the verification request.

## Errors

### 400 Bad Request Error

Bad Request or Verification not found

- `error` (_InvalidRequestError, required)

### 401 Unauthorized Error

The request's authorization is missing, invalid, or expired

- `error` (Error, required)

### 403 Forbidden Error

Forbidden

- `error` (Error, required)

### 404 Not Found Error

Not Found

- `error` (Error, required)

### 406 Not Acceptable Error

An invalid API version was requested

- `error` (Error, required)

### 429 Too Many Requests Error

Too Many Requests

- `error` (Error, required)

### 451 Unavailable for Legal Reasons Error

Frozen SSN

- `error` (Error, required)

### 500 Internal Server Error

Internal Server Error

- `error` (Error, required)

### 501 Not Implemented Error

Not Implemented

- `error` (Error, required)

## Types

### MoneyAmountVMinimumVersion

- `amount` (string, required, nullable)
- `currency` (enum, required, nullable)
  - Allowed values: `USD`

### _TurnaroundTime

We use data from thousands of verification requests to estimate the duration between creation and completion of a request. For a provided company, upper_bound and lower_bound are the time estimates (in hours) that this particular request will take to be fully processed by Truework. May be an empty if an estimate does not exist for the verification request.

- `best_estimate` (string, required, nullable) — The best estimate of turnaround time in hours
- `lower_bound` (string, required, nullable) — The estimated lower bound in hours
- `upper_bound` (string, required, nullable) — The estimated upper bound in hours

### _InvalidRequestError

- `message` (string, required, default: Invalid field values provided)

### Error

- `message` (string, required)

## Examples

**Request**

```json
{
  "cancellation_reason": "immediate"
}
```

**Response**

```json
{
  "branch_id": "string",
  "cancellation_details": "string",
  "cancellation_reason": "immediate",
  "created": "2021-12-20T18:50:20.291247Z",
  "date_of_completion": "2021-12-20T18:50:20.291247Z",
  "id": "AAAAAAAAAosABwGqF1AUKAH0-puth1tCzLNar3Jyb4bx3wdVKU99XC26",
  "loan_id": "string",
  "price": {
    "amount": "34.95",
    "currency": "USD"
  },
  "state": "pending-approval",
  "turnaround_time": {
    "best_estimate": "48",
    "lower_bound": "20",
    "upper_bound": "128"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel"

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

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

print(response.json())
```

```javascript
const url = 'https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cancellation_reason":"immediate"}'
};

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.truework-sandbox.com/verification-requests/verification_request_id/cancel"

	payload := strings.NewReader("{\n  \"cancellation_reason\": \"immediate\"\n}")

	req, _ := http.NewRequest("PUT", 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.truework-sandbox.com/verification-requests/verification_request_id/cancel")

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

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

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.put("https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_reason\": \"immediate\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel', [
  'body' => '{
  "cancellation_reason": "immediate"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_reason\": \"immediate\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.truework-sandbox.com/verification-requests/verification_request_id/cancel")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```