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

# Soft-delete memory records by id [Cloud-only]

> Soft-delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only "episode" is supported today.

- Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted.
- Ids that do not exist, are already deleted, or belong to another tenant are skipped rather than reported — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed.

To remove memories by owner or session rather than by id, use /api/v2/memory/delete.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/memory/delete_by_ids
openapi: 3.1.0
info:
  title: EverOS Cloud Memory API
  version: 2.0.0
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  contact:
    name: EverMind AI
    email: service@evermind.ai
    url: https://github.com/EverMind-AI/everos-cloud-sdk-python
  description: >-
    Official Python client for the EverOS Cloud Memory API. Add, search,
    retrieve, and manage long-term memory for your AI applications over a typed
    interface (pydantic v2, with full type hints). Install and usage guides:
    https://github.com/EverMind-AI/everos-cloud-sdk-python
servers:
  - url: https://api.evermind.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/memory/delete_by_ids:
    post:
      tags:
        - Memory
      summary: Soft-delete memory records by id [Cloud-only]
      description: >-
        Soft-delete up to 50 memories chosen by id, together with what was
        derived from them (extracted facts, cluster membership and search-index
        copies). Only "episode" is supported today.


        - Every id must be well-formed; one malformed id rejects the whole
        request with 422 and nothing is deleted.

        - Ids that do not exist, are already deleted, or belong to another
        tenant are skipped rather than reported — the rest of the batch is still
        deleted, so re-sending a batch is safe. Duplicates are collapsed.


        To remove memories by owner or session rather than by id, use
        /api/v2/memory/delete.
      operationId: deleteMemoriesByIds
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteByIdsInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_DeleteByIdsData_'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '403':
          description: >-
            Authenticated but not permitted — either rejected by the auth
            service, or the account's memory API version does not match the
            interface version implied by the path (a v1 account calling an
            /api/v2 route).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit or quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '503':
          description: >-
            The gateway could not reach the authentication service. Transient —
            retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
components:
  schemas:
    DeleteByIdsInput:
      properties:
        memory_type:
          type: string
          minLength: 1
          title: Memory Type
          description: >-
            Kind of the memories being deleted. Only "episode" is accepted
            today.
        memory_ids:
          items:
            type: string
          type: array
          maxItems: 50
          minItems: 1
          title: Memory Ids
          description: >-
            1 to 50 memory ids. Every one must be well-formed; duplicates are
            collapsed.
        reason:
          anyOf:
            - $ref: '#/components/schemas/Reason'
            - type: 'null'
          description: >-
            Why the memories are removed. Optional; one reason covers the whole
            batch.
      additionalProperties: false
      type: object
      required:
        - memory_type
        - memory_ids
      title: DeleteByIdsInput
      description: Soft-delete the named memory records [Cloud-only].
      example:
        memory_type: episode
        memory_ids:
          - 665f0c8e1a2b3c4d5e6f7a8b
          - 665f0c8e1a2b3c4d5e6f7a8c
        reason:
          code: redundant
    SuccessEnvelope_DeleteByIdsData_:
      properties:
        request_id:
          type: string
          title: Request Id
          description: Request trace id (peer to data)
        data:
          $ref: '#/components/schemas/DeleteByIdsData'
          description: Endpoint-defined business result
      type: object
      required:
        - request_id
        - data
      title: SuccessEnvelope[DeleteByIdsData]
    GatewayError:
      type: object
      additionalProperties: true
      description: >-
        Gateway error body. NOTE: shape is not yet uniform across auth/quota/
        rate-limit paths — treat fields as best-effort. Commonly includes a
        `code`/`message` (flat) or an `error` object/string with a `message`.
      title: GatewayError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          description: One entry per field that failed validation.
      type: object
      title: HTTPValidationError
    Reason:
      properties:
        code:
          type: string
          enum:
            - hallucination
            - wrong_subject
            - wrong_time
            - redundant
            - missing
            - privacy
            - style
            - other
          title: Code
          description: >-
            What was wrong, from the fixed list — hallucination, wrong_subject,
            wrong_time, redundant, missing, privacy, style, other. Required
            whenever a reason is given. Same base list as `FeedbackInput.reason`
            plus `missing`, which only an edit can express (an operator fixes a
            record that left something out; a rating always names a memory that
            exists). On the contract this SDK is generated from (engine
            release-20260901_v15) `outdated` is not yet accepted here — the
            engine adds it in its next release; until then record an
            outdated-type fix as `wrong_time` or `other`.
        note:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Note
          description: Optional free text, up to 256 characters.
      additionalProperties: false
      type: object
      required:
        - code
      title: Reason
      description: >-
        Why the operator made the change. OPTIONAL on both ops: it is recorded
        on the

        audit event for quality analysis, never used to gate anything. When
        given, ``code``

        is required and ``note`` is free text.
    DeleteByIdsData:
      properties:
        memory_type:
          type: string
          title: Memory Type
          description: The memory type the request named.
        success:
          type: boolean
          title: Success
          description: >-
            Always true on a 200 — the batch was applied. Failures use the error
            envelope instead.
      type: object
      required:
        - memory_type
        - success
      title: DeleteByIdsData
      description: >-
        Result of a by-ids soft delete. A 200 means the request was applied; ids
        that

        were already gone are a no-op, not a failure, so a re-sent batch is
        safe.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: Path to the offending field, from the body root.
        msg:
          type: string
          title: Message
          description: What is wrong with it.
        type:
          type: string
          title: Error Type
          description: Machine-readable validation-error kind.
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key issued by EverOS, sent as `Authorization: Bearer <api_key>`.'

````

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