Rename or archive a knowledge collection
Rename, re-describe, archive or restore a collection. Sending null for a field is refused; send an empty string to clear it.
PATCH
/
knowledge
/
collections
/
{collection_id}
curl --request PATCH "$MITHUNAI_URL/mithunai/api/v1/knowledge/collections/0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"archived": true}'
import os, requests
collection_id = "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88"
response = requests.patch(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/collections/{collection_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
json={"archived": True},
timeout=60,
)
response.raise_for_status()
print(response.json())
const collectionId = '0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/collections/${collectionId}`,
{
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ archived: true }),
},
)
console.log(await response.json())
{
"id": "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88",
"name": "Product documentation",
"description": "Public docs and API reference",
"status": "archived",
"embedding_model": "text-embedding-3-small",
"embedding_dimensions": 1536,
"created_at": "2026-09-24T10:15:02.418331",
"updated_at": "2026-09-24T14:03:57.906214"
}
{
"code": "validation_error",
"message": "A collection's embedding cannot be changed after it is created."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The knowledge collection was not found." }
{ "code": "conflict", "message": "A knowledge collection with that name already exists." }
Every field is optional, and a field you leave out stays unchanged. A body that contains none of
name, description or archived is refused with 400. Sending null for a field is also refused with 400 rather than clearing it: to clear the description, send "".
Archiving retires a collection without deleting anything. An archived collection refuses new ingestion, and its documents stay searchable, so assistants that already use it keep answering from it. Send "archived": false to restore it. Archiving an archived collection succeeds. There is no endpoint that deletes a collection.
The embedding cannot be changed. A body that includes embedding_model or embedding_dimensions is refused with 400, even when the value matches the current one.
Renaming onto a name your organization already uses returns 409. Updating a collection requires a role that can manage knowledge. A read-only member receives 403. An unknown ID, a malformed ID, or another organization’s collection returns 404.
string
required
Collection ID (a UUID).
string
New display name, at most 200 characters. It is trimmed, and a name that is empty after trimming
is refused.
string
New description. Requests over 4,000 characters are refused. The stored value is trimmed and
truncated to 1,000 characters.
boolean
true to archive the collection, false to restore it.Response
Returns200 with the updated collection.
string
required
Collection ID (a UUID).
string
required
Display name.
string
required
Description.
string
required
active or archived.string
required
Embedding model. Unchanged.
integer
required
Vector width. Unchanged.
string
required
ISO 8601 timestamp, in UTC.
string
required
ISO 8601 timestamp, in UTC.
curl --request PATCH "$MITHUNAI_URL/mithunai/api/v1/knowledge/collections/0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"archived": true}'
import os, requests
collection_id = "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88"
response = requests.patch(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/collections/{collection_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
json={"archived": True},
timeout=60,
)
response.raise_for_status()
print(response.json())
const collectionId = '0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/collections/${collectionId}`,
{
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ archived: true }),
},
)
console.log(await response.json())
{
"id": "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88",
"name": "Product documentation",
"description": "Public docs and API reference",
"status": "archived",
"embedding_model": "text-embedding-3-small",
"embedding_dimensions": 1536,
"created_at": "2026-09-24T10:15:02.418331",
"updated_at": "2026-09-24T14:03:57.906214"
}
{
"code": "validation_error",
"message": "A collection's embedding cannot be changed after it is created."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The knowledge collection was not found." }
{ "code": "conflict", "message": "A knowledge collection with that name already exists." }
Last modified on November 7, 2026
curl --request PATCH "$MITHUNAI_URL/mithunai/api/v1/knowledge/collections/0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88" \
--header "Authorization: Bearer $MITHUNAI_API_KEY" \
--header "Content-Type: application/json" \
--data '{"archived": true}'
import os, requests
collection_id = "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88"
response = requests.patch(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/knowledge/collections/{collection_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
json={"archived": True},
timeout=60,
)
response.raise_for_status()
print(response.json())
const collectionId = '0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/knowledge/collections/${collectionId}`,
{
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ archived: true }),
},
)
console.log(await response.json())
{
"id": "0b6f2c14-8a3d-4e91-9c77-2f5b1d0a4e88",
"name": "Product documentation",
"description": "Public docs and API reference",
"status": "archived",
"embedding_model": "text-embedding-3-small",
"embedding_dimensions": 1536,
"created_at": "2026-09-24T10:15:02.418331",
"updated_at": "2026-09-24T14:03:57.906214"
}
{
"code": "validation_error",
"message": "A collection's embedding cannot be changed after it is created."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The knowledge collection was not found." }
{ "code": "conflict", "message": "A knowledge collection with that name already exists." }