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

# Replace item metadata tags

> Replaces the item's tag set with the supplied array. An empty array clears all tags. The other metadata-layer fields (`tier`, `state`) are not affected — flip those through `PATCH /items/{id}` (for `tier`) or the lifecycle endpoints (for `state`).

Concurrent tag writes from different clients auto-merge as set union on the read-through path; this endpoint is the explicit-replace counterpart. See [Metadata](/concepts/metadata).



## OpenAPI

````yaml /openapi.json put /items/{id}/metadata
openapi: 3.1.0
info:
  title: Marfa API
  version: 4.2.0
  description: Typed data layer for structured personal data
servers: []
security: []
paths:
  /items/{id}/metadata:
    put:
      tags:
        - Items
      summary: Replace item metadata tags
      description: >-
        Replaces the item's tag set with the supplied array. An empty array
        clears all tags. The other metadata-layer fields (`tier`, `state`) are
        not affected — flip those through `PATCH /items/{id}` (for `tier`) or
        the lifecycle endpoints (for `state`).


        Concurrent tag writes from different clients auto-merge as set union on
        the read-through path; this endpoint is the explicit-replace
        counterpart. See [Metadata](/concepts/metadata).
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    type: string
                  default: []
      responses:
        '200':
          description: Metadata replaced
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: object
                    properties:
                      item_id:
                        type: string
                      tags:
                        type: array
                        items:
                          type: string
                      extensions:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - item_id
                      - tags
                      - extensions
                required:
                  - metadata
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - missing_required_field
                          - invalid_id
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unauthorized
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: Item not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - item_not_found
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or OAuth Token
      description: Pass an API key (marfa_k1_...) or OAuth access token (marfa_at_...)

````