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

# Deactivate records

> Soft-deletes the records with the given ids: they stop appearing in lists and partner search but are kept, and sending them again in a write restores them. Ids that don't exist are reported in `not_found`.



## OpenAPI

````yaml post /admin/datasets/v1/delete/
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/delete/:
    post:
      tags:
        - datasets
      summary: Deactivate records
      description: >-
        Soft-deletes the records with the given ids: they stop appearing in
        lists and partner search but are kept, and sending them again in a write
        restores them. Ids that don't exist are reported in `not_found`.
      operationId: deactivateDatasetRecords
      parameters:
        - $ref: '#/components/parameters/Type'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ids
              properties:
                ids:
                  type: array
                  minItems: 1
                  items:
                    type: string
            example:
              ids:
                - DRUG1001
                - DRUG1002
      responses:
        '200':
          description: Records deactivated.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          deactivated:
                            type: integer
                          not_found:
                            type: array
                            items:
                              type: string
              example:
                success: true
                message: 1 medication deactivated
                data:
                  deactivated: 1
                  not_found:
                    - DRUG1002
        '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
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
    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
  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.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token for your workspace.

````