> ## 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 data export

> Create a new data export job. The export will be processed asynchronously and the download URL will be available when status is 'completed'. Export links expire after 24 hours.



## OpenAPI

````yaml /openapi.json post /v1/exports
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/exports:
    post:
      tags:
        - Data Exports
      summary: Create data export
      description: >-
        Create a new data export job. The export will be processed
        asynchronously and the download URL will be available when status is
        'completed'. Export links expire after 24 hours.
      operationId: createExport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExportRequest'
            example:
              dataTypes:
                - messages
                - conversations
              dateFrom: '2024-01-01T00:00:00Z'
              dateTo: '2024-12-31T23:59:59Z'
      responses:
        '202':
          description: Export job created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataExportResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateExportRequest:
      type: object
      required:
        - dataTypes
      properties:
        dataTypes:
          type: array
          description: List of data types to include in the export.
          minItems: 1
          items:
            $ref: '#/components/schemas/DataExportDataType'
        dateFrom:
          type: string
          format: date-time
          description: Start date for data to export (inclusive).
        dateTo:
          type: string
          format: date-time
          description: End date for data to export (inclusive).
    DataExportResponse:
      type: object
      required:
        - export
      properties:
        export:
          $ref: '#/components/schemas/DataExport'
    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
    DataExportDataType:
      type: string
      description: Types of data that can be exported.
      enum:
        - messages
        - conversations
        - webhookDeliveries
        - agentExecutions
        - activities
    DataExport:
      type: object
      required:
        - id
        - status
        - dataTypes
        - expiresAt
        - createdAt
      properties:
        id:
          type: string
          example: exp_abc123
        status:
          $ref: '#/components/schemas/DataExportStatus'
        dataTypes:
          type: array
          items:
            $ref: '#/components/schemas/DataExportDataType'
        dateFrom:
          type: string
          format: date-time
          nullable: true
        dateTo:
          type: string
          format: date-time
          nullable: true
        downloadUrl:
          type: string
          format: uri
          nullable: true
          description: >-
            URL to download the export file. Only available when status is
            'completed'.
        fileSize:
          type: integer
          nullable: true
          description: Size of the export file in bytes.
        errorMessage:
          type: string
          nullable: true
          description: Error message if the export failed.
        expiresAt:
          type: string
          format: date-time
          description: When the export download link expires (24 hours after creation).
        completedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
    DataExportStatus:
      type: string
      description: Status of a data export job.
      enum:
        - pending
        - processing
        - completed
        - failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````