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

# List groups

> List groups for the calling org. Active-only by default.



## OpenAPI

````yaml https://api.staging.xtrace.ai/openapi.public.json get /v1/groups
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:
    get:
      tags:
        - groups
      summary: List groups
      description: List groups for the calling org. Active-only by default.
      operationId: list_groups_v1_groups_get
      parameters:
        - name: include_archived
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              When true, the response includes archived groups in addition to
              active ones. Default false — most callers only need the
              currently-taggable set.
            default: false
            title: Include Archived
          description: >-
            When true, the response includes archived groups in addition to
            active ones. Default false — most callers only need the
            currently-taggable set.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupListEnvelope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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!,
            });

            const groups = await client.groups.list(); // active + archived
            for (const g of groups) console.log(g.id, g.name, g.status);
components:
  schemas:
    GroupListEnvelope:
      properties:
        object:
          type: string
          const: list
          title: Object
          description: Constant discriminator for the resource type.
          default: list
        data:
          items:
            $ref: '#/components/schemas/Group'
          type: array
          title: Data
          description: All matching groups in the org.
      type: object
      title: GroupListEnvelope
      description: |-
        Stripe-style list envelope. No cursor for now — group count is
        bounded by ``Settings.MAX_GROUPS_PER_ORG`` (default 100) so a
        single page is always sufficient.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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``.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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>`.'

````