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

# Export the catalog as CSV

> Downloads the catalog as CSV, in the same column order the write endpoint accepts, so an export can be uploaded again unchanged.



## OpenAPI

````yaml get /admin/datasets/v1/export.csv
openapi: 3.1.0
info:
  title: Eka Care Datasets API
  description: >-
    Manage your workspace's formulary catalogs (medications, lab tests, symptoms
    and diagnoses): upload them as JSON or CSV, keep them in sync, read them
    back, and switch on partner search in the Eka Medical Database. Every
    request acts only on the workspace your access token belongs to.
  version: 1.0.0
  contact:
    name: Eka Care Support
    url: https://eka.care/
    email: support@eka.care
servers:
  - url: https://api.eka.care
    description: Production
  - url: https://api.dev.eka.care
    description: Stage/Sandbox
security:
  - BearerAuth: []
tags:
  - name: datasets
paths:
  /admin/datasets/v1/export.csv:
    get:
      tags:
        - datasets
      summary: Export the catalog as CSV
      description: >-
        Downloads the catalog as CSV, in the same column order the write
        endpoint accepts, so an export can be uploaded again unchanged.
      operationId: exportDatasetRecords
      parameters:
        - $ref: '#/components/parameters/Type'
        - name: q
          in: query
          required: false
          description: Only export records matching this text.
          schema:
            type: string
        - $ref: '#/components/parameters/ShowInactive'
      responses:
        '200':
          description: The catalog as CSV.
          content:
            text/csv:
              schema:
                type: string
              example: >
                medication_id,name,aliases,display_name,strength,generic_name,generic_id,generic_list,generic_list_ids,form_name,sku,schedule_code,custom_type,therapy_class,therapy_class_id,action_class,action_class_id,manufacturer,otc,is_active

                DRUG1001,Dolo 650,Dolo|Paracetamol 650,Dolo
                650,650mg,Paracetamol,GEN-PARA-650,Paracetamol,GEN-PARA-650,Tablet,10012345,OTC,,Analgesic,,Antipyretic,,Micro
                Labs Ltd,true,true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    Type:
      name: type
      in: query
      required: true
      description: Which catalog to act on.
      schema:
        type: string
        enum:
          - medication
          - lab_test
          - symptom
          - diagnosis
    ShowInactive:
      name: show_inactive
      in: query
      required: false
      description: Pass `1` to include inactive records.
      schema:
        type: string
        enum:
          - '1'
  responses:
    BadRequest:
      description: Invalid request, for example a missing or unknown `type`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: >-
              type must be one of 'medication', 'lab_test', 'symptom',
              'diagnosis'
    Unauthorized:
      description: The access token is missing, invalid or expired.
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: false
        message:
          type: string
        errors:
          type: array
          description: >-
            Present when validation failed or the shrink guard stopped a
            reconcile.
          items:
            oneOf:
              - $ref: '#/components/schemas/FieldError'
              - $ref: '#/components/schemas/ShrinkGuardError'
    FieldError:
      type: object
      properties:
        index:
          type:
            - integer
            - 'null'
          description: >-
            For a JSON body, the 0-based position of the failing record in the
            list. For a CSV, the 1-based data row (the header row is not
            counted). `null` for a file-level error.
        field:
          type:
            - string
            - 'null'
        msg:
          type: string
        value:
          description: The rejected value.
    ShrinkGuardError:
      type: object
      properties:
        code:
          type: string
          const: shrink_guard
        active_before:
          type: integer
        would_deactivate:
          type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token for your workspace.

````