Errors & Service Status
The status codes the API returns, what each error body looks like, and how to check whether a validation source is down.
Status Codes
| Status | Meaning |
|---|---|
200 | Success. Check each service's completed flag: false means the upstream source was unavailable and the result is not ready yet. |
400 | Invalid request: a required field for a requested service is missing, a field value is invalid, an unknown field was sent, or a requested service is not enabled for your account. |
401 | The API key is missing, not recognized, or lacks the permission this endpoint requires. The message field says which; see Authentication. |
404 | The request id was not found on your account. |
405 | Wrong HTTP method, such as GET on a validate endpoint. |
Error Formats
A validation request that cannot be processed returns HTTP 400 with an object keyed by the field at fault, each listing the problems found:
{
"foo": [ "The key foo is not a valid key for the request object." ],
"tin": [ "TIN is invalid." ]
}Lookups by id, such as request-details, report errors with the request path and a list of messages instead:
{
"url": "/api/v1/request-details",
"errors": [ "The id provided could not be found" ]
}Handling Errors in Code
Check the status code before reading the body:
# -w prints the HTTP status after the body, so you can see which case you hit
curl -s -w "\nHTTP %{http_code}\n" -X POST https://www.tincomply.com/api/v1/validate/irs-tin-name-matching \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tin": "123-12-1234", "name": "JOHN SMITH" }'import requests
response = requests.post(
"https://www.tincomply.com/api/v1/validate/irs-tin-name-matching",
headers={"X-API-Key": "YOUR_API_KEY"},
json={"tin": "123-12-1234", "name": "JOHN SMITH"},
)
if response.status_code == 401:
# missing key, invalid key, or a key without this endpoint's permission
raise RuntimeError(response.json()["message"])
if response.status_code == 400:
# an object keyed by field name, each with a list of problems
for field, problems in response.json().items():
print(field, problems)
raise ValueError("Request rejected")
response.raise_for_status() # anything else unexpected
data = response.json()
result = data["irsTinNameMatchingResult"]
if not result["completed"]:
# The source was unavailable. Save the id and call request-details later.
print("Pending:", data["id"])
else:
print(result["result"], result["message"])using System.Net;
using System.Net.Http.Json;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var response = await client.PostAsJsonAsync(
"https://www.tincomply.com/api/v1/validate/irs-tin-name-matching",
new { tin = "123-12-1234", name = "JOHN SMITH" });
if (response.StatusCode == HttpStatusCode.Unauthorized)
{
// missing key, invalid key, or a key without this endpoint's permission
var error = await response.Content.ReadFromJsonAsync<JsonElement>();
throw new InvalidOperationException(error.GetProperty("message").GetString());
}
if (response.StatusCode == HttpStatusCode.BadRequest)
{
// an object keyed by field name, each with a list of problems
var problems = await response.Content.ReadFromJsonAsync<JsonElement>();
foreach (var field in problems.EnumerateObject())
{
Console.WriteLine($"{field.Name}: {field.Value}");
}
throw new InvalidOperationException("Request rejected");
}
response.EnsureSuccessStatusCode(); // anything else unexpected
var data = await response.Content.ReadFromJsonAsync<JsonElement>();
var result = data.GetProperty("irsTinNameMatchingResult");
if (!result.GetProperty("completed").GetBoolean())
{
// The source was unavailable. Save the id and call request-details later.
Console.WriteLine($"Pending: {data.GetProperty("id")}");
}
else
{
Console.WriteLine($"{result.GetProperty("result")} {result.GetProperty("message")}");
}const response = await fetch(
"https://www.tincomply.com/api/v1/validate/irs-tin-name-matching",
{
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ tin: "123-12-1234", name: "JOHN SMITH" }),
}
);
if (response.status === 401) {
// missing key, invalid key, or a key without this endpoint's permission
const { message } = await response.json();
throw new Error(message);
}
if (response.status === 400) {
// an object keyed by field name, each with a list of problems
const problems = await response.json();
for (const [field, list] of Object.entries(problems)) console.log(field, list);
throw new Error("Request rejected");
}
if (!response.ok) throw new Error(`Unexpected status ${response.status}`);
const data = await response.json();
const result = data.irsTinNameMatchingResult;
if (!result.completed) {
// The source was unavailable. Save the id and call request-details later.
console.log("Pending:", data.id);
} else {
console.log(result.result, result.message);
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(
URI.create("https://www.tincomply.com/api/v1/validate/irs-tin-name-matching"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{ \"tin\": \"123-12-1234\", \"name\": \"JOHN SMITH\" }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
switch (response.statusCode()) {
// missing key, invalid key, or a key without this endpoint's permission
case 401 -> throw new IllegalStateException(response.body());
// an object keyed by field name, each with a list of problems
case 400 -> throw new IllegalArgumentException(response.body());
// parse with your JSON library and check completed before using the result
case 200 -> System.out.println(response.body());
default -> throw new IllegalStateException("Unexpected status " + response.statusCode());
}
}
}package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
)
func main() {
body := []byte(`{ "tin": "123-12-1234", "name": "JOHN SMITH" }`)
req, err := http.NewRequest("POST", "https://www.tincomply.com/api/v1/validate/irs-tin-name-matching", bytes.NewReader(body))
if err != nil {
log.Fatal(err)
}
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var data map[string]any
json.NewDecoder(resp.Body).Decode(&data)
switch resp.StatusCode {
case 401:
// missing key, invalid key, or a key without this endpoint's permission
log.Fatal(data["message"])
case 400:
// an object keyed by field name, each with a list of problems
for field, problems := range data {
fmt.Println(field, problems)
}
log.Fatal("request rejected")
case 200:
default:
log.Fatalf("unexpected status %d", resp.StatusCode)
}
result := data["irsTinNameMatchingResult"].(map[string]any)
if result["completed"] != true {
// The source was unavailable. Save the id and call request-details later.
fmt.Println("Pending:", data["id"])
} else {
fmt.Println(result["result"], result["message"])
}
}$body = '{ "tin": "123-12-1234", "name": "JOHN SMITH" }'
try {
$response = Invoke-RestMethod -Method Post `
-Uri "https://www.tincomply.com/api/v1/validate/irs-tin-name-matching" `
-Headers @{ "X-API-Key" = "YOUR_API_KEY" } `
-ContentType "application/json" `
-Body $body
}
catch {
$status = [int]$_.Exception.Response.StatusCode
$json = $_.ErrorDetails.Message
if (-not $json -and $_.Exception.Response -is [System.Net.HttpWebResponse]) {
# Windows PowerShell 5.1 leaves the body on the response stream
$json = (New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())).ReadToEnd()
}
$details = $json | ConvertFrom-Json
if ($status -eq 401) {
# missing key, invalid key, or a key without this endpoint's permission
throw $details.message
}
if ($status -eq 400) {
# an object keyed by field name, each with a list of problems
$details.PSObject.Properties | ForEach-Object { "$($_.Name): $($_.Value -join '; ')" }
}
throw
}
$result = $response.irsTinNameMatchingResult
if (-not $result.completed) {
# The source was unavailable. Save the id and call request-details later.
"Pending: $($response.id)"
}
else {
"$($result.result) $($result.message)"
}Service Status
GET /api/v1/status returns the operating status of every validation service, and
GET /api/v1/status/{service} returns one. No API key is required; send Accept: application/json.
Codes: 0 operational, 1 degraded, 2 partial outage, 3 major outage. The same information is on the status page.
curl https://www.tincomply.com/api/v1/status -H "Accept: application/json"import requests
status = requests.get(
"https://www.tincomply.com/api/v1/status",
headers={"Accept": "application/json"},
).json()
for service, info in status.items():
if service != "lastUpdated" and info["code"] != 0:
print(service, info["message"])using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept", "application/json");
var json = await client.GetStringAsync("https://www.tincomply.com/api/v1/status");
foreach (var service in JsonDocument.Parse(json).RootElement.EnumerateObject())
{
if (service.Value.ValueKind == JsonValueKind.Object && service.Value.GetProperty("code").GetInt32() != 0)
{
Console.WriteLine($"{service.Name}: {service.Value.GetProperty("message")}");
}
}const response = await fetch("https://www.tincomply.com/api/v1/status", {
headers: { Accept: "application/json" },
});
const status = await response.json();
for (const [service, info] of Object.entries(status)) {
if (service !== "lastUpdated" && info.code !== 0) console.log(service, info.message);
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://www.tincomply.com/api/v1/status"))
.header("Accept", "application/json")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
// Parse with your JSON library; any service with a code other than 0 is affected.
System.out.println(response.body());
}
}package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://www.tincomply.com/api/v1/status", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
var status map[string]any
if err := json.NewDecoder(resp.Body).Decode(&status); err != nil {
log.Fatal(err)
}
for service, value := range status {
if info, ok := value.(map[string]any); ok && info["code"] != 0.0 {
fmt.Println(service, info["message"])
}
}
}$status = Invoke-RestMethod -Uri "https://www.tincomply.com/api/v1/status" -Headers @{ Accept = "application/json" }
$status.PSObject.Properties |
Where-Object { $_.Name -ne "lastUpdated" -and $_.Value.code -ne 0 } |
ForEach-Object { "$($_.Name): $($_.Value.message)" }Sample response:
{
"irs-tin-name-matching": { "code": 0, "message": "Operational" },
"list-sanctions": { "code": 0, "message": "Operational" },
"npi-registry": { "code": 0, "message": "Operational" },
"lastUpdated": "2026-10-06T03:03:00Z"
}