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

# Create Data Export (/api-reference/data-exports/create-data-export)

Create a new data export request. This will calculate the required credits and prepare the export for starting.

## OpenAPI

````yaml https://app.onlyfansapi.com/scribe-docs/openapi.yaml post /api/data-exports
openapi: 3.0.3
info:
  title: OnlyFans API
  description: ""
  version: 1.0.0
servers:
  - url: https://app.onlyfansapi.com
security:
  - default: []
tags:
  - name: API Keys
    description: ""
  - name: Account
    description: Endpoints for your linked accounts
  - name: Analytics - Financial
    description: APIs for retrieving financial analytics data
  - name: Analytics - Summary
    description: APIs for retrieving summary analytics data
  - name: Banking
    description: Operations related to user banking details, payout methods, legal
      and tax information, and account country settings.
  - name: Chargebacks
    description: ""
  - name: Chat Messages
    description: ""
  - name: Chats
    description: ""
  - name: Client Sessions
    description: ""
  - name: Connect OnlyFans Account
    description: ""
  - name: Data Exports
    description: APIs for managing data exports
  - name: Engagement / Messages
    description: ""
  - name: Fans
    description: APIs for managing OnlyFans fans (subscribers)
  - name: Fans - AI Summary
    description: APIs for generating and retrieving AI-powered fan profile summaries
  - name: Following
    description: APIs for managing OnlyFans followings (people you're subscribed to)
  - name: Free Trial Links
    description: APIs for managing Free Trial Links
  - name: Giphy
    description: ""
  - name: Link Tags
    description: APIs for managing tags on free trial links and tracking links
  - name: Mass Messaging
    description: ""
  - name: Media
    description: ""
  - name: Media Vault
    description: ""
  - name: Media Vault Lists
    description: ""
  - name: Notifications
    description: Endpoints for managingr account notifications
  - name: Payouts
    description: ""
  - name: Post Comments
    description: ""
  - name: Post Labels
    description: APIs for managing your post labels
  - name: Posts
    description: APIs for managing OnlyFans posts
  - name: Promotions
    description: ""
  - name: Public Profiles
    description: ""
  - name: Queue
    description: ""
  - name: Release Forms
    description: APIs for managing OnlyFans release forms
  - name: Saved For Later (Messages)
    description: ""
  - name: Saved For Later (Posts)
    description: ""
  - name: Settings
    description: ""
  - name: Shared Free Trial Links
    description: APIs for Free Trial Links that other OF creators have shared with
      this account. Revenue, cost, and spender data are not available for shared
      links.
  - name: Shared Tracking Links
    description: APIs for Tracking Links (campaigns) that other OF creators have
      shared with this account. Revenue, cost, and spender data are not
      available for shared campaigns.
  - name: Smart Link Postbacks
    description: APIs for managing Smart Link postback destinations
  - name: Smart Links
    description: APIs for managing Smart Links (Free Trial Links and Tracking Links
      with pooled inventory)
  - name: Statistics
    description: ""
  - name: Stored Free Trial Links
    description: Instant APIs for retrieving stored free trial links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stored Shared Free Trial Links
    description: Instant APIs for retrieving stored shared Free Trial Links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stored Shared Tracking Links
    description: Instant APIs for retrieving stored shared Tracking Links
      (campaigns) from the OnlyFansAPI Cache (free, no credits used)
  - name: Stored Tracking Links
    description: Instant APIs for retrieving stored tracking links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stories
    description: APIs for managing OnlyFans stories
  - name: Story Highlights
    description: APIs for managing OnlyFans story highlights
  - name: Subscription Bundles
    description: ""
  - name: Tracking Links
    description: APIs for managing tracking links
  - name: Transactions
    description: APIs for managing OnlyFans transactions
  - name: User List Collections
    description: ""
  - name: Users
    description: APIs for fetching OnlyFans users
  - name: Webhooks
    description: ""
paths:
  /api/data-exports:
    post:
      summary: Create Data Export
      operationId: createDataExport
      description: Create a new data export request. This will calculate the required
        credits and prepare the export for starting.
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: data_export_abc123xyz789
                    type: chat_messages
                    status: calculating_credits
                    start_date: 2024-01-01T00:00:00+00:00
                    end_date: 2024-12-31T23:59:59+00:00
                    file_type: csv
                    created_at: 2024-12-02T12:00:00+00:00
                    requires_scraping: true
                    credit_calculation_note: This export type requires data scraping. Credits will
                      be calculated and charged after scraping completes.
                  _meta:
                    _credits:
                      used: 0
                      balance: 9500
                      note: Always
                    _cache:
                      is_cached: false
                      note: Cache disabled for this endpoint
                    _rate_limits:
                      limit_minute: 60
                      limit_day: null
                      remaining_minute: 56
                      remaining_day: null
                      notice: ""
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: data_export_abc123xyz789
                      type:
                        type: string
                        example: chat_messages
                      status:
                        type: string
                        example: calculating_credits
                      start_date:
                        type: string
                        example: 2024-01-01T00:00:00+00:00
                      end_date:
                        type: string
                        example: 2024-12-31T23:59:59+00:00
                      file_type:
                        type: string
                        example: csv
                      created_at:
                        type: string
                        example: 2024-12-02T12:00:00+00:00
                      requires_scraping:
                        type: boolean
                        example: true
                      credit_calculation_note:
                        type: string
                        example: This export type requires data scraping. Credits will be calculated and
                          charged after scraping completes.
                  _meta:
                    type: object
                    properties:
                      _credits:
                        type: object
                        properties:
                          used:
                            type: integer
                            example: 0
                          balance:
                            type: integer
                            example: 9500
                          note:
                            type: string
                            example: Always
                      _cache:
                        type: object
                        properties:
                          is_cached:
                            type: boolean
                            example: false
                          note:
                            type: string
                            example: Cache disabled for this endpoint
                      _rate_limits:
                        type: object
                        properties:
                          limit_minute:
                            type: integer
                            example: 60
                          limit_day:
                            type: string
                            example: null
                            nullable: true
                          remaining_minute:
                            type: integer
                            example: 56
                          remaining_day:
                            type: string
                            example: null
                            nullable: true
                          notice:
                            type: string
                            example: ""
      tags:
        - Data Exports
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: The type of data to export
                  example: transactions
                  enum:
                    - transactions
                    - chat_messages
                    - media_vault
                    - trial_links
                    - tracking_links
                    - smart_links
                    - payouts
                    - chargebacks
                    - public_profiles
                    - fans
                    - followings
                account_ids:
                  type: array
                  description: Array of account prefixed IDs to export data from. Not required for
                    `public_profiles` type.
                  example:
                    - acc_abc123
                    - acc_def456
                  items:
                    type: string
                start_date:
                  type: string
                  description: The start date for the export (ISO 8601 format).
                  example: 2024-01-01T00:00:00Z
                end_date:
                  type: string
                  description: The end date for the export (ISO 8601 format).
                  example: 2024-12-31T23:59:59Z
                export_columns:
                  type: array
                  description: Array of column names to include in the export (optional, defaults
                    to all columns for the export type)
                  example:
                    - transaction_id
                    - amount
                    - created_at
                  items:
                    type: string
                file_type:
                  type: string
                  description: "The output file format. Supported formats vary by export type:
                    `csv` or `xlsx` for transactions, chat_messages,
                    trial_links, tracking_links, smart_links, payouts,
                    chargebacks, public_profiles, fans, followings; `zip` for
                    media_vault."
                  example: csv
                  enum:
                    - csv
                    - xlsx
                    - zip
                options:
                  type: object
                  description: "Type-specific export options. For `chat_messages`: `maxMessages`
                    (required per account, max 10,000,000), `maxChats` (optional
                    per-account chat scrape limit), `skipMassMessages`
                    (optional, bool), `chatIds` (optional array of numeric
                    fan/chat IDs; filters output and can drastically reduce
                    totals). For `media_vault`: `mediaType` (required, one of:
                    `all`, `photo`, `gif`, `video`, `audio`). For `fans`: `type`
                    (required, one of: `all`, `active`, `expired`, `latest`).
                    For `followings`: `type` (required, one of: `all`, `active`,
                    `expired`). For `public_profiles`: `query` (optional,
                    full-text search), `gender` (optional, filter: male, female,
                    trans, couple), `minSubscribePrice` (optional, USD),
                    `maxSubscribePrice` (optional, USD), `location` (optional),
                    `minPostsCount` (optional, minimum posts), `minPhotosCount`
                    (optional, minimum photos), `minVideosCount` (optional,
                    minimum videos), `minSubscribersCount` (optional, minimum
                    subscribers), `minJoinDate` (optional, ISO 8601 date),
                    `minLastSeenAt` (optional, ISO 8601 date), `createdAtFrom`
                    (optional, ISO 8601 date, profile added to DB after),
                    `createdAtTo` (optional, ISO 8601 date, profile added to DB
                    before), `instagram` (optional), `twitter` (optional),
                    `tiktok` (optional), `maxResults` (optional, limit
                    results)."
                  example:
                    maxChats: 100
                    maxMessages: 50000
                    skipMassMessages: false
                  properties: {}
                auto_start:
                  type: boolean
                  description: When true, automatically starts the export after creation.
                  example: true
              required:
                - type
                - start_date
                - end_date
                - file_type
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: Get your API Key from OnlyFansAPI Console -
        https://app.onlyfansapi.com/api-keys
````