Home
Home
  1. Documents
  • Getting started
  • Authentication
  • Webhooks
  • Embeddable Widgets
    • Overview
    • Document Upload Widget
      • UI/UX Best Practices
  • Guides
    • Verifying a new business
    • Verifying bank accounts
    • Supported document types
  • API Reference
    • Submissions
      • Reports
        • List available report templates
        • Download a report
      • Create new submission
      • Get submission
      • Update submission
      • Update submission status
      • Run business verification
      • Get submission checks
      • Delete submission
    • Documents
      • Public Documents API
        • List documents
        • Upload document
        • Get document
        • Delete document
      • List documents
        GET
      • Upload document for submission
        POST
      • Get document
        GET
      • Delete document
        DELETE
      • Download document file
        GET
      • Rerun validations
        PUT
    • RPC Search
      • Get company with ID
      • Company RFC Lookup
      • Company Name Search
      • Download document
    • Utilities
      • Matcher
        • Run name matching
  1. Documents

Upload document for submission

Production
https://api.niva.co/v1
Production
https://api.niva.co/v1
POST
https://api.niva.co/v1
/submissions/{id}/documents
Once you've created a submission request, you can then upload relevant documents prior to running the verification.
You must specify the document type. Refer to the document types accepted for your country.

Document Validation#

For a better user experience, this endpoint will attempt to a basic validation of the document which can provide immediate feedback to the user. If we are unable to validate the document within the timeout window, you'll receive a webhook with the validation results.
Every document is validated for legibility and completeness, as well as validating that it is of the expected type.

Custom Validation Inputs#

During normal validations, the name on the document will be matched against the business name in the submission. But there may be cases where you would like to validate the name on the document against a different name. You can pass in a custom name using the validation_inputs parameter.
Note: Currently only name-matching validations support custom data. Name-matching is only supported for mx_address_proof, mx_bank_statement, and mx_ine document types.

Request

Authorization
Add parameter in header
apiKey
Example:
apiKey: ********************
Path Params

Query Params

Header Params

Body Params multipart/form-data

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.niva.co/v1/submissions/sub_1234567890/documents?persist_invalid=undefined' \
--header 'Accept-Language;' \
--header 'apiKey: <api-key>' \
--form 'type="mx_acta_constitutiva"' \
--form 'file=@""' \
--form 'validation_inputs[name]="\"Juan Pérez\""' \
--form 'external_id=""' \
--form 'document_name=""'

Responses

🟢201Document was successfully uploaded and validated. Basic information from the document is returned here for you to do additional validation checks.
application/json
Bodyapplication/json

Example
{
    "id": "string",
    "status": "pending",
    "validation_status": "incomplete",
    "type": "mx_acta_constitutiva",
    "file": {
        "name": "string",
        "byte_size": 0
    },
    "source": "user",
    "data": {},
    "validation_errors": [
        {
            "type": "warn",
            "error": "illegible",
            "error_message": "Document is blank",
            "display_message": "Document is not the correct type. Please upload the correct document."
        }
    ],
    "uploaded_at": "2019-08-24T14:15:22.123Z",
    "external_id": "string",
    "document_name": "string"
}
🟢202Document was successfully uploaded, but it has not been validated within the configured timeout window. Once the document is validated, you will receive a webhook with the result.
🟠400Document was uploaded successfully but was invalid.
🟠404Not Found
Previous
List documents
Next
Get document