{
  "openapi": "3.1.0",
  "info": {
    "title": "TPSClear API",
    "version": "1.0.0",
    "summary": "Screen phone numbers before sales calls.",
    "description": "REST API for screening UK numbers against the TPS and CTPS, washing Australian numbers against the Do Not Call Register, screening Canadian numbers against the account's own National Do Not Call List subscription, checking whether mobiles are live, and managing the account's own suppression and consent lists.\n\nAuthenticate with `Authorization: Bearer <key>`. Keys are environment-scoped: `tpsc_test_*` keys screen UK numbers against fixed fixtures for free, and `tpsc_live_*` keys use the live registers and the account's prepaid balances. Each key holds scopes, and each operation names the one it needs in `x-scope` (`any` means no particular scope). A call to an endpoint the key has no scope for returns 403 `insufficient_scope`.\n\nErrors share one envelope, `{\"error\": \"<code>\", ...}`, usually with a `message`.\n\nThe screen, dead number and Australian wash endpoints return `X-RateLimit-Remaining` and `X-RateLimit-Reset` on success, and on a 429 `rate_limited` or `daily_cap_reached` refusal, with `Retry-After` when a wait applies. Limits are counted in lookups, not requests.",
    "contact": {
      "name": "TPSClear",
      "url": "https://tpsclear.co.uk/contact"
    }
  },
  "externalDocs": {
    "description": "TPSClear API documentation",
    "url": "https://tpsclear.co.uk/docs/api"
  },
  "servers": [
    {
      "url": "https://api.tpsclear.co.uk"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Screening",
      "description": "UK TPS and CTPS screening and its audit records."
    },
    {
      "name": "Lists",
      "description": "The account's own suppression and consent lists."
    },
    {
      "name": "Dead number checks",
      "description": "Network lookups for live, switched off or dead mobiles."
    },
    {
      "name": "Australia",
      "description": "Washes against ACMA's Do Not Call Register."
    },
    {
      "name": "Canada",
      "description": "Screening against the account's own National Do Not Call List subscription."
    },
    {
      "name": "United States",
      "description": "Screening against the federal National Do Not Call Registry, on the account's own Subscription Account Number. State lists are not screened."
    },
    {
      "name": "Account",
      "description": "Key identity, usage and rotation."
    }
  ],
  "paths": {
    "/v1/screen": {
      "post": {
        "operationId": "screenNumbers",
        "summary": "Screen UK numbers against the TPS and CTPS",
        "description": "Screen one number, or up to 1,000, against the TPS and CTPS. One result per number sent, in the order sent. Numbers on the account's suppression or consent list are not screened or charged. A live key with no CRM portal spends one prepaid credit per distinct valid number; provider failures are refunded. A test key screens against fixtures for free. The body may be up to 64,000 characters.\n\nThe request id is returned only in the `X-Request-Id` header, which is missing only if the audit record could not be written. Use it with GET /v1/screen/{id}.\n\nNeeds the `screen` scope.",
        "tags": [
          "Screening"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#quick-example"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenRequest"
              },
              "example": {
                "phoneNumbers": [
                  "+441134960001",
                  "+441134960002"
                ],
                "campaignRef": "spring-outbound-2026"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screening results.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId",
                "description": "The audit record id. Absent only when the audit record could not be written."
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenResponse"
                },
                "example": {
                  "results": [
                    {
                      "phoneNumber": "+441134960001",
                      "tpsListed": false,
                      "ctpsListed": false,
                      "status": "clean",
                      "checkedAt": "2026-10-22T10:21:01.204Z",
                      "recheckBy": "2026-11-18",
                      "tpsFileDate": "2026-10-22",
                      "ctpsFileDate": "2026-10-22"
                    }
                  ],
                  "campaignRef": "spring-outbound-2026"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request",
                            "batch_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active. `insufficient_credits`: the prepaid balance is too low for this request (carries `required` and `balance`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required",
                            "insufficient_credits"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `screening_switched_off`: screening is switched off in the TPSClear settings of the connected HubSpot account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "screening_switched_off"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`). `allowance_reached`: a portal key's plan allowance, or a Salesforce org's free monthly allowance, is used up. `daily_cap_reached`: the account's daily limit is used up; it resets at 00:00 UTC (carries `retryAfter`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited",
                            "allowance_reached",
                            "daily_cap_reached"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/screen/{id}": {
      "get": {
        "operationId": "getScreeningRecord",
        "summary": "Retrieve a screening record",
        "description": "Fetch the stored audit record of a past POST /v1/screen call by the id from its `X-Request-Id` header. Records are kept for 24 months (12 for accounts that first bought before 21 October 2026). An id that does not exist, or belongs to another account, returns 404. Spends nothing.\n\nNeeds the `screen` scope.",
        "tags": [
          "Screening"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#screening-record"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The `X-Request-Id` of the original call."
          }
        ],
        "responses": {
          "200": {
            "description": "The screening record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenRecord"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found. Error codes: `not_found`: no record with that id on this account (another account's record also returns this).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Check usage",
        "description": "The calling key's position in its current fair-use window, the account's totals over the last 30 days, and the prepaid UK credits left. Read-only; never consumes budget.\n\nNeeds the `usage` scope.",
        "tags": [
          "Account"
        ],
        "x-scope": "usage",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#usage"
        },
        "responses": {
          "200": {
            "description": "Usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Identify a key",
        "description": "The calling key's identity, the scopes it holds and whether the account still needs to name the business it screens for. Use it to test a connection. The IP allowlist, revocation, entitlement and per-key request limit still apply. It is never refused with `client_name_required`. Spends nothing.\n\nAny valid key may call this, whatever its scopes.",
        "tags": [
          "Account"
        ],
        "x-scope": "any",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#identify-a-key"
        },
        "responses": {
          "200": {
            "description": "Key identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "setCompanyName",
        "summary": "Set the client name",
        "description": "Set the legal name of the business this account screens numbers for. The DMA licence requires it, and a live key on a self-serve account without one is refused elsewhere with 403 `client_name_required`. Live and test keys may both call this, and it is never refused with `client_name_required`. Whitespace is collapsed and trimmed; the name must then be 2 to 160 characters, contain a letter, and not be an email address. The body may be up to 1,000 characters. Returns the updated identity.\n\nAny valid key may call this, whatever its scopes.",
        "tags": [
          "Account"
        ],
        "x-scope": "any",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#client-name"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyNameRequest"
              },
              "example": {
                "company_name": "Acme Outbound Ltd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated key identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_company_name`: the company name is missing, too short or long, has no letter, or is an email address.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_company_name"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys/rotate": {
      "post": {
        "operationId": "rotateKey",
        "summary": "Rotate a key",
        "description": "Mint a replacement for the calling key, with the same environment, plan, limits, scopes and IP allowlist, and by default revoke the old key at once. The new token appears only in this response. The body is optional and may be up to 1,000 characters.\n\nNeeds the `keys` scope.",
        "tags": [
          "Account"
        ],
        "x-scope": "keys",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#rotate-a-key"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateRequest"
              },
              "example": {
                "revokeOld": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. Error codes: `too_many_keys`: the account already holds its maximum number of active keys.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "too_many_keys"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/suppressions": {
      "get": {
        "operationId": "listSuppressions",
        "summary": "Read the suppression list",
        "description": "The account's own do-not-call list: the total count and the 100 most recent entries. A number on it comes back from POST /v1/screen as `suppressed`, is not screened and uses no lookup.\n\nNeeds the `suppress` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "suppress",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "responses": {
          "200": {
            "description": "The suppression list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "addSuppressions",
        "summary": "Add numbers to the suppression list",
        "description": "Add up to 10,000 numbers per request, as JSON or as a `text/csv` body of rows `number,reason,datetime` (header row and the last two columns optional, RFC 4180 quoting, up to 2,000,000 bytes). Numbers already on the list are ignored. A list holds up to 100,000 numbers. Good rows are imported and the rest reported. Live keys only.\n\nNeeds the `suppress` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "suppress",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListAddRequest"
              },
              "example": {
                "entries": [
                  {
                    "number": "01134960001",
                    "reason": "Web form, ref WF-2291",
                    "datetime": "2026-09-18T11:02:00Z"
                  }
                ]
              }
            },
            "text/csv": {
              "schema": {
                "type": "string"
              },
              "example": "number,reason,datetime\n01134960001,\"Asked not to be called, by phone\",18/09/2026 12:02\n07700900123,Client removal list,\n"
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows. `list_full`: the list would pass its 100,000 number ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request",
                            "batch_too_large",
                            "list_full"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `test_key_read_only`: a test key tried to change the suppression or consent list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "test_key_read_only"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removeSuppression",
        "summary": "Remove a number from the suppression list",
        "description": "Remove one number, sent as `{\"number\": \"+44..\", \"note\": \"..\"}` in a JSON body, or as `?number=&note=` query parameters (the body is read first; a number in the query string lands in access logs). The note, why it came off the list, is optional. Live keys only.\n\nNeeds the `suppress` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "suppress",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The number to remove, when no body is sent."
          },
          {
            "name": "note",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional note, when no body is sent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListRemoveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removal result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRemoveResponse"
                },
                "example": {
                  "ok": true,
                  "removed": true
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_request`: a required field is missing or has the wrong type or format.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_request"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `test_key_read_only`: a test key tried to change the suppression or consent list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "test_key_read_only"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/consents": {
      "get": {
        "operationId": "listConsents",
        "summary": "Read the consent list",
        "description": "The account's consent list: numbers it holds consent to call. A number on it comes back from POST /v1/screen as `consented`, is not screened and uses no lookup, unless it is also on the suppression list.\n\nNeeds the `consents` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "consents",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "responses": {
          "200": {
            "description": "The consent list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "addConsents",
        "summary": "Add numbers to the consent list",
        "description": "Add up to 10,000 numbers per request, as JSON or as a `text/csv` body of rows `number,reason,datetime` (header row and the last two columns optional, RFC 4180 quoting, up to 2,000,000 bytes). Numbers already on the list are ignored. A list holds up to 100,000 numbers. Good rows are imported and the rest reported. Live keys only. Put the consent evidence in the reason.\n\nNeeds the `consents` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "consents",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListAddRequest"
              },
              "example": {
                "entries": [
                  {
                    "number": "01134960001",
                    "reason": "Web form, ref WF-2291",
                    "datetime": "2026-09-18T11:02:00Z"
                  }
                ]
              }
            },
            "text/csv": {
              "schema": {
                "type": "string"
              },
              "example": "number,reason,datetime\n01134960001,\"Asked not to be called, by phone\",18/09/2026 12:02\n07700900123,Client removal list,\n"
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows. `list_full`: the list would pass its 100,000 number ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request",
                            "batch_too_large",
                            "list_full"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `test_key_read_only`: a test key tried to change the suppression or consent list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "test_key_read_only"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removeConsent",
        "summary": "Remove a number from the consent list",
        "description": "Remove one number, sent as `{\"number\": \"+44..\", \"note\": \"..\"}` in a JSON body, or as `?number=&note=` query parameters (the body is read first; a number in the query string lands in access logs). The note, why consent was withdrawn, is optional. Live keys only.\n\nNeeds the `consents` scope.",
        "tags": [
          "Lists"
        ],
        "x-scope": "consents",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#endpoints"
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The number to remove, when no body is sent."
          },
          {
            "name": "note",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional note, when no body is sent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListRemoveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removal result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRemoveResponse"
                },
                "example": {
                  "ok": true,
                  "removed": true
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_request`: a required field is missing or has the wrong type or format.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_request"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `test_key_read_only`: a test key tried to change the suppression or consent list.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "test_key_read_only"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/dead-number": {
      "post": {
        "operationId": "checkDeadNumbers",
        "summary": "Check whether mobiles are live, switched off or dead",
        "description": "A fresh network (HLR) lookup for up to 500 numbers, in any country. Paid from prepaid dead number checks, separate from UK credits: a mobile costs one check and a US number two. Invalid numbers and landlines outside the US are not looked up and are free. The checks a request could need are reserved first, and what was not used is credited back before the response. Live keys only. The body may be up to 32,000 characters.\n\nNeeds the `dead_number` scope.",
        "tags": [
          "Dead number checks"
        ],
        "x-scope": "dead_number",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#dead-number-checks"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeadNumberRequest"
              },
              "example": {
                "numbers": [
                  "07400 123456",
                  "+44 20 7946 0000"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per number sent, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId",
                "description": "The request id."
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeadNumberResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `live_key_required`: a test key, or the service is not in live mode; this check has no test mode. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "live_key_required",
                            "invalid_request",
                            "batch_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active. `insufficient_credits`: the prepaid balance is too low for this request (carries `required` and `balance`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required",
                            "insufficient_credits"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`). `daily_cap_reached`: the account's daily limit is used up; it resets at 00:00 UTC (carries `retryAfter`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited",
                            "daily_cap_reached"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read. `lookup_unavailable`: the network lookup did not answer; nothing is charged, or the checks are credited back.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable",
                            "lookup_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getDeadNumberBalance",
        "summary": "Dead number checks left",
        "description": "With a key, the account's prepaid dead number checks left. (Without an `Authorization` header the endpoint returns service information instead; that reply is not part of this contract.)\n\nNeeds the `dead_number` scope.",
        "tags": [
          "Dead number checks"
        ],
        "x-scope": "dead_number",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#dead-number-checks"
        },
        "responses": {
          "200": {
            "description": "Balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeadNumberBalance"
                },
                "example": {
                  "checksRemaining": 249
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/dncl": {
      "post": {
        "operationId": "checkCanadianNumbers",
        "summary": "Screen Canadian numbers against the National DNCL",
        "description": "Screen up to 500 Canadian numbers against the National Do Not Call List file of the account's own DNCL subscription, which must be linked to the account first. A subscription cannot be shared, so there is no fallback to another file. A refusal answers the whole request; no number comes back as not on the list. Not billed, and works with live and test keys alike. Each distinct valid number counts towards the key's lookup budget and the account's daily limit, shared with UK screening. The body may be up to 32,000 characters.\n\nNeeds the `screen` scope.",
        "tags": [
          "Canada"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/developers/dncl"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DnclRequest"
              },
              "example": {
                "phoneNumbers": [
                  "+1 416 555 0100",
                  "(604) 555-0123",
                  "905 555 0199"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per number sent, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId",
                "description": "The request id, the same as `requestId` in the body."
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnclResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request",
                            "batch_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `dncl_subscription_required`: no National DNCL subscription is linked to this account. `dncl_subscription_lapsed`: the linked National DNCL subscription has ended; renew it with the DNCL operator, then contact TPSClear.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "dncl_subscription_required",
                            "dncl_subscription_lapsed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`). `daily_cap_reached`: the account's daily limit is used up; it resets at 00:00 UTC (carries `retryAfter`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited",
                            "daily_cap_reached"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read. `dncl_list_stale`: the account's National DNCL file is more than 31 days old and cannot be used.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable",
                            "dncl_list_stale"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getDnclList",
        "summary": "The account's linked DNCL list",
        "description": "With a key, the National DNCL list linked to the account, or `{\"linked\": false}` when none is. (Without an `Authorization` header the endpoint returns service information instead; that reply is not part of this contract.)\n\nNeeds the `screen` scope.",
        "tags": [
          "Canada"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/developers/dncl"
        },
        "responses": {
          "200": {
            "description": "The linked list, or linked false.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DnclListInfo"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/dncr": {
      "post": {
        "operationId": "washAustralianNumbers",
        "summary": "Wash Australian numbers against the Do Not Call Register",
        "description": "Wash up to 500 Australian numbers against ACMA's Do Not Call Register on TPSClear's subscription. Each distinct valid, allocated number sent uses one prepaid wash, rechecks included. Invalid and unallocated numbers are not sent and cost nothing, and a number the register does not answer is refunded. A wash is valid for 30 days. Live keys only. The body may be up to 32,000 characters.\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DncrRequest"
              },
              "example": {
                "phoneNumbers": [
                  "+61 491 570 156",
                  "02 6219 5555"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per number sent, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId",
                "description": "The request id."
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DncrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `live_key_required`: a test key, or the service is not in live mode; this check has no test mode. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "live_key_required",
                            "invalid_request",
                            "batch_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active. `insufficient_credits`: the prepaid balance is too low for this request (carries `required` and `balance`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required",
                            "insufficient_credits"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`). `daily_cap_reached`: the account's daily limit is used up; it resets at 00:00 UTC (carries `retryAfter`). `register_busy`: every Do Not Call Register slot stayed taken; nothing is charged, retry after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited",
                            "daily_cap_reached",
                            "register_busy"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read. `register_unavailable`: the Do Not Call Register did not answer; nothing is charged, or the washes are credited back.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable",
                            "register_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getDncrBalance",
        "summary": "Australian washes left",
        "description": "With a key, the account's prepaid Australian washes left. (Without an `Authorization` header the endpoint returns service information instead; that reply is not part of this contract.)\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia"
        },
        "responses": {
          "200": {
            "description": "Balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DncrBalance"
                },
                "example": {
                  "washesRemaining": 2440
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "post": {
        "operationId": "submitAustralianBulkJob",
        "summary": "Submit an Australian bulk job",
        "description": "Bulk jobs are switched on per account on request. Otherwise every call returns 403 `bulk_jobs_not_enabled` (after the key checks: authentication, scope, a live key).\n\nWash up to 100,000 Australian numbers against ACMA's Do Not Call Register in the background. The numbers are washed in chunks of 1,000, one chunk after another. Each distinct valid, allocated number uses one prepaid wash, the same price as POST /v1/dncr; duplicates are washed once, invalid and unallocated entries cost nothing, and numbers the register gives no answer for are refunded. The Australian balance must cover every distinct washable number at submit, but each chunk is charged only when it is washed. The per-key lookup budget does not apply; the account's daily limit does, and a job that reaches it pauses until 00:00 UTC. An account can have one job queued, running or paused at a time. Live keys only. The body may be up to 2,000,000 bytes.\n\nSend an `Idempotency-Key` header to make retries safe: the same key with the same body within 24 hours returns the original job with `Idempotent-Replayed: true`.\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia-bulk-jobs"
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "description": "Any value of 1 to 255 characters. Reused within 24 hours with the same body, it returns the original job; with a different body, 409 `idempotency_conflict`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobRequest"
              },
              "example": {
                "region": "au",
                "phoneNumbers": [
                  "+61 491 570 156",
                  "02 6219 5555"
                ],
                "campaignRef": "spring-2027"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The job is queued and its first chunks start at once. An idempotent replay returns the same job, as it stands now, with `Idempotent-Replayed: true`.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when the reply is the job an earlier call with the same `Idempotency-Key` and body created. Absent on a new job.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobSubmitted"
                },
                "example": {
                  "id": "6f1c2b0e-8d4a-4f2e-9b7a-2c1d3e4f5a6b",
                  "status": "queued",
                  "submitted": 2,
                  "distinct": 2,
                  "invalid": 0,
                  "unallocated": 0,
                  "estimatedWashes": 2
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `live_key_required`: a test key, or the service is not in live mode; the register has no test mode. `region_not_supported`: `region` is `\"uk\"`; bulk jobs are for Australia only for now. `invalid_request`: `region` or `phoneNumbers` is missing or wrong, `campaignRef` is not a string of up to 200 characters, the `Idempotency-Key` header is empty or over 255 characters, or none of the numbers can be washed (then carries `invalid` and `unallocated`). `daily_limit_too_low`: the account's daily limit is below one chunk (1,000 numbers, or the job's distinct numbers if fewer); carries `dailyLimit`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "live_key_required",
                            "region_not_supported",
                            "invalid_request",
                            "daily_limit_too_low"
                          ]
                        },
                        "invalid": {
                          "type": "integer",
                          "description": "Entries that are not an Australian number (`invalid_request` when none can be washed)."
                        },
                        "unallocated": {
                          "type": "integer",
                          "description": "Numbers outside every allocated range (`invalid_request` when none can be washed)."
                        },
                        "dailyLimit": {
                          "type": "integer",
                          "description": "The account's daily limit (`daily_limit_too_low`)."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active. `insufficient_credits`: the Australian balance does not cover the job's distinct washable numbers (carries `required` and `balance`). Nothing is charged at submit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required",
                            "insufficient_credits"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `bulk_jobs_not_enabled`: bulk jobs are not switched on for this account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "bulk_jobs_not_enabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. Error codes: `idempotency_conflict`: the `Idempotency-Key` was used in the last 24 hours with a different body (carries `jobId`). `job_limit_reached`: the account already has a job queued, running or paused (usually carries its `jobId`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "idempotency_conflict",
                            "job_limit_reached"
                          ]
                        },
                        "jobId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The job the conflict is with."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Job too large. Error codes: `job_too_large`: over 100,000 numbers, or a body over 2,000,000 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "job_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Error codes: `rate_limited`: the key's per-minute request limit is used up (carries `retryAfter`). The per-key lookup budget does not apply to bulk jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Requests left in the key's current minute."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read. `register_capacity`: the register cannot take a job this size right now; try again later or send a smaller job.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable",
                            "register_capacity"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "getAustralianBulkJob",
        "summary": "Australian bulk job status",
        "description": "Bulk jobs are switched on per account on request. Otherwise every call returns 403 `bulk_jobs_not_enabled` (after the key checks: authentication, scope, a live key).\n\nThe job's status and counts. Poll it while the job runs. When part of a chunk fails at the register, those numbers are queued again as a further chunk at the end of the job, so the number of result pages can grow while a job runs. Spends nothing.\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia-bulk-jobs"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The job `id` from POST /v1/jobs."
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "6f1c2b0e-8d4a-4f2e-9b7a-2c1d3e4f5a6b",
                  "region": "au",
                  "status": "running",
                  "pausedReason": null,
                  "campaignRef": "spring-2027",
                  "submitted": 2,
                  "distinct": 2,
                  "washed": 1,
                  "onRegister": 0,
                  "notOnRegister": 1,
                  "invalid": 0,
                  "unknown": 0,
                  "washesCharged": 1,
                  "refunded": 0,
                  "createdAt": "2027-03-01T09:00:00.000Z",
                  "finishedAt": null,
                  "expiresAt": "2029-03-01T09:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `live_key_required`: a test key, or the service is not in live mode; the register has no test mode.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "live_key_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `bulk_jobs_not_enabled`: bulk jobs are not switched on for this account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "bulk_jobs_not_enabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error codes: `not_found`: no job with this id on this account (an id that is not a UUID, or another account's job, gives the same reply).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Error codes: `rate_limited`: the key's per-minute request limit is used up (carries `retryAfter`). The per-key lookup budget does not apply to bulk jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Requests left in the key's current minute."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "cancelAustralianBulkJob",
        "summary": "Cancel an Australian bulk job",
        "description": "Bulk jobs are switched on per account on request. Otherwise every call returns 403 `bulk_jobs_not_enabled` (after the key checks: authentication, scope, a live key).\n\nCancel a queued, running or paused job and return it. Chunks not started are never charged; any washes already set aside for them are given back within a few minutes. A chunk being washed finishes and is charged as usual. A finished job is returned unchanged.\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia-bulk-jobs"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The job `id` from POST /v1/jobs."
          }
        ],
        "responses": {
          "200": {
            "description": "The job after the cancel (or as it was, when it had already finished).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "6f1c2b0e-8d4a-4f2e-9b7a-2c1d3e4f5a6b",
                  "region": "au",
                  "status": "running",
                  "pausedReason": null,
                  "campaignRef": "spring-2027",
                  "submitted": 2,
                  "distinct": 2,
                  "washed": 1,
                  "onRegister": 0,
                  "notOnRegister": 1,
                  "invalid": 0,
                  "unknown": 0,
                  "washesCharged": 1,
                  "refunded": 0,
                  "createdAt": "2027-03-01T09:00:00.000Z",
                  "finishedAt": null,
                  "expiresAt": "2029-03-01T09:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `live_key_required`: a test key, or the service is not in live mode; the register has no test mode.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "live_key_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `bulk_jobs_not_enabled`: bulk jobs are not switched on for this account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "bulk_jobs_not_enabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error codes: `not_found`: no job with this id on this account (an id that is not a UUID, or another account's job, gives the same reply).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Error codes: `rate_limited`: the key's per-minute request limit is used up (carries `retryAfter`). The per-key lookup budget does not apply to bulk jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Requests left in the key's current minute."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/results": {
      "get": {
        "operationId": "getAustralianBulkJobResults",
        "summary": "Australian bulk job results",
        "description": "Bulk jobs are switched on per account on request. Otherwise every call returns 403 `bulk_jobs_not_enabled` (after the key checks: authentication, scope, a live key).\n\nOne page per chunk (up to 1,000 numbers). Leave out `cursor` for the first page, then pass `nextCursor` from each page until it is null. Each result is the object POST /v1/dncr returns, one per distinct number, with the numbers the register gave no answer for last on their page as `unknown`. Invalid and unallocated entries are counted on the job, not listed. A chunk not washed yet gives an empty page with `pending: true` and the same cursor; a cancelled chunk gives an empty page and the next cursor.\n\nWith `format=csv` (checked before `cursor`), a done job redirects with 302 to its gzipped CSV results file, a presigned link valid for 15 minutes. Spends nothing.\n\nNeeds the `dncr` scope.",
        "tags": [
          "Australia"
        ],
        "x-scope": "dncr",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#australia-bulk-jobs"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The job `id` from POST /v1/jobs."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The `nextCursor` from the previous page. Leave it out for the first page."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv"
              ]
            },
            "description": "`csv` for a redirect to the whole results file once the job is `done`."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResultsPage"
                },
                "example": {
                  "results": [
                    {
                      "phoneNumber": "+61491570156",
                      "status": "not_on_register",
                      "washedAt": "2027-03-01T09:00:04.000Z",
                      "validUntil": "2027-03-31T09:00:04.000Z",
                      "washRef": "4821"
                    }
                  ],
                  "nextCursor": "1"
                }
              }
            }
          },
          "302": {
            "description": "With `format=csv` on a done job: a redirect to the results file (`results.csv.gz`, gzipped CSV with the header `number,result,washed_at,valid_until,client_ref,request_id`). The link is valid for 15 minutes; request a new one when it expires. The file is a multi-member gzip file, which some streaming readers stop reading after the first member.",
            "headers": {
              "Location": {
                "description": "The presigned download link.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `live_key_required`: a test key, or the service is not in live mode; the register has no test mode. `invalid_cursor`: `cursor` is not one this job returned.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "live_key_required",
                            "invalid_cursor"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `bulk_jobs_not_enabled`: bulk jobs are not switched on for this account.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "bulk_jobs_not_enabled"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error codes: `not_found`: no job with this id on this account (an id that is not a UUID, or another account's job, gives the same reply).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "not_found"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. Error codes: `job_not_done`: `format=csv` before the job is done, or on a cancelled or failed job (carries the job's `status`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "job_not_done"
                          ]
                        },
                        "status": {
                          "$ref": "#/components/schemas/JobStatus"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Error codes: `rate_limited`: the key's per-minute request limit is used up (carries `retryAfter`). The per-key lookup budget does not apply to bulk jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Requests left in the key's current minute."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/us-dnc": {
      "post": {
        "operationId": "checkUsNumbers",
        "summary": "Screen US numbers against the National Do Not Call Registry",
        "description": "Screen up to 500 US numbers against the federal National Do Not Call Registry, as downloaded on the account's own Subscription Account Number (SAN), which must be linked to the account first. A download cannot serve several sellers, so there is no fallback to another file. Federal list only: state do-not-call lists are not screened, so `not_on_list` says nothing about them. US territories with US area codes are included; Canadian, Caribbean and toll-free numbers come back `invalid`. A refusal answers the whole request; no number comes back as not on the list. Not billed, and works with live and test keys alike. Each distinct valid number counts towards the key's lookup budget and the account's daily limit, shared with UK screening. The body may be up to 32,000 characters.\n\nNeeds the `screen` scope.",
        "tags": [
          "United States"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#united-states"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsDncRequest"
              },
              "example": {
                "phoneNumbers": [
                  "+1 212 555 0100",
                  "(415) 555-0123",
                  "312 555 0199"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per number sent, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId",
                "description": "The request id, the same as `requestId` in the body."
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsDncResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Error codes: `invalid_json`: the body is not a JSON object. `invalid_request`: a required field is missing or has the wrong type or format. `batch_too_large`: more numbers than one request allows.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "invalid_json",
                            "invalid_request",
                            "batch_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`). `us_dnc_subscription_required`: no National Do Not Call Registry subscription is linked to this account. `us_dnc_subscription_lapsed`: the linked subscription has ended; renew it on the registry's telemarketer site, then contact TPSClear.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required",
                            "us_dnc_subscription_required",
                            "us_dnc_subscription_lapsed"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body too large. Error codes: `payload_too_large`: the body is over the size limit.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "payload_too_large"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`). `daily_cap_reached`: the account's daily limit is used up; it resets at 00:00 UTC (carries `retryAfter`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited",
                            "daily_cap_reached"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read. `us_dnc_list_stale`: the account's National Do Not Call Registry file is more than 31 days old and cannot be used.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable",
                            "us_dnc_list_stale"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getUsDncList",
        "summary": "The account's linked National Do Not Call Registry list",
        "description": "With a key, the National Do Not Call Registry list linked to the account, or `{\"linked\": false}` when none is. (Without an `Authorization` header the endpoint returns service information instead; that reply is not part of this contract.)\n\nNeeds the `screen` scope.",
        "tags": [
          "United States"
        ],
        "x-scope": "screen",
        "externalDocs": {
          "url": "https://tpsclear.co.uk/docs/api#united-states"
        },
        "responses": {
          "200": {
            "description": "The linked list, or linked false.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsDncListInfo"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unrecognised API key. Error codes: `unauthorized`: no `Authorization: Bearer` header. `invalid_api_key`: the key is malformed, revoked or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "unauthorized",
                            "invalid_api_key"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment or subscription needed. Error codes: `subscription_required`: the account, or the connected HubSpot subscription, is not active.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "subscription_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Error codes: `ip_not_allowed`: the call came from an address outside the key's IP allowlist. `insufficient_scope`: the key lacks the scope this endpoint needs. `client_name_required`: a live key on a self-serve account that has not named the business it screens for (carries `account_url` and `fix`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "ip_not_allowed",
                            "insufficient_scope",
                            "client_name_required"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests or a limit reached. Error codes: `rate_limited`: the key's per-minute request limit or its fair-use lookup budget is used up (carries `retryAfter`; the budget refusal also carries `limit`, `remaining` and `reset`).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "rate_limited"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset",
                "description": "Sent only on `rate_limited` and `daily_cap_reached`."
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          },
          "503": {
            "description": "Service unavailable. Safe to retry shortly. Error codes: `service_unavailable`: a datastore or dependency could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "error": {
                          "enum": [
                            "service_unavailable"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "tpsc_live_* or tpsc_test_*",
        "description": "An API key from https://tpsclear.co.uk/account (or the HubSpot app settings), sent as `Authorization: Bearer tpsc_live_...` or `Bearer tpsc_test_...`."
      }
    },
    "headers": {
      "XRequestId": {
        "description": "The request id.",
        "schema": {
          "type": "string"
        }
      },
      "XRateLimitRemaining": {
        "description": "Lookups left in the key's current fair-use window (or the account's daily ceiling on a `daily_cap_reached` refusal).",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitReset": {
        "description": "Epoch second the window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying. Sent on `rate_limited`, `daily_cap_reached` and `register_busy` refusals when a wait applies.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "The error envelope every endpoint uses: `error` is a stable machine code, and some codes carry extra fields beside it. `message` is present on most codes, but not on `payload_too_large`, `invalid_json` or most `service_unavailable` replies.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Machine-readable error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation."
          },
          "retryAfter": {
            "type": "integer",
            "description": "Seconds to wait before retrying."
          },
          "limit": {
            "type": "integer",
            "description": "The key's fair-use lookup limit for the window (`rate_limited` from a lookup budget)."
          },
          "remaining": {
            "type": "integer",
            "description": "Lookups left in the window (`rate_limited` from a lookup budget)."
          },
          "reset": {
            "type": "integer",
            "description": "Epoch second the window resets (`rate_limited` from a lookup budget)."
          },
          "cap": {
            "type": "integer",
            "description": "The account's daily screening ceiling (`daily_cap_reached` on POST /v1/screen)."
          },
          "required": {
            "type": "integer",
            "description": "Credits, checks or washes the request needs (`insufficient_credits`)."
          },
          "balance": {
            "type": "integer",
            "description": "Credits, checks or washes the account holds (`insufficient_credits`)."
          },
          "settings_url": {
            "type": "string",
            "format": "uri",
            "description": "HubSpot settings page for the connected portal (`allowance_reached` on a portal key)."
          },
          "account_url": {
            "type": "string",
            "format": "uri",
            "description": "Where to set the company name (`client_name_required`)."
          },
          "fix": {
            "type": "string",
            "description": "How to clear the refusal (`client_name_required`)."
          }
        },
        "additionalProperties": true
      },
      "ScreenRequest": {
        "type": "object",
        "description": "Send `phoneNumbers` (an array) or `phone` (one number). When both are present, `phoneNumbers` is used. Numbers may be national (`0113 496 0001`) or international. A non-string array entry is turned into a string.",
        "properties": {
          "phoneNumbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "type": "string"
            },
            "description": "Up to 1,000 numbers. Duplicates are screened and charged once."
          },
          "phone": {
            "type": "string",
            "description": "A single number, used when `phoneNumbers` is absent."
          },
          "campaignRef": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "pattern": "^[\\w\\s.,:/#-]{1,120}$",
            "description": "Optional reference stored on the audit record and echoed in the response. Trimmed first, then it must be 1 to 120 characters of letters, digits, underscore, spaces and `. , : / # -` only. Null is treated as absent."
          }
        },
        "anyOf": [
          {
            "required": [
              "phoneNumbers"
            ]
          },
          {
            "required": [
              "phone"
            ]
          }
        ]
      },
      "ScreenStatus": {
        "type": "string",
        "enum": [
          "clean",
          "tps-listed",
          "ctps-listed",
          "unknown",
          "suppressed",
          "consented"
        ],
        "description": "`clean`: on neither register. `tps-listed`: on the TPS. `ctps-listed`: on the CTPS (a number on both comes back `ctps-listed` with both flags true). `unknown`: no verdict, either not a valid UK number or the register lookup failed; treat as not screened. `suppressed`: on the account's suppression list, not looked up. `consented`: on the account's consent list and not its suppression list, not looked up."
      },
      "ScreenResult": {
        "type": "object",
        "description": "One entry per number sent, in the order sent.",
        "required": [
          "phoneNumber",
          "tpsListed",
          "ctpsListed",
          "status",
          "checkedAt"
        ],
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "The number in E.164 form. An entry that is not a valid UK number is echoed back as sent, cut to 40 characters."
          },
          "tpsListed": {
            "type": "boolean",
            "description": "On the TPS (individuals and sole traders)."
          },
          "ctpsListed": {
            "type": "boolean",
            "description": "On the CTPS (companies and other organisations)."
          },
          "status": {
            "$ref": "#/components/schemas/ScreenStatus"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the register was checked for this number. For `suppressed` and `consented`, the time of the request."
          },
          "recheckBy": {
            "type": "string",
            "format": "date",
            "description": "The UTC date to screen this number again: 27 days after the UTC date of `checkedAt`. Absent on `unknown`, `suppressed` and `consented`."
          },
          "tpsFileDate": {
            "type": "string",
            "format": "date",
            "description": "Date of the TPS file the number was checked against. Present when TPSClear's own register answered, and on test keys."
          },
          "ctpsFileDate": {
            "type": "string",
            "format": "date",
            "description": "Date of the CTPS file, on the same rule as `tpsFileDate`."
          }
        }
      },
      "ScreenResponse": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenResult"
            }
          },
          "campaignRef": {
            "type": "string",
            "description": "The trimmed `campaignRef`, present only when one was sent."
          }
        }
      },
      "ScreenSummary": {
        "type": "object",
        "description": "Results counted by status.",
        "required": [
          "clean",
          "tpsListed",
          "ctpsListed",
          "unknown",
          "suppressed"
        ],
        "properties": {
          "clean": {
            "type": "integer"
          },
          "tpsListed": {
            "type": "integer"
          },
          "ctpsListed": {
            "type": "integer"
          },
          "unknown": {
            "type": "integer",
            "description": "Every result without a register verdict, including invalid UK numbers."
          },
          "suppressed": {
            "type": "integer"
          },
          "consented": {
            "type": "integer",
            "description": "May be absent on older records."
          }
        }
      },
      "ScreenRecord": {
        "type": "object",
        "description": "The stored audit record of one POST /v1/screen call.",
        "required": [
          "id",
          "createdAt",
          "environment",
          "lookups",
          "campaignRef",
          "summary",
          "providerFailures",
          "results"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The request id, the same value as the `X-Request-Id` header on the original call."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was written, at the end of the call."
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "description": "From the key that made the call."
          },
          "lookups": {
            "type": "integer",
            "description": "Distinct valid numbers sent for a register check. On a live key, what the call cost before any refund."
          },
          "campaignRef": {
            "type": [
              "string",
              "null"
            ],
            "description": "The campaign reference sent with the call, or null."
          },
          "summary": {
            "$ref": "#/components/schemas/ScreenSummary"
          },
          "providerFailures": {
            "type": "integer",
            "description": "Distinct numbers whose register lookup failed; refunded and worth retrying."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenResult"
            },
            "description": "The results exactly as the original call returned them."
          }
        }
      },
      "KeyIdentity": {
        "type": "object",
        "required": [
          "last4",
          "name"
        ],
        "properties": {
          "last4": {
            "type": "string",
            "description": "Last four characters of the token."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key's name, or null."
          }
        }
      },
      "Usage": {
        "type": "object",
        "required": [
          "key",
          "environment",
          "plan",
          "window",
          "last30d",
          "uk_credits"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/KeyIdentity"
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "plan": {
            "type": "string"
          },
          "window": {
            "type": "object",
            "description": "The calling key's current fair-use window, counted in lookups.",
            "required": [
              "limit",
              "windowSecs",
              "used",
              "remaining",
              "reset"
            ],
            "properties": {
              "limit": {
                "type": "integer"
              },
              "windowSecs": {
                "type": "integer"
              },
              "used": {
                "type": "integer"
              },
              "remaining": {
                "type": "integer"
              },
              "reset": {
                "type": "integer",
                "description": "Epoch second the window rolls over."
              }
            }
          },
          "last30d": {
            "type": "object",
            "description": "Account-wide totals over the last 30 days.",
            "required": [
              "calls",
              "lookups"
            ],
            "properties": {
              "calls": {
                "type": "integer"
              },
              "lookups": {
                "type": "integer"
              },
              "approximate": {
                "type": "boolean",
                "const": true,
                "description": "Present when `lookups` was summed from a capped sample of 1,000 calls."
              }
            }
          },
          "uk_credits": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Prepaid UK checks left, for a live key with no CRM portal behind it. Null otherwise, or when the balance could not be read."
          }
        }
      },
      "Me": {
        "type": "object",
        "required": [
          "key",
          "environment",
          "plan",
          "scopes",
          "company_name",
          "client_name_required",
          "client_name_reason"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/KeyIdentity"
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "plan": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The legal name of the business the account screens for, or null."
          },
          "client_name_required": {
            "type": "boolean",
            "description": "True while a live key on this account is refused, or in grace, for want of a company name."
          },
          "client_name_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the name is needed, when `client_name_required` is true; null otherwise."
          }
        }
      },
      "CompanyNameRequest": {
        "type": "object",
        "required": [
          "company_name"
        ],
        "properties": {
          "company_name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 160,
            "description": "The legal name of the business the numbers are screened for. Whitespace is collapsed and trimmed before the length check."
          }
        }
      },
      "DnclRequest": {
        "type": "object",
        "description": "Send `phoneNumbers` (an array) or `phone` (one number). When both are present, `phoneNumbers` is used.",
        "properties": {
          "phoneNumbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "Up to 500 numbers. A number with no country code is read as Canadian. Duplicates are checked once."
          },
          "phone": {
            "type": "string",
            "description": "A single number, used when `phoneNumbers` is absent."
          }
        },
        "anyOf": [
          {
            "required": [
              "phoneNumbers"
            ]
          },
          {
            "required": [
              "phone"
            ]
          }
        ]
      },
      "DnclResult": {
        "type": "object",
        "required": [
          "phoneNumber",
          "status"
        ],
        "description": "One entry per number sent, in the order sent. `on_list` and `not_on_list` carry `checkedAt`, `listDate` and `validUntil`; `not_covered` carries `areaCode` and no dates; `invalid` carries neither.",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "E.164, or the input cut to 40 characters when it is not a valid Canadian number."
          },
          "status": {
            "type": "string",
            "enum": [
              "on_list",
              "not_on_list",
              "not_covered",
              "invalid"
            ],
            "description": "`on_list`: on the account's National DNCL file. `not_on_list`: not on the file. `not_covered`: the area code is not in the subscription, so it was not checked; never a clear result. `invalid`: not a valid Canadian number (US, Caribbean and toll-free +1 numbers included); not checked."
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the request was answered."
          },
          "listDate": {
            "type": "string",
            "format": "date",
            "description": "The day the account's file was downloaded from the DNCL operator."
          },
          "validUntil": {
            "type": "string",
            "format": "date-time",
            "description": "00:00 UTC, 31 days after `listDate`. After it the file answers nothing."
          },
          "areaCode": {
            "type": "string",
            "description": "The three-digit area code, on `not_covered` only."
          }
        }
      },
      "DnclResponse": {
        "type": "object",
        "required": [
          "requestId",
          "results"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "description": "The request id, also in the `X-Request-Id` header."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnclResult"
            }
          }
        }
      },
      "DnclListInfo": {
        "oneOf": [
          {
            "type": "object",
            "title": "Linked",
            "required": [
              "linked",
              "listDate",
              "validUntil",
              "areaCodes",
              "subscriptionExpiresAt"
            ],
            "properties": {
              "linked": {
                "type": "boolean",
                "const": true
              },
              "listDate": {
                "type": "string",
                "format": "date",
                "description": "The day the file in use was downloaded from the operator."
              },
              "validUntil": {
                "type": "string",
                "format": "date-time",
                "description": "00:00 UTC, 31 days after `listDate`."
              },
              "areaCodes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Area codes the file holds."
              },
              "subscriptionExpiresAt": {
                "type": "string",
                "format": "date-time",
                "description": "When the account's DNCL subscription ends."
              }
            }
          },
          {
            "type": "object",
            "title": "Not linked",
            "required": [
              "linked"
            ],
            "properties": {
              "linked": {
                "type": "boolean",
                "const": false
              }
            }
          }
        ]
      },
      "Scope": {
        "type": "string",
        "enum": [
          "screen",
          "suppress",
          "consents",
          "usage",
          "dncr",
          "dead_number",
          "keys"
        ]
      },
      "RotateRequest": {
        "type": "object",
        "description": "Optional body. An empty body keeps the default.",
        "properties": {
          "revokeOld": {
            "type": "boolean",
            "default": true,
            "description": "Revoke the calling key at once (default). Send false to keep it alive for a cut-over, then rotate with it again to retire it."
          }
        }
      },
      "RotateResponse": {
        "type": "object",
        "required": [
          "ok",
          "token",
          "tokenPrefix",
          "last4",
          "revokedOld",
          "note"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "token": {
            "type": "string",
            "description": "The new full token. Shown only in this response; store it now."
          },
          "tokenPrefix": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "revokedOld": {
            "type": "boolean",
            "description": "Whether the old key was revoked. False when `revokeOld` was false, or when the revoke failed (the `note` says which)."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ListEntry": {
        "type": "object",
        "required": [
          "number"
        ],
        "properties": {
          "number": {
            "type": [
              "string",
              "number"
            ],
            "description": "The phone number. A UK number in national or international form."
          },
          "reason": {
            "type": [
              "string",
              "number"
            ],
            "description": "Why the number is on the list (for consents, the consent evidence). Cut to 500 characters."
          },
          "datetime": {
            "type": [
              "string",
              "number"
            ],
            "description": "When the opt-out or consent happened: ISO 8601, `yyyy-mm-dd`, or UK day-first `dd/mm/yyyy[ hh:mm[:ss]]`. No zone means UK time. Dates before 2000 or more than 5 minutes in the future are rejected. Without it, the date is when the number was added."
          }
        }
      },
      "ListAddRequest": {
        "type": "object",
        "description": "One of `entries` or `numbers`. When several are present, `text` wins, then `entries`, then `numbers`.",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListEntry"
            },
            "description": "Structured rows, each with an optional reason and datetime."
          },
          "numbers": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": [
                    "string",
                    "number"
                  ]
                }
              },
              {
                "type": "string",
                "description": "One string of numbers separated by commas or new lines."
              }
            ],
            "description": "Bare numbers. Blank entries are skipped."
          },
          "text": {
            "type": "string",
            "description": "Pasted lines or CSV, parsed as a `text/csv` body would be."
          },
          "note": {
            "type": "string",
            "description": "Default reason for rows that have none."
          }
        },
        "anyOf": [
          {
            "required": [
              "entries"
            ]
          },
          {
            "required": [
              "numbers"
            ]
          },
          {
            "required": [
              "text"
            ]
          }
        ]
      },
      "ListRow": {
        "type": "object",
        "required": [
          "phoneNumber",
          "note",
          "createdAt",
          "occurredAt"
        ],
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "E.164."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason stored with the number, or null."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the number was added."
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the opt-out or consent happened; `createdAt` when none was given."
          }
        }
      },
      "SuppressionList": {
        "type": "object",
        "required": [
          "count",
          "suppressions"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Numbers on the list."
          },
          "suppressions": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ListRow"
            },
            "description": "The 100 most recent entries."
          }
        }
      },
      "ConsentList": {
        "type": "object",
        "required": [
          "count",
          "consents"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Numbers on the list."
          },
          "consents": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ListRow"
            },
            "description": "The 100 most recent entries."
          }
        }
      },
      "InvalidRow": {
        "type": "object",
        "required": [
          "line",
          "value",
          "reason"
        ],
        "properties": {
          "line": {
            "type": "integer",
            "description": "1-based line of the CSV body, or position in the `entries` or `numbers` array."
          },
          "value": {
            "type": "string",
            "description": "The rejected value, cut to 40 characters."
          },
          "reason": {
            "type": "string",
            "examples": [
              "not a valid UK phone number",
              "datetime not recognised (use ISO 8601 or dd/mm/yyyy hh:mm)",
              "datetime is in the future",
              "datetime is before 2000"
            ]
          }
        }
      },
      "ListImportResponse": {
        "type": "object",
        "required": [
          "ok",
          "added",
          "alreadyListed",
          "invalid",
          "invalidRows",
          "invalidCount",
          "total"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "added": {
            "type": "integer"
          },
          "alreadyListed": {
            "type": "integer",
            "description": "Valid numbers that were already on the list."
          },
          "invalid": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string"
            },
            "description": "Up to 50 rejected values, as strings."
          },
          "invalidRows": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/InvalidRow"
            },
            "description": "The line and reason for each value in `invalid`."
          },
          "invalidCount": {
            "type": "integer",
            "description": "Every rejected row, including those past the first 50."
          },
          "total": {
            "type": "integer",
            "description": "Numbers on the list after the import."
          }
        }
      },
      "ListRemoveRequest": {
        "type": "object",
        "required": [
          "number"
        ],
        "properties": {
          "number": {
            "type": "string",
            "description": "The UK number to remove."
          },
          "note": {
            "type": "string",
            "description": "Optional: why it came off the list."
          }
        }
      },
      "ListRemoveResponse": {
        "type": "object",
        "required": [
          "ok",
          "removed"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "removed": {
            "type": "boolean",
            "description": "False when the number was not on the list."
          }
        }
      },
      "DeadNumberRequest": {
        "type": "object",
        "required": [
          "numbers"
        ],
        "properties": {
          "numbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "Up to 500 numbers in international format. A number without a country code is read as UK. Duplicates are looked up and charged once."
          }
        }
      },
      "DeadNumberStatus": {
        "type": "string",
        "enum": [
          "live",
          "switched_off",
          "dead",
          "undetermined",
          "not_mobile",
          "invalid"
        ],
        "description": "`live`: a SIM holds the number and the network can reach it. `switched_off`: in service, but the phone is off or out of coverage. `dead`: no SIM holds the number. `undetermined`: no live status came back; treat as not checked. `not_mobile`: a landline or other non-mobile. `invalid`: not a valid number, or in a fictional range; never looked up and free."
      },
      "DeadNumberResult": {
        "type": "object",
        "required": [
          "input",
          "e164",
          "status",
          "valid",
          "network",
          "ported",
          "country",
          "charged",
          "checkedAt"
        ],
        "properties": {
          "input": {
            "type": "string",
            "description": "The number as sent, cut to 40 characters."
          },
          "e164": {
            "type": [
              "string",
              "null"
            ],
            "description": "E.164 form, or null for an invalid number."
          },
          "status": {
            "$ref": "#/components/schemas/DeadNumberStatus"
          },
          "valid": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is a real, assigned number. Null when nothing came back to tell. Says nothing about whether a non-mobile is in service."
          },
          "network": {
            "type": [
              "string",
              "null"
            ],
            "description": "The network now serving the number, when the provider reports it."
          },
          "ported": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the number has moved network, when the provider reports it."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO country code of a valid number, or null."
          },
          "charged": {
            "type": "boolean",
            "description": "Whether this lookup cost checks."
          },
          "checkedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the network answered; null when the number was not looked up."
          }
        }
      },
      "DeadNumberResponse": {
        "type": "object",
        "required": [
          "results",
          "checksCharged",
          "checksRemaining"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeadNumberResult"
            }
          },
          "checksCharged": {
            "type": "integer",
            "description": "Checks charged for the request."
          },
          "checksRemaining": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The balance after the request, or null when it could not be read."
          }
        }
      },
      "DeadNumberBalance": {
        "type": "object",
        "required": [
          "checksRemaining"
        ],
        "properties": {
          "checksRemaining": {
            "type": "integer"
          }
        }
      },
      "DncrRequest": {
        "type": "object",
        "description": "Send `phoneNumbers` (an array) or `phone` (one number). When both are present, `phoneNumbers` is used.",
        "properties": {
          "phoneNumbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "Up to 500 Australian numbers, international or national format."
          },
          "phone": {
            "type": "string",
            "description": "A single number, used when `phoneNumbers` is absent."
          }
        },
        "anyOf": [
          {
            "required": [
              "phoneNumbers"
            ]
          },
          {
            "required": [
              "phone"
            ]
          }
        ]
      },
      "DncrResult": {
        "type": "object",
        "required": [
          "phoneNumber",
          "status",
          "washedAt",
          "validUntil",
          "washRef"
        ],
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "E.164, or the input cut to 40 characters when it is not a valid Australian number."
          },
          "status": {
            "type": "string",
            "enum": [
              "on_register",
              "not_on_register",
              "invalid",
              "unknown"
            ],
            "description": "`unknown`: no answer from the register, not charged. Treat `on_register` as do not call."
          },
          "reason": {
            "type": "string",
            "const": "unallocated",
            "description": "Present on `invalid` when the number is outside every range ACMA has allocated to a carrier. Not sent and not charged."
          },
          "washedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "30 days after `washedAt`: the last moment the wash may be relied on."
          },
          "washRef": {
            "type": [
              "string",
              "null"
            ],
            "description": "TPSClear's reference for the wash with ACMA."
          }
        }
      },
      "DncrResponse": {
        "type": "object",
        "required": [
          "results",
          "washesCharged"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DncrResult"
            }
          },
          "washesCharged": {
            "type": "integer",
            "description": "Numbers the register answered for, each one wash."
          }
        }
      },
      "DncrBalance": {
        "type": "object",
        "required": [
          "washesRemaining"
        ],
        "properties": {
          "washesRemaining": {
            "type": "integer"
          }
        }
      },
      "JobRequest": {
        "type": "object",
        "required": [
          "region",
          "phoneNumbers"
        ],
        "properties": {
          "region": {
            "type": "string",
            "enum": [
              "au"
            ],
            "description": "`au`. `uk` returns 400 `region_not_supported` for now."
          },
          "phoneNumbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100000,
            "items": {
              "type": "string"
            },
            "description": "Up to 100,000 Australian numbers, international or national format."
          },
          "campaignRef": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own label for the job."
          }
        }
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "paused",
          "done",
          "failed",
          "cancelled"
        ],
        "description": "`queued`: waiting for its first chunk. `running`: chunks are being washed. `paused`: stopped for the reason in `pausedReason`; it carries on by itself when the reason clears. `done`: every chunk is washed and the results file is ready. `failed`: stopped on an error; chunks not washed were never charged. `cancelled`: cancelled with DELETE; chunks not started were never charged."
      },
      "JobSubmitted": {
        "type": "object",
        "required": [
          "id",
          "status",
          "submitted",
          "distinct",
          "invalid",
          "unallocated",
          "estimatedWashes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus",
            "description": "`queued` on a new job; an idempotent replay gives the job's current status."
          },
          "submitted": {
            "type": "integer",
            "description": "Entries sent."
          },
          "distinct": {
            "type": "integer",
            "description": "Distinct washable numbers."
          },
          "invalid": {
            "type": "integer",
            "description": "Entries that are not an Australian number. Not washed or charged."
          },
          "unallocated": {
            "type": "integer",
            "description": "Numbers in a range no carrier holds. Not washed or charged."
          },
          "estimatedWashes": {
            "type": "integer",
            "description": "Washes the job will use at most: one per distinct number."
          }
        }
      },
      "Job": {
        "type": "object",
        "required": [
          "id",
          "region",
          "status",
          "pausedReason",
          "campaignRef",
          "submitted",
          "distinct",
          "washed",
          "onRegister",
          "notOnRegister",
          "invalid",
          "unknown",
          "washesCharged",
          "refunded",
          "createdAt",
          "finishedAt",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "region": {
            "type": "string",
            "enum": [
              "au"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "pausedReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "credits",
              "daily_cap",
              "register_balance",
              "register_network",
              "register_refused",
              null
            ],
            "description": "Set only while `paused`. `credits`: the Australian balance ran out; carries on after a pack is added. `daily_cap`: the account's daily limit; carries on after 00:00 UTC. `register_balance`: the register refused washes on TPSClear's subscription for want of balance; carries on once TPSClear tops it up. `register_network`: the register stopped answering three times on one chunk; tries again after an hour. `register_refused`: the register refused TPSClear's washes for another reason; tries again after an hour."
          },
          "campaignRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "submitted": {
            "type": "integer",
            "description": "Entries sent."
          },
          "distinct": {
            "type": "integer",
            "description": "Distinct washable numbers."
          },
          "washed": {
            "type": "integer",
            "description": "Numbers the register has answered for so far."
          },
          "onRegister": {
            "type": "integer",
            "description": "Numbers on the register."
          },
          "notOnRegister": {
            "type": "integer",
            "description": "Numbers not on the register."
          },
          "invalid": {
            "type": "integer",
            "description": "Invalid entries, unallocated numbers and numbers the register answered as invalid."
          },
          "unknown": {
            "type": "integer",
            "description": "Numbers the register gave no answer for. Refunded."
          },
          "washesCharged": {
            "type": "integer",
            "description": "Washes charged so far."
          },
          "refunded": {
            "type": "integer",
            "description": "Washes refunded so far."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "The job record and its results are kept until this time: 24 months after `createdAt`."
          }
        }
      },
      "JobResultsPage": {
        "type": "object",
        "required": [
          "results",
          "nextCursor"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DncrResult"
            },
            "description": "The chunk's results. `reason` is never set here: unallocated entries are counts on the job."
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor for the next page, or null after the last page. An empty `results` does not mark the end."
          },
          "pending": {
            "type": "boolean",
            "const": true,
            "description": "Present when the chunk is not washed yet; `nextCursor` is then this page's cursor."
          }
        }
      },
      "UsDncResponse": {
        "type": "object",
        "required": [
          "requestId",
          "covers",
          "results"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "description": "The request id, also in the `X-Request-Id` header."
          },
          "covers": {
            "type": "string",
            "enum": [
              "federal"
            ],
            "description": "The list that answered. A number not on it may still be on a state list."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsDncResult"
            }
          }
        }
      },
      "UsDncResult": {
        "type": "object",
        "required": [
          "phoneNumber",
          "status"
        ],
        "description": "One entry per number sent, in the order sent. `on_list` and `not_on_list` carry `checkedAt`, `listDate` and `validUntil`; `not_covered` carries `areaCode` and no dates; `invalid` carries neither.",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "E.164, or the input cut to 40 characters when it is not a valid US number."
          },
          "status": {
            "type": "string",
            "enum": [
              "on_list",
              "not_on_list",
              "not_covered",
              "invalid"
            ],
            "description": "`on_list`: on the account's National Do Not Call Registry file. `not_on_list`: not on the federal file; state lists are not screened. `not_covered`: the area code is not in the account's SAN, so it was not checked; never a clear result. `invalid`: not a valid US number (Canadian, Caribbean and toll-free +1 numbers included); not checked."
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the request was answered."
          },
          "listDate": {
            "type": "string",
            "format": "date",
            "description": "The day the account's file was downloaded from the National Do Not Call Registry."
          },
          "validUntil": {
            "type": "string",
            "format": "date-time",
            "description": "00:00 UTC, 31 days after `listDate`. After it the file answers nothing."
          },
          "areaCode": {
            "type": "string",
            "description": "The three-digit area code, on `not_covered` only."
          }
        }
      },
      "UsDncRequest": {
        "type": "object",
        "description": "Send `phoneNumbers` (an array) or `phone` (one number). When both are present, `phoneNumbers` is used.",
        "properties": {
          "phoneNumbers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "Up to 500 numbers. A number with no country code is read as a US number. Duplicates are checked once."
          },
          "phone": {
            "type": "string",
            "description": "A single number, used when `phoneNumbers` is absent."
          }
        },
        "anyOf": [
          {
            "required": [
              "phoneNumbers"
            ]
          },
          {
            "required": [
              "phone"
            ]
          }
        ]
      },
      "UsDncListInfo": {
        "oneOf": [
          {
            "type": "object",
            "title": "Linked",
            "required": [
              "linked",
              "listDate",
              "validUntil",
              "areaCodes",
              "subscriptionExpiresAt"
            ],
            "properties": {
              "linked": {
                "type": "boolean",
                "const": true
              },
              "listDate": {
                "type": "string",
                "format": "date",
                "description": "The day the file in use was downloaded from the registry."
              },
              "validUntil": {
                "type": "string",
                "format": "date-time",
                "description": "00:00 UTC, 31 days after `listDate`."
              },
              "areaCodes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Area codes the file holds."
              },
              "subscriptionExpiresAt": {
                "type": "string",
                "format": "date-time",
                "description": "When the account's National Do Not Call Registry subscription ends."
              }
            }
          },
          {
            "type": "object",
            "title": "Not linked",
            "required": [
              "linked"
            ],
            "properties": {
              "linked": {
                "type": "boolean",
                "const": false
              }
            }
          }
        ]
      }
    }
  }
}
