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

# Replace tags on memories [Cloud]

> Overwrite the tag set on the given memories: tags absent from the request are dropped, and an empty `tags` list clears them all. Use /api/v2/memory/tag/bind to add without removing.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/memory/tag/replace
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/tag/replace:
    post:
      tags:
        - Memory
      summary: Replace tags on memories [Cloud]
      description: >-
        Overwrite the tag set on the given memories: tags absent from the
        request are dropped, and an empty `tags` list clears them all. Use
        /api/v2/memory/tag/bind to add without removing.
      operationId: replaceTags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagReplaceInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_TagReplaceData_'
        '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:
    TagReplaceInput:
      properties:
        memory_type:
          type: string
          minLength: 1
          title: Memory Type
          description: The type of the memories being retagged, e.g. "episode".
        memory_ids:
          items:
            type: string
          type: array
          maxItems: 200
          minItems: 1
          title: Memory Ids
          description: The memories to retag, by id (1–200 per request).
        tags:
          items:
            type: string
            maxLength: 32
            minLength: 1
          type: array
          maxItems: 100
          title: Tags
          description: >-
            The complete tag set to store (up to 100, each 1–32 characters).
            Tags absent from this list are dropped, and an empty list clears
            them all. Duplicates collapse.
      additionalProperties: false
      type: object
      required:
        - memory_type
        - memory_ids
        - tags
      title: TagReplaceInput
      description: >-
        Full replacement (PUT semantics): overwrite each item's tag set with
        ``tags``.


        ``tags`` may be empty — an empty list clears all tags on the targeted
        items.

        Duplicates collapse (tags is a set; the service dedups before ``$set``).
    SuccessEnvelope_TagReplaceData_:
      properties:
        request_id:
          type: string
          title: Request Id
          description: Request trace id (peer to data)
        data:
          $ref: '#/components/schemas/TagReplaceData'
          description: Endpoint-defined business result
      type: object
      required:
        - request_id
        - data
      title: SuccessEnvelope[TagReplaceData]
    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
    TagReplaceData:
      properties:
        matched:
          type: integer
          title: Matched
          default: 0
          description: >-
            How many of the submitted memories the operation matched. Matching
            is not the same as changing: re-binding a tag an item already
            carries matches without modifying it.
        requested:
          type: integer
          title: Requested
          default: 0
          description: >-
            How many ids were submitted. `matched` below `requested` means some
            ids were not found — deleted, another tenant's, or (for bind)
            already at the per-memory tag limit.
      type: object
      title: TagReplaceData
    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>`.'

````