Home
Home
  1. Documents
  • Getting started
  • Authentication
  • Webhooks
  • Embeddable widgets
    • Overview
    • Document upload widget
      • Designing an upload flow
  • Guides
    • Verifying a new business
    • Verifying bank accounts
    • Uploading documents
    • Country-specific fields
    • 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 a submission pre-flight check
      • Run business verification
      • Get submission checks
      • Delete submission
      • List submissions
    • Documents
      • Public documents API
        • List documents (public)
        • Upload document (public)
        • Get document (public)
        • Delete document (public)
        • Download document file (public)
        • Rerun validations (public)
      • List documents
        GET
      • Upload document
        POST
      • Get document
        GET
      • Delete document
        DELETE
      • Download document file
        GET
      • Rerun validations
        PUT
    • RPC search
      • RPC search
      • Get company with ID
      • Look up company by RFC
      • Search companies by name
      • Download RPC document
    • Utilities
      • Matcher
        • Run name matching
  1. Documents

Public documents API

The Public Documents API lets browser code upload and manage a submission's documents without exposing your private API key. It provides the Documents operations using a public API key and a submission token. Requests are accepted from any origin through Cross-Origin Resource Sharing (CORS).

Authentication#

You need both credentials:
Public API key: send it in the apiKey header. Create a public key (ntpub_…) in the Niva dashboard under Settings › API Keys. A private key is rejected with 401.
Submission token: replace {submission_token} in the path with the submission's token, returned by Create new submission or Get submission. Retrieve it on your server with a private key and pass it only to the applicant who should access that submission. It expires 24 hours after issue; call Get submission for a fresh token.
For example, list the submission's documents:
Replace both placeholders with your credentials.

Endpoints#

1.
Upload document (public)
2.
List documents (public)
3.
Get document (public)
4.
Download document file (public)
5.
Rerun validations (public)
6.
Delete document (public)

Authentication errors#

401 with {"errors": ["401 Unauthorized"]}: the apiKey header is missing, invalid, or not a public key.
401 with {"errors": ["Invalid token."]}: the submission token is malformed or expired.
404 with {"errors": ["Record not found."]}: the submission belongs to another account, or the document is not available in this submission.
For a ready-made upload interface, see Document upload widget.
Previous
Documents
Next
List documents (public)