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

# Update group

> Patch `name`, `prompt`, and/or `status`. Changing `prompt` does
not retroactively re-tag memory rows that were tagged under the
previous prompt.



## OpenAPI

````yaml https://api.staging.xtrace.ai/openapi.public.json patch /v1/groups/{group_id}
openapi: 3.1.0
info:
  title: XTrace Vec DB
  description: XTrace API
  version: 1.0.0
servers:
  - url: https://api.production.xtrace.ai
    description: Production
security:
  - ApiKeyHeader: []
  - BearerToken: []
paths:
  /v1/groups/{group_id}:
    patch:
      tags:
        - groups
      summary: Update group
      description: |-
        Patch `name`, `prompt`, and/or `status`. Changing `prompt` does
        not retroactively re-tag memory rows that were tagged under the
        previous prompt.
      operationId: update_group_v1_groups__group_id__patch
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            title: Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '404':
          description: '`detail.code = "group_not_found"`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: >-
            `detail.code = "invalid_request"` — e.g. `status` set to a value
            other than `active` / `archived`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >
            import { MemoryClient } from '@xtraceai/memory';


            const client = new MemoryClient({
              apiKey: process.env.XTRACE_API_KEY!,
              orgId:  process.env.XTRACE_ORG_ID!,
            });


            // Only the fields you pass change; re-prompting does not re-tag
            existing rows.

            const group = await client.groups.update('grp_a1b2c3d4e5f6...', {
              prompt: 'Facts about the Tokyo trip, including day-trips to Hakone.',
            });
components:
  schemas:
    GroupUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 120
              minLength: 1
            - type: 'null'
          title: Name
          description: New name; leave null to keep existing.
        prompt:
          anyOf:
            - type: string
              maxLength: 2000
              minLength: 1
            - type: 'null'
          title: Prompt
          description: >-
            New classifier prompt; leave null to keep existing. Does not
            retroactively re-tag existing memory rows. Setting a prompt on a
            catch-all group converts it to a prompted group going forward; a
            prompt can never be removed via PATCH (empty string is a 422).
        status:
          anyOf:
            - type: string
              enum:
                - active
                - archived
            - type: 'null'
          title: Status
          description: >-
            Set to `"active"` to un-archive a previously-archived group. The
            normal way to archive is `DELETE /v1/groups/{id}`.
      type: object
      title: GroupUpdateRequest
      description: |-
        PATCH /v1/groups/{id} — partial update. Any field set to ``None``
        is left unchanged. Editing ``prompt`` does NOT retroactively re-tag
        existing memory rows.
    Group:
      properties:
        object:
          type: string
          const: group
          title: Object
          description: Constant discriminator for the resource type.
          default: group
        id:
          type: string
          title: Id
          description: Stable group id of the form `grp_<32-hex-chars>`.
          examples:
            - grp_a1b2c3d4e5f6071829304a5b6c7d8e9f
        name:
          type: string
          title: Name
          description: Human-readable label.
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: >-
            Classifier criterion. Read by the ingest pipeline on every request
            that includes this group's id in `group_ids`. `null` marks a
            catch-all group: every extracted memory judged shareable (not
            personal) is tagged with it.
        status:
          type: string
          enum:
            - active
            - archived
          title: Status
          description: >-
            `active` groups are tagged on new ingests. `archived` groups still
            surface on search (rows tagged with the id stay reachable) but the
            ingest classifier rejects them.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-8601 timestamp the group was registered.
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          format: date-time
          title: Updated At
          description: ISO-8601 timestamp of the most recent edit.
      type: object
      required:
        - id
        - name
        - status
        - created_at
      title: Group
      description: |-
        Wire shape of a group. ``id`` is the opaque handle that goes
        into ``IngestRequest.group_ids`` and into search ``filters``.
    ErrorEnvelope:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - detail
      title: ErrorEnvelope
      description: |-
        Standard error body for non-2xx responses raised by the memory
        API. Pydantic field-validation failures (422) use the FastAPI-
        default ``HTTPValidationError`` shape instead, where ``detail`` is
        an array of per-field error entries — switch on the response
        status code to pick the right shape.
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable error identifier. Switch on this rather than parsing the
            message. Common values: `invalid_request`, `invalid_messages`,
            `memory_not_found`, `job_not_found`, `immutable_field`,
            `reserved_field`, `empty_text_field`, `missing_user_id`,
            `missing_conv_id`, `unsupported_include_option`, `cursor_mismatch`,
            `unauthorized`, `forbidden`, `rate_limited`, `delete_failed`,
            `search_failed`, `ingest_failed`, `server_error`.
          examples:
            - memory_not_found
        message:
          type: string
          title: Message
          description: Human-readable summary; safe to log but not safe to switch on.
          examples:
            - Memory 0fa1c0e6-... not found
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: |-
        Inner ``detail`` block on every non-2xx response raised by a
        memory-API route handler. ``code`` is the stable identifier
        clients should switch on; ``message`` is a sanitized human-
        readable summary.
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Long-lived org API key. Alternative: `Authorization: Bearer <key>`.'
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: 'Long-lived API key sent as `Authorization: Bearer <api-key>`.'

````