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

# Create an async data export

> Creates an asynchronous export job for the specified resource type. The export is processed in the background and the resulting file is uploaded to storage. Poll the status endpoint with the returned `id` to check completion and retrieve the download URL.




## OpenAPI

````yaml POST /exports
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
  description: >
    ## Filtering and sorting


    List endpoints that accept `filter` take one query parameter per condition,
    written `filter[field][comparator]=value`, for example
    `filter[name][contains]=North`. The comparators are `eq`, `neq`, `gt`,
    `geq`, `lt`, `leq` and `contains`, and `filter[field]=value` is short for
    `eq`. Conditions combine with AND. `contains` matches part of the value, is
    case-sensitive, and applies only to text fields. An unknown field or
    comparator, a value that doesn't fit the field's type, or a list or object
    as the value returns 400 with a message naming the problem. Each list
    operation names its filterable fields; some take only `eq`, and say so.


    `sort` takes a comma-separated list of fields, for example
    `sort=-created_at,name`. Each field sorts ascending, or descending with a
    `-` prefix. Unknown sort fields are ignored. Sorting by `id` orders by the
    record's internal ID, not its friendly ID. Each list operation names its
    sortable fields.
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /exports:
    post:
      tags:
        - Exports
      summary: Create an async data export
      description: >
        Creates an asynchronous export job for the specified resource type. The
        export is processed in the background and the resulting file is uploaded
        to storage. Poll the status endpoint with the returned `id` to check
        completion and retrieve the download URL.
      operationId: create-export
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - export
              properties:
                export:
                  type: object
                  required:
                    - resource_type
                    - format
                  properties:
                    resource_type:
                      type: string
                      description: The model type to export
                      enum:
                        - Project
                        - Order
                        - Delivery
                        - Location
                        - TrackingUnit
                        - Feedstock
                        - Nexus::Asset
                        - Nexus::Event
                        - Nexus::EventType
                        - Nexus::DataPoint
                        - ProductionAccounting::Batch
                        - ProductionAccounting::Ledger
                        - Reporting::Report
                        - Modeling::Model
                    format:
                      type: string
                      enum:
                        - csv
                        - json
                      description: Export file format
                    filters:
                      type: array
                      description: Array of filter conditions to apply
                      items:
                        type: object
                        properties:
                          field:
                            type: string
                          comparator:
                            type: string
                            enum:
                              - '='
                              - <>
                              - '>'
                              - '>='
                              - <
                              - <=
                              - LIKE
                            default: '='
                          value:
                            type: string
                fields:
                  type: string
                  description: >-
                    Comma-separated list of fields to include (e.g.
                    "id,name,status"). Read from the top level of the request,
                    not from inside `export`. Applies to JSON exports and to CSV
                    exports of every resource type except `Nexus::Asset`,
                    `Nexus::Event` and `Nexus::DataPoint`, whose CSV columns are
                    fixed and ignore it. Where it applies, an unknown field
                    fails the export, which `GET /exports/{export_id}` reports.
            examples:
              Request Example:
                value:
                  export:
                    resource_type: ProductionAccounting::Batch
                    format: csv
                    filters:
                      - field: tracking_id
                        comparator: '='
                        value: Q1-2025-001
      responses:
        '202':
          description: Export queued for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The export's friendly ID (e.g. `exp_aBcD1234eFgH5678`).
                  status:
                    type: string
                    enum:
                      - pending
                  status_url:
                    type: string
                    format: uri
                    description: URL of the export's status endpoint.
                  message:
                    type: string
              example:
                id: exp_aBcD1234eFgH5678
                status: pending
                status_url: https://app.gomangrove.com/api/v1/exports/exp_aBcD1234eFgH5678
                message: Export queued for processing
        '400':
          description: >
            Invalid resource_type or format, a missing `export` object, or a
            filter the export can't apply: `filters` not an array of objects, a
            field outside the resource's filterable fields, an unsupported
            comparator, `LIKE` on a non-text field, a list or object value, or
            an integer out of range for its field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          description: Too many concurrent exports (max 5 per account)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - message: >-
                      Too many concurrent exports. Maximum 5 pending/processing
                      exports per account.
      security:
        - sec0: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Human-readable error message
              field:
                type: string
                description: Attribute the error applies to (validation errors only)
              code:
                type: string
                description: Machine-readable error code (validation errors only)
              blocking:
                type: array
                description: >-
                  Bounded preview of the records blocking a destroy
                  (blocked-destroy errors only)
                items:
                  $ref: '#/components/schemas/DeletionBlockingRecord'
              blocking_count:
                type: integer
                description: >-
                  Total count of records blocking a destroy (blocked-destroy
                  errors only)
              config_key:
                type: string
                description: >-
                  The data feed source config setting to fix, when the error is
                  on `config` (data feed source validation errors only)
              count:
                type: number
                description: >-
                  The limit or comparison value the failed validation checked
                  against, e.g. a maximum length or a numeric bound (validation
                  errors only, when the validation has one)
              value:
                description: >-
                  The rejected value, e.g. on an inclusion or uniqueness failure
                  (validation errors only, when the validation reports one)
    DeletionBlockingRecord:
      type: object
      required:
        - type
      properties:
        type:
          type: string
        friendly_id:
          type: string
        name:
          type:
            - string
            - 'null'
          description: >-
            Display label, and the only identifier for records that have no
            friendly_id
  responses:
    Unauthorized:
      description: >-
        The API token is missing, invalid or expired. The body is empty, except
        for an expired token, which returns the error below.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: API token has expired
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.