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

# Export messages

> Streams matching SMS and MMS messages as newline-delimited JSON (NDJSON), one message per line, for bulk export.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml get /v3/messages/all
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v3/messages/all:
    get:
      tags:
        - SMS and MMS
      summary: Export messages
      description: >-
        Streams matching SMS and MMS messages as newline-delimited JSON
        (NDJSON), one message per line, for bulk export.
      operationId: sms_and_mms_messages_list_all
      parameters:
        - name: sent_after
          in: query
          description: >-
            Returns messages sent on or after this timestamp, in
            `YYYY-MM-DDTHH:MM:SS` format.
          style: form
          explode: true
          schema:
            type: string
            example: '2023-04-10T00:00:00'
        - name: sent_before
          in: query
          description: >-
            Returns messages sent on or before this timestamp, in
            `YYYY-MM-DDTHH:MM:SS` format.
          style: form
          explode: true
          schema:
            type: string
            example: '2023-04-13T23:59:59'
        - name: type
          in: query
          description: >-
            Filters messages by direction. One of `inbound` (messages received
            by the account) or `outbound` (messages sent by the account).
          required: true
          style: form
          explode: true
          schema:
            type: string
            example: outbound
        - name: from
          in: query
          description: >-
            Filters by message sender. For `outbound` messages, the Sender ID
            used to send the message; for `inbound` messages, the originating
            phone number.
          style: form
          explode: true
          schema:
            type: string
            example: '15072429497'
        - name: to
          in: query
          description: >-
            Filters by message recipient. For `outbound` messages, the
            destination phone number; for `inbound` messages, the SMS-enabled
            number that received the message.
          style: form
          explode: true
          schema:
            type: string
            example: '16419252149'
        - name: status
          in: query
          description: >-
            Filters messages by delivery status. Accepts a
            `MessageDeliveryStatus` value.
          style: form
          explode: true
          schema:
            allOf:
              - $ref: '#/components/schemas/MessageDeliveryStatus'
        - name: tag
          in: query
          description: Filters messages by `tag`. Supported for outbound messages only.
          style: form
          explode: true
          schema:
            type: string
            example: campaignX
        - name: message_type
          in: query
          description: >-
            Filters messages by type. One of `sms` (text message) or `mms`
            (multimedia message).
          style: form
          explode: true
          schema:
            type: string
            enum:
              - sms
              - mms
            example: sms
      responses:
        '200':
          description: Returns an NDJSON stream of messages, one per line.
          headers:
            Content-Type:
              description: Media type of the response body. Always `application/x-ndjson`.
              schema:
                type: string
                example: application/x-ndjson
            Last-Modified:
              description: Timestamp when the exported data was last modified.
              schema:
                type: string
                example: '0'
            ETag:
              description: Entity tag identifying the version of the exported data.
              schema:
                type: string
                example: '0'
          content:
            application/x-ndjson:
              schema:
                type: string
                description: Newline-delimited JSON stream of messages.
                example: >
                  {"message_id":"3a525ca2-6909-4c72-9399-905adf7f3a74","message_type":"sms","from":"15072429497","to":"16419252149","direction":"outbound","status":"delivered"}

                  {"message_id":"4b636ca3-7900-5d83-a400-016bf8f8f4b85","message_type":"sms","from":"15072429497","to":"16419252150","direction":"outbound","status":"delivered"}
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - messages:read
components:
  schemas:
    MessageDeliveryStatus:
      title: MessageDeliveryStatus
      enum:
        - accepted
        - pending
        - sent
        - delivered
        - undelivered
        - expired
        - rejected
        - dlr_expired
      type: string
      description: >-
        Current delivery status of the message. One of:


        - `accepted` — the message was accepted by the platform for sending.

        - `pending` — the message is queued and awaiting a carrier response.

        - `sent` — the message was handed to the carrier.

        - `delivered` — the carrier confirmed delivery to the handset.

        - `undelivered` — the carrier reported that delivery failed.

        - `expired` — the validity period elapsed before the message was sent.

        - `rejected` — the message was rejected before sending.

        - `dlr_expired` — no delivery receipt arrived from the carrier within
        the expected window.
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
  responses:
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````