# Create content data export

`POST /export/content/data`

> This is a subset of the full specification, limited to the `POST /export/content/data` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.18/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `POST /export/content/data` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Data Export
    description: Export message delivery and engagement statistics (opens, clicks, replies, completions, dismissals, unsubscribes, bounces) for outbound content such as Emails, Posts, Custom Bots, Surveys, Tours, and Series.
paths:
  /export/content/data:
    post:
      summary: Create content data export
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Data Export
      operationId: createDataExport
      description: |
        To create your export job, you need to send a `POST` request to the export endpoint `https://api.intercom.io/export/content/data`.

        This endpoint exports **message delivery and engagement data** for outbound content (Emails, Posts, Custom Bots, Surveys, Tours, Series, and more). The exported data includes who received each message, when they received it, and how they engaged with it (opens, clicks, replies, completions, dismissals, unsubscribes, and bounces). It does not export raw message or conversation content.

        The only parameters you need to provide are the range of dates that you want exported. The range cannot be longer than 90 days.

        >🚧 Limit of two active jobs
        >
        > You can only have two active jobs per workspace. You will receive a HTTP status code of 429 with the message Exceeded rate limit of 2 pending content data export jobs if you attempt to create a third concurrent job.

        >❗️ Updated_at not included
        >
        > It should be noted that the timeframe only includes messages sent during the time period and not messages that were only updated during this period. For example, if a message was updated yesterday but sent two days ago, you would need to set the created_at_after date before the message was sent to include that in your retrieval job.

        >📘 Date ranges are inclusive
        >
        > Requesting data for 2018-06-01 until 2018-06-30 will get all data for those days including those specified - e.g. 2018-06-01 00:00:00 until 2018-06-30 23:59:99.

        Requires the `export_content_data` OAuth scope.
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    job_identifier: al9w983lwu88w1fd
                    status: pending
                    download_url: ''
                    download_expires_at: ''
              schema:
                $ref: '#/components/schemas/data_export'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Missing date:
                  value:
                    type: error.list
                    request_id: 1a7c0e36-b249-4d85-96f1-5c03e7a2b48d
                    errors:
                      - code: bad_request
                        message: '''created_at_after'' is a required parameter'
                Date is not an integer:
                  value:
                    type: error.list
                    request_id: 62e9b0a4-38c7-4f51-bd96-07a1c4e5f283
                    errors:
                      - code: bad_request
                        message: '''created_at_before: yesterday'' must be of type Integer'
                Dates out of order:
                  value:
                    type: error.list
                    request_id: f3081b57-4c2a-49e6-85d0-2b7a6e91c340
                    errors:
                      - code: bad_request
                        message: created_at_after is greater than created_at_before
                Unknown parameter:
                  value:
                    type: error.list
                    request_id: 9d2f4c81-706b-4e39-a5c7-13e08b6d2f95
                    errors:
                      - code: bad_request
                        message: bad 'created_at' parameter
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 4b6e1d09-85f2-4a37-9c60-d1a37e204b58
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
                Token lacks required scope:
                  value:
                    type: error.list
                    request_id: 0c93a7e5-1f48-4b62-83da-6e5c702f194b
                    errors:
                      - code: token_unauthorized
                        message: Not authorized to access resource
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              examples:
                Range too long:
                  value:
                    type: error.list
                    request_id: 7e50c938-2a61-4df7-b084-c9f2e63a51d7
                    errors:
                      - code: parameter_invalid
                        message: The export period is longer than 90 days
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too many concurrent jobs
          content:
            application/json:
              examples:
                Concurrent job limit reached:
                  value:
                    type: error.list
                    request_id: 83b4f027-5d19-4ce6-a27f-b05e19c63d4a
                    errors:
                      - code: rate_limit_exceeded
                        message: Exceeded rate limit of 2 pending content data export jobs
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Content data export disabled
          content:
            application/json:
              examples:
                Export disabled:
                  value:
                    type: error.list
                    request_id: a5c6e239-0b74-41f8-9d13-7e2b840c5f61
                    errors:
                      - code: server_error
                        message: Content data export is currently disabled
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_data_exports_request'
            examples:
              successful:
                summary: successful
                value:
                  created_at_after: 1734519776
                  created_at_before: 1734537776
components:
  schemas:
    create_data_exports_request:
      description: Request for creating a data export
      type: object
      title: Create Data Export Request
      properties:
        created_at_after:
          type: integer
          description: The start date that you request data for. It must be formatted as a unix timestamp.
          example: 1527811200
        created_at_before:
          type: integer
          description: The end date that you request data for. It must be formatted as a unix timestamp.
          example: 1527811200
      required:
        - created_at_after
        - created_at_before
    data_export:
      title: Data Export
      type: object
      x-tags:
        - Data Export
      description: The data export API is used to export message delivery and engagement statistics for outbound content (Emails, Posts, Custom Bots, Surveys, Tours, Series, and more) sent in a given timeframe. The exported data includes who received each message, when they received it, and how they engaged with it (opens, clicks, replies, completions, dismissals, unsubscribes, and bounces).
      properties:
        job_identifier:
          type: string
          description: The identifier for your job.
          example: orzzsbd7hk67xyu
        status:
          type: string
          enum:
            - pending
            - in_progress
            - failed
            - completed
            - no_data
            - canceled
          description: The current state of your job.
          example: pending
        download_expires_at:
          type: string
          description: The time after which you will not be able to access the data, as a Unix timestamp. It is one week from the time the job was created. Empty until the job completes.
          example: '1674917488'
        download_url:
          type: string
          description: The location where you can download your data. Empty until the job completes.
          example: https://api.intercom.io/download/content/data/orzzsbd7hk67xyu
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
