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

# Export the entries of a card definition to a file

> Starts an export of the entries `where` matches into one CSV or Excel file and returns it at once; the file is written in the background. Read the export with `GET /v1/card-definitions/{cardId}/exports/{exportId}` until `status` is final. `where` takes the part of the search language a segment takes; anything else returns 400 naming the limit. 400 when 500,000 or more entries match.



## OpenAPI

````yaml /api-reference/openapi/configuration.json post /v1/card-definitions/{cardId}/exports
openapi: 3.2.0
info:
  title: Configuration API
  description: >-
    Manages applications, sources, source properties, source folders, managed
    tags and their values, card definitions, their segments and relation
    definitions; manages destinations, their versions and endpoints, and
    publishes versions; and authors, previews and activates card lifecycles.
    Card property changes are saved as pending changes and take effect when the
    card definition is activated. Source property changes and source deletion
    can finish asynchronously. The tenant comes from the access token.
    Successful responses return the resource itself; lists return a page with
    `items`, the `after` cursor for the next page and, when asked for,
    `totalCount` (`limit` default 50, max 200; lifecycle lists default 25, max
    100). Application updates replace the settings and need the latest `etag`;
    secrets are returned only when created. Errors are problem details
    (`application/problem+json`). Values are PascalCase in REST and UPPER_CASE
    in GraphQL.
  version: 1.0.0
servers:
  - url: https://api.occtoo.com
security: []
tags:
  - name: Applications
  - name: Card definitions
  - name: Card exports
  - name: Destination endpoints
  - name: Destination versions
  - name: Destinations
  - name: Languages
  - name: Lifecycles
  - name: Managed tag values
  - name: Managed tags
  - name: Relation definitions
  - name: Segments
  - name: Sources
