> ## 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.

# Turn partner search on or off

> Switches partner search in the Eka Medical Database to use this catalog, or back off. Turn it on once, after your first successful write; later syncs don't need to touch it. Turning it off is the rollback if a catalog turns out to be wrong.

Panel search (`lab_panel`) can only be on while result search (`lab_result`) is on for the same knowledge base. A request that would break this is refused with a 400 and nothing changes: turning `lab_panel` on while `lab_result` is off returns code `turn_on_results_first`, turning `lab_panel` on while `lab_result` is on in a different knowledge base returns code `results_in_other_kb`, and turning `lab_result` off while `lab_panel` is on in the same knowledge base returns code `turn_off_panels_first`.

> [!NOTE]
>
> **Results and panels.** Panel search can only be on while result search is on for the same knowledge base. A request that breaks this is refused with a `400` and nothing changes:
>
> | Request | Message | Error code |
> | - | - | - |
> | Turn `lab_panel` on while `lab_result` is off | `Turn on search for results first` | `turn_on_results_first` |
> | Turn `lab_panel` on while `lab_result` is on in a different knowledge base | `Turn on search for results in the same knowledge base first` | `results_in_other_kb` |
> | Turn `lab_result` off while `lab_panel` is on in the same knowledge base | `Turn off search for panels first` | `turn_off_panels_first` |
>
> Turn results on before panels, and panels off before results.


## OpenAPI

````yaml post /admin/datasets/v1/search-status/
openapi: 3.1.0
info:
  title: Eka Care Datasets API
  description: >-
    Manage your workspace's formulary catalogs (medications, lab investigations,
    lab results, lab panels, 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/search-status/:
    post:
      tags:
        - datasets
      summary: Turn partner search on or off
      description: >-
        Switches partner search in the Eka Medical Database to use this catalog,
        or back off. Turn it on once, after your first successful write; later
        syncs don't need to touch it. Turning it off is the rollback if a
        catalog turns out to be wrong.


        Panel search (`lab_panel`) can only be on while result search
        (`lab_result`) is on for the same knowledge base. A request that would
        break this is refused with a 400 and nothing changes: turning
        `lab_panel` on while `lab_result` is off returns code
        `turn_on_results_first`, turning `lab_panel` on while `lab_result` is on
        in a different knowledge base returns code `results_in_other_kb`, and
        turning `lab_result` off while `lab_panel` is on in the same knowledge
        base returns code `turn_off_panels_first`.
      operationId: setDatasetSearchStatus
      parameters:
        - $ref: '#/components/parameters/Type'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
            example:
              enabled: true
      responses:
        '200':
          description: New status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchStatusResponse'
              example:
                success: true
                message: partner search enabled for medication
                data:
                  search_enabled: true
                  kb_id: default
                  dataset_type: medication
                  updated_at: '2026-09-28T10:20:00+00:00'
        '400':
          description: >-
            Invalid request, for example a missing or unknown `type`, or a
            switch order that is not allowed for results and panels.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                turnOnResultsFirst:
                  summary: Panel search turned on while result search is off
                  value:
                    success: false
                    message: Turn on search for results first
                    errors:
                      - code: turn_on_results_first
                resultsInOtherKb:
                  summary: >-
                    Panel search turned on while result search is on in another
                    knowledge base
                  value:
                    success: false
                    message: >-
                      Turn on search for results in the same knowledge base
                      first
                    errors:
                      - code: results_in_other_kb
                turnOffPanelsFirst:
                  summary: Result search turned off while panel search is on
                  value:
                    success: false
                    message: Turn off search for panels first
                    errors:
                      - code: turn_off_panels_first
        '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_investigation
          - lab_result
          - lab_panel
          - symptom
          - diagnosis
  schemas:
    SearchStatusResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            data:
              type: object
              properties:
                search_enabled:
                  type: boolean
                kb_id:
                  type: string
                dataset_type:
                  type: string
                updated_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: false
        message:
          type: string
        errors:
          type: array
          description: >-
            Present when validation failed, the shrink guard stopped a
            reconcile, or a search switch order was refused.
          items:
            oneOf:
              - $ref: '#/components/schemas/FieldError'
              - $ref: '#/components/schemas/ShrinkGuardError'
              - $ref: '#/components/schemas/SearchOrderError'
    SuccessEnvelope:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
    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
    SearchOrderError:
      type: object
      properties:
        code:
          type: string
          enum:
            - turn_on_results_first
            - results_in_other_kb
            - turn_off_panels_first
  responses:
    Unauthorized:
      description: The access token is missing, invalid or expired.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token for your workspace.

````

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