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

# Export opportunities to CSV

> Writes a CSV of the opportunities a saved view (`view_id`, from GET /v1/views) or filter selects, as POST /objects/opportunity/records/search reads them (the same `filter`, `fields` and access), up to `max_rows` records (10,000 at most; `truncated` says when more matched). Columns are the record's standard keys, then its custom field keys (those set on an exported record, every one with `include_empty`, and any named in `fields`); a related record (a tag, a person) is written by name, a list as comma-separated values, and a value a spreadsheet would read as a formula gets a leading quote. The answer is a signed `url` that downloads the file for 60 minutes (anyone holding it can: give it only to the person who asked), and the first rows as `preview`.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects/opportunity/records/export
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/objects/opportunity/records/export:
    post:
      tags:
        - opportunities
      summary: Export opportunities to CSV
      description: >-
        Writes a CSV of the opportunities a saved view (`view_id`, from GET
        /v1/views) or filter selects, as POST
        /objects/opportunity/records/search reads them (the same `filter`,
        `fields` and access), up to `max_rows` records (10,000 at most;
        `truncated` says when more matched). Columns are the record's standard
        keys, then its custom field keys (those set on an exported record, every
        one with `include_empty`, and any named in `fields`); a related record
        (a tag, a person) is written by name, a list as comma-separated values,
        and a value a spreadsheet would read as a formula gets a leading quote.
        The answer is a signed `url` that downloads the file for 60 minutes
        (anyone holding it can: give it only to the person who asked), and the
        first rows as `preview`.
      operationId: opportunities_export
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                fields:
                  anyOf:
                    - items:
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  description: >-
                    Custom field keys to return (comma-separated); all of them
                    when omitted
                  title: Fields
                filter:
                  anyOf:
                    - $ref: '#/components/schemas/FilterCondition'
                    - $ref: '#/components/schemas/FilterGroup'
                    - type: 'null'
                  default: null
                  description: A condition, or an 'and'/'or' group of them
                  title: Filter
                include_empty:
                  default: false
                  description: >-
                    Also return the custom fields a record has no value for, as
                    null. By default `fields` holds only the custom fields with
                    a value: a key that is missing is unset (GET /v1/fields
                    lists every key). A key named in `fields=` always comes
                    back, null or not.
                  title: Include Empty
                  type: boolean
                max_rows:
                  default: 10000
                  description: The most records the file holds (10,000 at most)
                  maximum: 10000
                  minimum: 1
                  title: Max Rows
                  type: integer
                view_id:
                  anyOf:
                    - minimum: 1
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    Only the records this saved view or segment selects (GET
                    /v1/views lists them); other filters narrow them further
                  title: View Id
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportFile'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    FilterCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        op:
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - contains
            - not_contains
            - starts_with
            - ends_with
            - exists
            - not_exists
          title: Op
          type: string
        value:
          default: null
          title: Value
      required:
        - field
        - op
      title: FilterCondition
      type: object
    FilterGroup:
      additionalProperties: false
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/FilterCondition'
                  - $ref: '#/components/schemas/FilterGroup'
              type: array
            - type: 'null'
          default: null
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/FilterCondition'
                  - $ref: '#/components/schemas/FilterGroup'
              type: array
            - type: 'null'
          default: null
          title: Or
      title: FilterGroup
      type: object
    ExportFile:
      properties:
        column_count:
          description: How many columns the file has
          title: Column Count
          type: integer
        columns:
          description: >-
            The file's columns: the record's standard keys, then its custom
            field keys. An MCP answer lists the first ones that fit it; the file
            always has every column
          items:
            type: string
          title: Columns
          type: array
        expires_at:
          description: When the link stops working, ISO 8601 UTC
          title: Expires At
          type: string
        file_name:
          title: File Name
          type: string
        object:
          description: The records exported, e.g. accounts
          title: Object
          type: string
        preview:
          description: >-
            The first rows (up to 10), each with only its non-empty cells, as
            the file has them; an MCP answer holds as many as fit it
          items:
            additionalProperties:
              type: string
            type: object
          title: Preview
          type: array
        rows:
          description: Records in the file
          title: Rows
          type: integer
        truncated:
          description: >-
            More records matched than the file holds (at most `max_rows`, 10,000
            at most): narrow the filter or the view to export the rest
          title: Truncated
          type: boolean
        url:
          description: >-
            A signed link that downloads the CSV with a plain GET for 60
            minutes; anyone holding it can, so treat it as a secret and give it
            only to the person who asked
          title: Url
          type: string
      required:
        - object
        - rows
        - truncated
        - column_count
        - columns
        - file_name
        - url
        - expires_at
      title: ExportFile
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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