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

# Export campaign results as CSV

The campaign must be `enriched` and its results must not have expired. Each request creates a fresh file and signed URL. Files always contain the standard DataLane column catalog, regardless of how the campaign was created.

Omit `maxContactsPerAccount` for all contacts, set a positive cap, or use `0` for account-only rows. When `hasMobilePhone` and `hasEmail` are both true, the filters use OR semantics.

See [Export results](/guides/export-results) for examples and download handling.


## OpenAPI

````yaml /openapi.json post /v1/campaigns/export
openapi: 3.1.0
info:
  title: DataLane API
  description: Public DataLane enrichment API.
  version: 1.0.0
servers:
  - url: https://api.datalane.com
security:
  - apiKey: []
tags:
  - name: Campaigns
  - name: Organization
paths:
  /v1/campaigns/export:
    post:
      tags:
        - Campaigns
      summary: Export campaign results as CSV
      operationId: postV1CampaignsExport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                campaignId:
                  type: string
                  pattern: >-
                    ^camp_[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$
                maxContactsPerAccount:
                  examples:
                    - 3
                    - 0
                  description: >-
                    Contacts per account cap. Omit for all contacts; 0 produces
                    one account-only row per account.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                hasMobilePhone:
                  description: >-
                    Include only contacts with a mobile phone. Combines with
                    `hasEmail` as OR when both are true.
                  type: boolean
                hasEmail:
                  description: >-
                    Include only contacts with an email address. Combines with
                    `hasMobilePhone` as OR when both are true.
                  type: boolean
              required:
                - campaignId
              additionalProperties: false
          application/x-www-form-urlencoded:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                campaignId:
                  type: string
                  pattern: >-
                    ^camp_[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$
                maxContactsPerAccount:
                  examples:
                    - 3
                    - 0
                  description: >-
                    Contacts per account cap. Omit for all contacts; 0 produces
                    one account-only row per account.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                hasMobilePhone:
                  description: >-
                    Include only contacts with a mobile phone. Combines with
                    `hasEmail` as OR when both are true.
                  type: boolean
                hasEmail:
                  description: >-
                    Include only contacts with an email address. Combines with
                    `hasMobilePhone` as OR when both are true.
                  type: boolean
              required:
                - campaignId
              additionalProperties: false
          multipart/form-data:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                campaignId:
                  type: string
                  pattern: >-
                    ^camp_[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$
                maxContactsPerAccount:
                  examples:
                    - 3
                    - 0
                  description: >-
                    Contacts per account cap. Omit for all contacts; 0 produces
                    one account-only row per account.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                hasMobilePhone:
                  description: >-
                    Include only contacts with a mobile phone. Combines with
                    `hasEmail` as OR when both are true.
                  type: boolean
                hasEmail:
                  description: >-
                    Include only contacts with an email address. Combines with
                    `hasMobilePhone` as OR when both are true.
                  type: boolean
              required:
                - campaignId
              additionalProperties: false
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      campaignId:
                        type: string
                        pattern: >-
                          ^camp_[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21}$
                      url:
                        type: string
                        format: uri
                        examples:
                          - https://downloads.datalane.com/campaign-results.csv
                        description: Short-lived signed download URL.
                      urlExpiresAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        examples:
                          - '2026-07-21T15:00:00.000Z'
                        description: >-
                          Download the file before this time; re-call export for
                          a fresh URL.
                      rows:
                        type: object
                        properties:
                          accounts:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                            examples:
                              - 100
                          contacts:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                            examples:
                              - 275
                        required:
                          - accounts
                          - contacts
                        additionalProperties: false
                      file:
                        type: object
                        properties:
                          format:
                            type: string
                            const: csv
                          encoding:
                            type: string
                            const: utf-8-bom
                        required:
                          - format
                          - encoding
                        additionalProperties: false
                    required:
                      - campaignId
                      - url
                      - urlExpiresAt
                      - rows
                      - file
                    additionalProperties: false
                  error:
                    type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - invalid_request
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          issues:
                            minItems: 1
                            type: array
                            items:
                              type: string
                        required:
                          - issues
                        additionalProperties: false
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                anyOf:
                  - type: object
                    properties:
                      data:
                        type: 'null'
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - invalid_api_key
                          message:
                            type: string
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - data
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      data:
                        type: 'null'
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - revoked_api_key
                          message:
                            type: string
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - data
                      - error
                    additionalProperties: false
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - not_found
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          resource:
                            type: string
                          id:
                            type: string
                        required:
                          - resource
                          - id
                        additionalProperties: false
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
        '409':
          description: Response for status 409
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - results_not_ready
                      message:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
        '410':
          description: Response for status 410
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - results_expired
                      message:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
        '422':
          description: Response for status 422
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - no_eligible_accounts
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          requested:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        required:
                          - requested
                        additionalProperties: false
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
        '500':
          description: Response for status 500
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - internal_error
                      message:
                        type: string
                        enum:
                          - Internal error.
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - data
                  - error
                additionalProperties: false
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: DataLane API key

````