Skip to main content
PUT
/
api
/
collections
/
{collection_id}
Update Collection
curl --request PUT \
  --url https://api.example.com/api/collections/{collection_id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "openapi_spec": {}
}
'

Authentication

Authorization
string
required
Bearer token: Bearer <admin_token>
This endpoint requires admin privileges.

Path Parameters

collection_id
string
required
Collection ID (UUID)

Request Body

name
string
Updated collection name
description
string
Updated description
openapi_spec
object
Updated OpenAPI specification

Example Request

curl -X PUT https://api.sari-platform.com/api/collections/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "description": "Updated description"
  }'

Response

Returns the updated collection object.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Name",
  "description": "Updated description",
  "updated_at": "2024-01-16T12:00:00Z"
}

What Happens

  1. Collection Updated - Changes saved to database
  2. Vector Regenerated - If name/description changed, embedding updated
  3. Cache Invalidated - All related caches cleared

Errors

StatusDescription
400Invalid request body
401Invalid or expired token
403Admin access required
404Collection not found