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

# Export contacts as CSV

> Download contacts as CSV file. Supports the same filters as the list endpoint. Admin only.



## OpenAPI

````yaml /api-reference/openapi.json get /api/contacts/export
openapi: 3.1.0
info:
  title: Tedro API
  version: 1.0.0
  description: REST API for the Tedro communication operations platform.
servers:
  - url: https://api.tedro.io
    description: Production
security:
  - sessionCookie: []
    workspaceId: []
paths:
  /api/contacts/export:
    get:
      tags:
        - Contacts
      summary: Export contacts as CSV
      description: >-
        Download contacts as CSV file. Supports the same filters as the list
        endpoint. Admin only.
      parameters:
        - schema:
            type: string
          required: false
          name: search
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: groupId
          in: query
        - schema:
            type: string
          required: false
          name: tags
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
          required: false
          name: optedOut
          in: query
        - schema:
            type: string
            description: Comma-separated contact IDs for selection export
          required: false
          description: Comma-separated contact IDs for selection export
          name: ids
          in: query
      responses:
        '200':
          description: CSV file download
          content:
            text/csv:
              schema:
                type: string
        '401':
          description: Unauthorized - missing or invalid session cookie
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - insufficient role (admin required)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - sessionCookie: []
          workspaceId: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Session cookie set by Better Auth on sign-in.
    workspaceId:
      type: apiKey
      in: header
      name: x-workspace-id
      description: Workspace UUID. Required on all /api/* endpoints.

````