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

# Create document

> Create a regulatory document record after uploading the file. Use the upload-url endpoint first to get an upload URL.



## OpenAPI

````yaml /openapi.json post /v1/documents
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/documents:
    post:
      tags:
        - Regulatory
      summary: Create document
      description: >-
        Create a regulatory document record after uploading the file. Use the
        upload-url endpoint first to get an upload URL.
      operationId: createRegulatoryDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegulatoryDocumentCreateRequest'
            example:
              name: Passport Scan
              documentType: passport
              storageId: kg2abc123...
              mimeType: image/jpeg
              fileSize: 102400
      responses:
        '201':
          description: Document created and uploaded to verification provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegulatoryDocumentResponse'
        '400':
          description: Invalid request or upload failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    RegulatoryDocumentCreateRequest:
      type: object
      required:
        - name
        - documentType
        - storageId
        - mimeType
        - fileSize
      properties:
        name:
          type: string
          maxLength: 200
        documentType:
          $ref: '#/components/schemas/RegulatoryDocumentType'
        storageId:
          type: string
          description: Storage ID from the upload-url endpoint.
        mimeType:
          type: string
        fileSize:
          type: integer
    RegulatoryDocumentResponse:
      type: object
      required:
        - document
      properties:
        document:
          $ref: '#/components/schemas/RegulatoryDocument'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    RegulatoryDocumentType:
      type: string
      enum:
        - passport
        - national_id
        - drivers_license
        - utility_bill
        - tax_id
        - business_registration
        - proof_of_address
        - other
    RegulatoryDocument:
      type: object
      description: A regulatory document for phone number requirements.
      required:
        - id
        - name
        - documentType
        - status
        - createdAt
      properties:
        id:
          type: string
        name:
          type: string
        documentType:
          $ref: '#/components/schemas/RegulatoryDocumentType'
        mimeType:
          type: string
        fileSize:
          type: integer
        status:
          $ref: '#/components/schemas/RegulatoryDocumentStatus'
        rejectionReason:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    RegulatoryDocumentStatus:
      type: string
      enum:
        - pending
        - uploaded
        - verified
        - rejected
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````