---
title: "Update a collection"
method: PATCH
path: "/v1/memory/collections/{collection}"
tags: ["Memory"]
---

# Update a collection

`PATCH /v1/memory/collections/{collection}`

## Request

- Base URL: `https://api.zavu.dev`
- URL: `https://api.zavu.dev/v1/memory/collections/{collection}`
- Auth: HTTP bearer

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

## Path parameters

- `collection` string, required

## Request body

- MemoryCollectionUpdateRequest: Only the default TTL is mutable. Indexes are fixed at creation.
  - `defaultTtlSeconds` integer, nullable, required: New default TTL, or null to clear it.

## Response `200`

Collection updated.

- object
  - `collection` MemoryCollection, required: A namespace of JSON documents addressed by key.
    - `name` string, required
    - `indexes` object[], required: Fields that `POST /v1/memory/collections/{collection}/query` can filter on. Immutable after creation.
      - `field` string, required
    - `defaultTtlSeconds` integer, nullable, required: TTL applied to items written without their own `ttlSeconds`. Null means items are kept until deleted.
    - `status` string, required: `active`, or `deleting` while a delete drains in the background.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid TTL.
- `401`: Unauthorized.
- `404`: Collection not found.

## Changes

> 80 revisions in range; 1 not diffed.

- **2026-08-26** `6e8c555e1104`: 1 info
  - removed the non-success response with the status `403`
- **2026-08-26** `83caf7165722`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/changes/v1/memory/collections/:collection/patch.md)

---

[API](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api.md) - [All operations](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/revisions/75bc777b0ffb?raw)
