> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataspike.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Verification

> Verify corporate documents: company formation, ownership, tax, bank and PCI compliance documents.

Verify corporate documents across several categories: company formation and ownership, tax verification, bank verification, and PCI DSS compliance. The API checks that each document matches its declared type and extracts the relevant information; for ownership documents it also validates shareholder details against user-provided data.

## Supported document types

Each document type has two identifiers: the snake\_case value used as `document_type` when [uploading the file](#step-2-upload-a-document), and the PascalCase value used in the [verification request](#step-3-submit-verification-request).

### Company documents

| Verification type | Upload type | Description |
| - | - | - |
| `KybCertificateOfIncorporation` | `kyb_certificate_of_incorporation` | Certificate of incorporation, articles of association, state registration, or similar formation documents |
| `KybOwnershipDocument` | `kyb_ownership_document` | Shareholder certificate, ownership registry extract, or similar documents listing beneficial owners |
| `KybOperatingAgreement` | `kyb_operating_agreement` | LLC operating agreement or similar company governance agreement |

### Tax verification documents

| Verification type | Upload type | Description |
| - | - | - |
| `KybW9Form` | `kyb_w9_form` | IRS Form W-9 (Request for Taxpayer Identification Number and Certification) |
| `KybEinConfirmationLetter` | `kyb_ein_confirmation_letter` | IRS EIN confirmation letter (CP 575) or EIN verification letter (147C) |
| `KybW8BenForm` | `kyb_w8ben_form` | IRS Form W-8BEN — foreign status certificate for individuals |
| `KybW8BenEForm` | `kyb_w8ben_e_form` | IRS Form W-8BEN-E — foreign status certificate for entities |
| `KybItinAssignmentLetter` | `kyb_itin_assignment_letter` | IRS ITIN assignment letter (CP 565) |
| `KybStateTaxRegistrationCertificate` | `kyb_state_tax_registration_certificate` | State tax registration certificate / sales tax permit |
| `KybFederalTaxReturn` | `kyb_federal_tax_return` | US federal business income tax return (e.g. Form 1120, 1065) |

### Bank verification documents

| Verification type | Upload type | Description |
| - | - | - |
| `KybBankStatement` | `kyb_bank_statement` | Bank statement for a business account |
| `KybBankVerificationLetter` | `kyb_bank_verification_letter` | Bank verification / confirmation letter |
| `KybDirectDepositForm` | `kyb_direct_deposit_form` | Direct deposit authorization form |
| `KybAchForm` | `kyb_ach_form` | ACH authorization form |
| `KybBankReferenceLetter` | `kyb_bank_reference_letter` | Bank reference letter |

### PCI verification documents

| Verification type | Upload type | Description |
| - | - | - |
| `KybSaqA` | `kyb_saq_a` | PCI DSS Self-Assessment Questionnaire A |
| `KybSaqAEp` | `kyb_saq_a_ep` | PCI DSS Self-Assessment Questionnaire A-EP |
| `KybSaqD` | `kyb_saq_d` | PCI DSS Self-Assessment Questionnaire D |

## Step 1: Create an applicant

Create an applicant to associate the verification with.

> [tab] Curl
>
> ```bash theme={null}
> export API_KEY=<YOUR_API_KEY>
>
> curl -H "ds-api-token: $API_KEY" \
>   -H "Content-Type: application/json" \
>   -X POST "https://api.dataspike.io/api/v3/applicants" \
>   --data '{"external_id": "company-123", "applicant_type": "Organization"}'
> ```
>
> Response:
>
> ```json theme={null}
> {
>   "id": "01827ed4-c928-7a3c-9a30-7ab7cc169d11"
> }
> ```

> [tab] Python
>
> ```python theme={null}
> import requests
>
> API_KEY = "<YOUR_API_KEY>"
> BASE = "https://api.dataspike.io"
> HEADERS = {"ds-api-token": API_KEY, "Content-Type": "application/json"}
>
> resp = requests.post(f"{BASE}/api/v3/applicants", headers=HEADERS, json={"external_id": "company-123", "applicant_type": "Organization"})
> applicant_id = resp.json()["id"]
> ```

## Step 2: Upload a document

Upload the corporate document using the file upload endpoint. Note the returned `document_id` — you will pass it to the verification request.

> [tab] Curl
>
> ```bash theme={null}
> APPLICANT_ID="01827ed4-c928-7a3c-9a30-7ab7cc169d11"
>
> curl -H "ds-api-token: $API_KEY" \
>   -X POST "https://api.dataspike.io/api/v3/upload/$APPLICANT_ID" \
>   -F "file=@certificate_of_incorporation.pdf" \
>   -F "document_type=kyb_certificate_of_incorporation"
> ```
>
> Response:
>
> ```json theme={null}
> {
>   "document_id": "019c9c39-0b8a-7aa4-a5c0-abc123def456"
> }
> ```

> [tab] Python
>
> ```python theme={null}
> with open("certificate_of_incorporation.pdf", "rb") as f:
>     resp = requests.post(
>         f"{BASE}/api/v3/upload/{applicant_id}",
>         headers={"ds-api-token": API_KEY},
>         files={"file": f},
>         data={"document_type": "kyb_certificate_of_incorporation"},
>     )
> document_id = resp.json()["document_id"]
> ```

## Step 3: Submit verification request

Submit the document for KYB verification. Optionally provide shareholder data to validate against extracted information from the document.

> [tab] Curl
>
> ```bash theme={null}
> curl -H "ds-api-token: $API_KEY" \
>   -H "Content-Type: application/json" \
>   -X POST "https://api.dataspike.io/api/v4/kyb/$APPLICANT_ID/verify-document" \
>   --data '{
>     "documents": [
>       {
>         "doc_path": "019c9c39-0b8a-7aa4-a5c0-abc123def456",
>         "document_type": "KybCertificateOfIncorporation"
>       }
>     ],
>     "user_provided_data": {
>       "shareholders": [
>         {
>           "name": "John Doe",
>           "first_name": "John",
>           "last_name": "Doe",
>           "nationality": "US"
>         }
>       ]
>     }
>   }'
> ```
>
> Response (HTTP 202):
>
> ```json theme={null}
> {
>   "request_id": "019c9e79-8f48-73e1-86e3-317a95f43178",
>   "status": "initial"
> }
> ```

> [tab] Python
>
> ```python theme={null}
> resp = requests.post(
>     f"{BASE}/api/v4/kyb/{applicant_id}/verify-document",
>     headers=HEADERS,
>     json={
>         "documents": [
>             {"doc_path": document_id, "document_type": "KybCertificateOfIncorporation"}
>         ],
>         "user_provided_data": {
>             "shareholders": [
>                 {"name": "John Doe", "first_name": "John", "last_name": "Doe", "nationality": "US"}
>             ]
>         },
>     },
> )
> request_id = resp.json()["request_id"]
> ```

### Request body

| Field | Type | Required | Description |
| - | - | - | - |
| `documents` | array | Yes | List of documents to verify |
| `documents[].doc_path` | string | Yes | Document ID returned from the upload endpoint |
| `documents[].document_type` | string | Yes | A PascalCase verification type from [Supported document types](#supported-document-types) (e.g. `KybCertificateOfIncorporation`, `KybW9Form`) |
| `user_provided_data` | object | Conditional | Shareholder data to validate against the document. Required when the request includes `KybCertificateOfIncorporation` or `KybOwnershipDocument`; not used for other document types |
| `user_provided_data.shareholders` | array | Conditional | List of shareholders to verify |
| `user_provided_data.shareholders[].name` | string | No | Full name |
| `user_provided_data.shareholders[].first_name` | string | No | First name |
| `user_provided_data.shareholders[].last_name` | string | No | Last name |
| `user_provided_data.shareholders[].nationality` | string | No | Country code (e.g. `US`) |

## Step 4: Poll for the result

The verification takes approximately 15-30 seconds. Poll the result endpoint until the status changes from `initial`.

> [tab] Curl
>
> ```bash theme={null}
> REQUEST_ID="019c9e79-8f48-73e1-86e3-317a95f43178"
>
> curl -H "ds-api-token: $API_KEY" \
>   "https://api.dataspike.io/api/v4/kyb/result/$REQUEST_ID"
> ```
>
> Example response (verified):
>
> ```json theme={null}
> {
>   "request_id": "019c9e79-8f48-73e1-86e3-317a95f43178",
>   "status": "verified",
>   "verification_type": "document_verification",
>   "response_data": {
>     "result": {
>       "status": "VERIFIED",
>       "document_results": [
>         {
>           "status": "VERIFIED",
>           "document": {
>             "document_type": "KybCertificateOfIncorporation"
>           },
>           "extracted_shareholders": [
>             {
>               "name": "John Doe",
>               "first_name": "John",
>               "last_name": "Doe",
>               "country": "US"
>             }
>           ]
>         }
>       ],
>       "extracted_company_info": {
>         "company_name": "Acme Corp.",
>         "jurisdiction": "US",
>         "address": "123 Main St, Dover, DE 19901"
>       }
>     }
>   },
>   "created_at": "2026-02-27T09:41:32.629118Z",
>   "completed_at": "2026-02-27T09:42:02.004789Z"
> }
> ```

> [tab] Python
>
> ```python theme={null}
> import time
>
> while True:
>     resp = requests.get(f"{BASE}/api/v4/kyb/result/{request_id}", headers=HEADERS)
>     result = resp.json()
>     if result["status"] != "initial":
>         break
>     time.sleep(5)
>
> print(result)
> ```

## Extracted document information

For the tax, bank, company and PCI document types, each entry in `response_data.result.document_results[]` carries a family-specific object with the fields extracted from the document. Empty fields are omitted from the response.

| Field | Document types | Example fields |
| - | - | - |
| `extracted_tax_info` | W-9, EIN letter, W-8BEN, W-8BEN-E, ITIN letter, state tax registration, federal tax return | `form_variant`, `business_name`, `tax_id`, `tax_id_type`, `tax_classification`, `address`, `tax_year`, `issue_date`, `signature_date`, `issuer`, `country`, `date_of_birth`, `fatca_status`, `giin` |
| `extracted_bank_info` | Bank statement, verification letter, direct deposit, ACH form, reference letter | `bank_name`, `account_holder_name`, `account_holder_address`, `account_number`, `routing_number`, `account_type`, `statement_period_start`, `statement_period_end`, `issue_date`, `closing_balance` |
| `extracted_company_doc_info` | Operating agreement | `company_name`, `jurisdiction`, `registration_number`, `company_type`, `effective_date`, `address`, `members` |
| `extracted_pci_info` | SAQ A, SAQ A-EP, SAQ D | `saq_type`, `merchant_name`, `assessment_date`, `signature_date`, `compliance_status`, `signatory_name`, `qsa_name` |

Example `document_results[]` entry for a verified W-9:

```json theme={null}
{
  "status": "VERIFIED",
  "document": {
    "doc_path": "019c9c39-0b8a-7aa4-a5c0-abc123def456",
    "document_type": "KybW9Form"
  },
  "extracted_tax_info": {
    "form_variant": "W-9",
    "business_name": "Acme Web Services LLC",
    "tax_id": "82-1234567",
    "tax_id_type": "EIN",
    "tax_classification": "Limited liability company (C corporation)",
    "address": "1201 Market St, Suite 400, Wilmington, DE 19801",
    "signature_date": "2026-05-14"
  }
}
```

## Verification errors

When a document verification returns `not_verified`, the `response_data.result.document_results[].errors` array contains one or more of the following error codes:

| Error code | Description |
| - | - |
| `SHAREHOLDER_NAME_NOT_FOUND` | A provided shareholder name was not found in the document |
| `SHAREHOLDER_NAME_MISMATCH` | A shareholder name was found but does not match the provided data |
| `SHAREHOLDER_NATIONALITY_MISMATCH` | Shareholder nationality does not match |
| `DOCUMENT_UNREADABLE` | The document could not be parsed or read |
| `DOCUMENT_TYPE_NOT_SUPPORTED` | The document type is not supported |
| `DOCUMENTS_FROM_DIFFERENT_ENTITIES` | Multiple documents appear to belong to different companies |
| `IRRELEVANT_DOCUMENT_PROVIDED` | The provided document does not match the declared document type or is not relevant for KYB verification |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.