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

# Export link visits data

> Triggers an export of link visits data to a CSV file and returns a download URL.



## OpenAPI

````yaml post /public/export-visits
openapi: 3.1.0
info:
  title: Joylink API
  version: 1.0.0
  description: API for managing Joylink short links and tracking
servers:
  - url: https://api.joylink.io
    description: Production server
security: []
paths:
  /public/export-visits:
    post:
      summary: Export link visits data
      description: >-
        Triggers an export of link visits data to a CSV file and returns a
        download URL.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                start_date:
                  type: string
                  format: date
                  example: '2024-01-01'
                  description: Start date for the export (inclusive)
                end_date:
                  type: string
                  format: date
                  example: '2024-01-31'
                  description: End date for the export (inclusive)
              required:
                - start_date
                - end_date
      responses:
        '200':
          description: Successfully triggered export
          content:
            application/json:
              schema:
                type: object
                properties:
                  download_url:
                    type: string
                    description: URL to download the exported CSV file
        '400':
          description: Bad request (e.g., invalid date format)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        details:
          type: string
  responses:
    RateLimitExceeded:
      description: >-
        Rate limit exceeded. Public API keys are limited to 60 requests per
        minute and 1440 requests per day, shared across endpoints.
      headers:
        X-RateLimit-Limit-Minute:
          description: Maximum requests allowed per minute.
          schema:
            type: integer
            example: 60
        X-RateLimit-Remaining-Minute:
          description: Requests remaining in the current minute window.
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset-Minute:
          description: Seconds until the minute window resets.
          schema:
            type: integer
            example: 45
        X-RateLimit-Limit-Day:
          description: Maximum requests allowed per day.
          schema:
            type: integer
            example: 1440
        X-RateLimit-Remaining-Day:
          description: Requests remaining in the current day window.
          schema:
            type: integer
            example: 1200
        X-RateLimit-Reset-Day:
          description: Seconds until the day window resets.
          schema:
            type: integer
            example: 43200
        Retry-After:
          description: >-
            Seconds to wait before retrying. Matches the limit you hit (minute
            or day).
          schema:
            type: integer
            example: 45
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            minute_limit:
              summary: Per-minute limit exceeded
              value:
                error: >-
                  Rate limit exceeded. Maximum 60 requests per minute. Resets in
                  45s.
            day_limit:
              summary: Per-day limit exceeded
              value:
                error: >-
                  Rate limit exceeded. Maximum 1440 requests per day. Resets in
                  5h 20m.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````