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

# Update a collection

> Only `defaultTtlSeconds` can change. Indexes are fixed at creation: changing them would require rewriting every item in the collection.



## OpenAPI

````yaml /openapi.json patch /v1/memory/collections/{collection}
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    location requests, and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url,
    location_request, reaction, template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/memory/collections/{collection}:
    patch:
      tags:
        - Memory
      summary: Update a collection
      description: >-
        Only `defaultTtlSeconds` can change. Indexes are fixed at creation:
        changing them would require rewriting every item in the collection.
      operationId: updateMemoryCollection
      parameters:
        - $ref: '#/components/parameters/MemoryCollectionParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryCollectionUpdateRequest'
            example:
              defaultTtlSeconds: 2592000
      responses:
        '200':
          description: Collection updated.
          content:
            application/json:
              schema:
                type: object
                required:
                  - collection
                properties:
                  collection:
                    $ref: '#/components/schemas/MemoryCollection'
        '400':
          description: Invalid TTL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Collection not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    MemoryCollectionParam:
      name: collection
      in: path
      required: true
      description: Collection name.
      schema:
        type: string
  schemas:
    MemoryCollectionUpdateRequest:
      type: object
      description: Only the default TTL is mutable. Indexes are fixed at creation.
      required:
        - defaultTtlSeconds
      properties:
        defaultTtlSeconds:
          type: integer
          nullable: true
          description: New default TTL, or null to clear it.
          minimum: 60
          maximum: 63072000
    MemoryCollection:
      type: object
      description: A namespace of JSON documents addressed by key.
      required:
        - name
        - indexes
        - defaultTtlSeconds
        - status
        - createdAt
        - updatedAt
      properties:
        name:
          type: string
          example: orders
        indexes:
          type: array
          description: >-
            Fields that `POST /v1/memory/collections/{collection}/query` can
            filter on. Immutable after creation.
          items:
            type: object
            required:
              - field
            properties:
              field:
                type: string
        defaultTtlSeconds:
          type: integer
          nullable: true
          description: >-
            TTL applied to items written without their own `ttlSeconds`. Null
            means items are kept until deleted.
        status:
          type: string
          description: '`active`, or `deleting` while a delete drains in the background.'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````