paths:
  /v1/card-definitions/{cardId}/exports:
    post:
      tags:
        - Card exports
      summary: Export the entries of a card definition to a file
      description: >-
        Starts an export of the entries `where` matches into one CSV or Excel
        file and returns it at once; the file is written in the background. Read
        the export with `GET /v1/card-definitions/{cardId}/exports/{exportId}`
        until `status` is final. `where` takes the part of the search language a
        segment takes; anything else returns 400 naming the limit. 400 when
        500,000 or more entries match.
      operationId: CreateCardExport
      parameters:
        - name: cardId
          in: path
          description: Raw id of the card definition (e.g. `products`).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCardExportRequest'
        required: true
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardExportResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - kindeOAuth: []
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    CreateCardExportRequest:
      type: object
      properties:
        format:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FileFormat'
              description: Format of the file. Required. See `FileFormat`.
          description: Format of the file. Required. See `FileFormat`.
        where:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                Selects the entries to export, in the form card entry search
                takes. Omitted or null exports every entry.
          description: >-
            Selects the entries to export, in the form card entry search takes.
            Omitted or null exports every entry.
        language:
          type:
            - 'null'
            - string
          description: >-
            Language code `where` uses for localized card properties. Default
            `en`. It doesn't pick the exported languages.
        properties:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Ids of the card properties to export. Omitted or null exports every
            card property that isn't hidden.
        languages:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Language codes to export. Omitted or null exports the tenant's
            default language.
        includeTimestamp:
          type: boolean
          description: True adds each entry's timestamp to the file. Default `false`.
          default: false
        delimiter:
          type:
            - 'null'
            - string
          description: >-
            Delimiter that joins list values in the file. Omitted or null uses
            each card property's own delimiter.
        filename:
          type:
            - 'null'
            - string
          description: >-
            Name of the file, without extension: the format adds it. Default:
            the card definition id.
      description: Holds what to export from a card definition.
    CardExportResponse:
      required:
        - id
        - status
        - progress
        - totalEntries
        - processedEntries
        - createdAt
        - updatedAt
        - expiresAt
        - file
      type: object
      properties:
        id:
          type: string
          description: >-
            Id of the export (a UUID). Use with
            `/v1/card-definitions/{cardId}/exports/{exportId}`.
          format: uuid
        status:
          $ref: '#/components/schemas/CardExportStatus'
          description: Where the export is. See `CardExportStatus`.
        progress:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$
          type:
            - 'null'
            - number
            - string
          description: >-
            Share of entries written, 0 to 100 (percent). Null while the entry
            count is unknown.
          format: double
        totalEntries:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Entries the export matches.
          format: int32
        processedEntries:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Entries written to the file so far.
          format: int32
        createdAt:
          type: string
          description: When the export was started (UTC).
          format: date-time
        updatedAt:
          type: string
          description: When the export last changed (UTC).
          format: date-time
        expiresAt:
          type: string
          description: When the export and its file stop being kept (UTC).
          format: date-time
        file:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CardExportFileResponse'
              description: >-
                The file, once it is ready to download. Null until then, and
                null after `expiresAt`.
          description: >-
            The file, once it is ready to download. Null until then, and null
            after `expiresAt`.
      description: >-
        An export of the entries of a card definition to a file. Read it until
        `status` is final.
    HttpValidationProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    FileFormat:
      enum:
        - Excel
        - CSV
        - null
      description: Sets the format of a cards import or export file.
      x-enum-descriptions:
        Excel: Excel workbook (`.xlsx`).
        CSV: Delimited text file (`.csv`).
    SearchPredicate:
      type: object
      properties:
        and:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/SearchPredicate'
          description: Every child condition must match.
        or:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/SearchPredicate'
          description: At least one child condition must match.
        not:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: The child condition must not match.
          description: The child condition must not match.
        text:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TextPredicate'
              description: >-
                A condition on text, including substring, RE2 regex and length
                checks.
          description: >-
            A condition on text, including substring, RE2 regex and length
            checks.
        integer:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/IntegerPredicate'
              description: A condition on an integer property.
          description: A condition on an integer property.
        decimal:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DecimalPredicate'
              description: A condition on a decimal property.
          description: A condition on a decimal property.
        timestamp:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimestampPredicate'
              description: A condition on a timestamp property.
          description: A condition on a timestamp property.
        boolean:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/BooleanPredicate'
              description: A condition on a boolean property.
          description: A condition on a boolean property.
        list:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ListPredicate'
              description: A condition on list elements or length.
          description: A condition on list elements or length.
        hasValue:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PropertyReference'
              description: >-
                True when a value exists. Empty text, whitespace and empty lists
                count as values.
          description: >-
            True when a value exists. Empty text, whitespace and empty lists
            count as values.
        segment:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SegmentPredicate'
              description: Membership in a segment.
          description: Membership in a segment.
        relation:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RelationPredicate'
              description: >-
                Tests distinct live related entries. All nested conditions apply
                to the same child.
          description: >-
            Tests distinct live related entries. All nested conditions apply to
            the same child.
        lifecycle:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecyclePredicate'
              description: Saved readiness of the entry under an active lifecycle.
          description: Saved readiness of the entry under an active lifecycle.
      description: >-
        Holds a typed condition on an entry. Set exactly one branch; `and` and
        `or` need at least one child.
    CardExportStatus:
      enum:
        - Pending
        - InProgress
        - Completed
        - Failed
        - Cancelled
      description: >-
        Says where a card export is. `Completed`, `Failed` and `Cancelled` are
        final.
      x-enum-descriptions:
        Pending: Queued and waiting to start.
        InProgress: Running.
        Completed: Finished. `file` holds the download link.
        Failed: Stopped with an error. Start a new export.
        Cancelled: Cancelled by a user in Studio.
    CardExportFileResponse:
      required:
        - name
        - sizeBytes
        - url
      type: object
      properties:
        name:
          type: string
          description: Name of the file.
        sizeBytes:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Size of the file in bytes.
          format: int64
        url:
          type: string
          description: >-
            Signed download link, made new on every read and valid for up to 24
            hours.
      description: The file a card export wrote.
    TextPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - string
          description: Equal to this value.
        neq:
          type:
            - 'null'
            - string
          description: Different from this value.
        in:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Equal to any listed value.
        contains:
          type:
            - 'null'
            - string
          description: A literal substring.
        pattern:
          type:
            - 'null'
            - string
          description: A whole-value wildcard pattern using * and ?.
        ignoreCase:
          type: boolean
          description: Whether matching ignores case.
          default: false
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
        regex:
          type:
            - 'null'
            - string
          description: >-
            A substring pattern using the supported RE2 subset, validated
            locally.
        length:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: Bounds on the number of Unicode code points.
          description: Bounds on the number of Unicode code points.
      description: Tests a text card property.
    IntegerPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Equal to this value.
          format: int64
        neq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Different from this value.
          format: int64
        in:
          type:
            - 'null'
            - array
          items:
            pattern: ^-?(?:0|[1-9]\d*)$
            type:
              - integer
              - string
            format: int64
          description: Equal to any listed value.
        lt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than this value.
          format: int64
        lte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than or equal to this value.
          format: int64
        gt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than this value.
          format: int64
        gte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than or equal to this value.
          format: int64
      description: Tests an integer card property.
    DecimalPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Equal to this value.
          format: double
        neq:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Different from this value.
          format: double
        in:
          type:
            - 'null'
            - array
          items:
            pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
            type:
              - number
              - string
            format: double
          description: Equal to any listed value.
        lt:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Less than this value.
          format: double
        lte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Less than or equal to this value.
          format: double
        gt:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Greater than this value.
          format: double
        gte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Greater than or equal to this value.
          format: double
      description: Tests a decimal card property.
    TimestampPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - string
          description: Equal to this value.
          format: date-time
        neq:
          type:
            - 'null'
            - string
          description: Different from this value.
          format: date-time
        in:
          type:
            - 'null'
            - array
          items:
            type: string
            format: date-time
          description: Equal to any listed value.
        lt:
          type:
            - 'null'
            - string
          description: Less than this value.
          format: date-time
        lte:
          type:
            - 'null'
            - string
          description: Less than or equal to this value.
          format: date-time
        gt:
          type:
            - 'null'
            - string
          description: Greater than this value.
          format: date-time
        gte:
          type:
            - 'null'
            - string
          description: Greater than or equal to this value.
          format: date-time
      description: Tests a timestamp card property.
    BooleanPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        eq:
          type:
            - 'null'
            - boolean
          description: Equal to this value.
        neq:
          type:
            - 'null'
            - boolean
          description: Different from this value.
        in:
          type:
            - 'null'
            - array
          items:
            type: boolean
          description: Equal to any listed value.
      description: Tests a boolean card property.
    ListPredicate:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        contains:
          type:
            - 'null'
            - string
          description: An exact list element to match.
        pattern:
          type:
            - 'null'
            - string
          description: A wildcard pattern applied to each element.
        ignoreCase:
          type: boolean
          description: Whether element matching ignores case.
          default: false
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
        length:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: Bounds on list length, including duplicate and empty elements.
          description: Bounds on list length, including duplicate and empty elements.
        only:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Every list element must be one of these values. An empty or missing
            list doesn't match.
      description: Tests a list card property.
    PropertyReference:
      required:
        - property
      type: object
      properties:
        property:
          $ref: '#/components/schemas/PropertyId'
          description: Id of the card property.
        languages:
          type:
            - 'null'
            - array
          description: Every listed language must match. There is no language fallback.
      description: Tests that a card property has a value.
    SegmentPredicate:
      required:
        - definitionId
        - id
      type: object
      properties:
        definitionId:
          $ref: '#/components/schemas/SegmentDefinitionId'
          description: Raw id of the segment definition (e.g. `campaigns`).
        id:
          $ref: '#/components/schemas/SegmentId'
          description: Raw id of the segment within that segment definition.
      description: Describes membership in a segment.
    RelationPredicate:
      required:
        - id
      type: object
      properties:
        id:
          $ref: '#/components/schemas/RelationId'
          description: Id of the relation. The current card determines its direction.
        where:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SearchPredicate'
              description: >-
                The condition each counted child must satisfy. Null includes all
                live children.
          description: >-
            The condition each counted child must satisfy. Null includes all
            live children.
        count:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CountBounds'
              description: >-
                Bounds on distinct matching children. Null requires at least one
                match.
          description: >-
            Bounds on distinct matching children. Null requires at least one
            match.
      description: Tests live related entries.
    LifecyclePredicate:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the lifecycle (a UUID).
          format: uuid
        state:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleReadinessState'
              description: Readiness of the whole lifecycle for the entry.
          description: Readiness of the whole lifecycle for the entry.
        step:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleStepPredicate'
              description: Condition on one step.
          description: Condition on one step.
        firstIncompleteStepId:
          type:
            - 'null'
            - string
          description: Id of the first step that's incomplete for the entry.
          format: uuid
      description: >-
        Matches entries by their saved readiness under an active lifecycle. Set
        exactly one of `state`, `step` or `firstIncompleteStepId`. Entries
        without a saved assessment stay unknown, even under `not`.
    PropertyId:
      type: string
      description: Identifies a card property (e.g. `title`).
    CountBounds:
      type: object
      properties:
        eq:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Exactly this many.
          format: int64
        gt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than this value.
          format: int64
        gte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Greater than or equal to this value.
          format: int64
        lt:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than this value.
          format: int64
        lte:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: Less than or equal to this value.
          format: int64
      description: Sets an exact count or a range of nonnegative counts.
    SegmentDefinitionId:
      type: string
      description: Identifies a segment definition by its raw id (e.g. `campaigns`).
    SegmentId:
      type: string
      description: Identifies a segment by its raw id within its segment definition.
    RelationId:
      type: string
      description: Identifies a relation definition by its raw id.
    LifecycleReadinessState:
      enum:
        - Complete
        - Incomplete
        - NotApplicable
        - null
      description: Saved readiness of an assessed entry. Missing assessments have no state.
      x-enum-descriptions:
        Complete: The lifecycle applies to the entry and every step is complete.
        Incomplete: >-
          The lifecycle applies to the entry and at least one step is
          incomplete.
        NotApplicable: The entry doesn't match the lifecycle's applicability.
    LifecycleStepPredicate:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          description: Id of the step in the active revision (a UUID).
          format: uuid
        requirements:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleRequirementsFilter'
              description: >-
                Whether the step's own blocking rules pass, whatever earlier
                steps say.
          description: >-
            Whether the step's own blocking rules pass, whatever earlier steps
            say.
        completion:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LifecycleCompletionFilter'
              description: Whether the step and every earlier step are complete.
          description: Whether the step and every earlier step are complete.
      description: >-
        Matches one step of a lifecycle. Set exactly one of `requirements` or
        `completion`.
    LifecycleRequirementsFilter:
      enum:
        - Satisfied
        - Failed
        - null
      description: >-
        Matches a step by its own blocking (error) rules, whatever earlier steps
        say.
      x-enum-descriptions:
        Satisfied: The step's applicable blocking (error) rules are satisfied.
        Failed: At least one applicable blocking (error) rule of the step failed.
    LifecycleCompletionFilter:
      enum:
        - Complete
        - Incomplete
        - null
      description: Matches a step by whether it and every earlier step are complete.
      x-enum-descriptions:
        Complete: The step and every earlier step are complete.
        Incomplete: The step or an earlier step is incomplete.
  securitySchemes:
    kindeOAuth:
      type: oauth2
      description: >-
        Sign in with the existing Occtoo Studio identity and selected
        organization.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.occtoo.com/oauth2/auth?audience=https%3A%2F%2Fapi-weu.occtoo.com
          tokenUrl: https://auth.occtoo.com/oauth2/token
          scopes:
            openid: Authenticate the user with OpenID Connect.
            profile: Read the user's basic profile.
            email: Read the user's email address.
            offline: Refresh the access token without another interactive sign-in.
          x-usePkce: SHA-256
          x-scalar-redirect-uri: https://api.occtoo.com/docs/
    bearerAuth:
      type: http
      description: >-
        Tenant-scoped Occtoo access token, including Kinde machine-to-machine
        application tokens.
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Occtoo organization API key.
      name: x-api-key
      in: header

````

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