Skip to main content
PATCH
/
v1
/
chats
/
{chat_id}
Update Chat
curl --request PATCH \
  --url https://api.cuadra.ai/v1/chats/{chat_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Updated Support Chat",
  "systemPrompt": "You are a helpful assistant.",
  "metadata": "<unknown>"
}
'
{
  "id": "a4f0c0a2-4b1d-4e57-8a2a-0c18f9d4b1e2",
  "organizationId": "org_abc123",
  "title": "Quarterly Planning",
  "modelId": "84d6f2f1-27a5-4b5c-8a53-e2f7f1f5b0a3",
  "systemPrompt": "You are a project planning assistant.",
  "metadata": {
    "priority": "high"
  },
  "createdAt": "2025-09-01T10:00:00Z",
  "updatedAt": "2025-09-01T10:05:00Z",
  "createdBy": "member_xyz789",
  "visibility": "private",
  "documentsCount": 0,
  "messages": []
}

Authorizations

Authorization
string
header
required

JWT token from Stytch B2B authentication (magic link, SSO, or M2M)

Headers

Idempotency-Key
string | null

Path Parameters

chat_id
string
required

Chat ID

Example:

"chat_abc123"

Body

application/json

Request schema for updating a chat.

title
string | null

Updated chat title

Maximum string length: 500
Example:

"Updated Support Chat"

systemPrompt
string | null

System-level instructions for the AI model.

Example:

"You are a helpful assistant."

metadata
any

Response

Updated chat returned

Chat response with full details.

createdAt
string<date-time>
required

Timestamp when the resource was created

Example:

"2024-01-15T10:30:00Z"

updatedAt
string<date-time>
required

Timestamp when the resource was last updated

Example:

"2024-01-15T14:45:00Z"

organizationId
string
required

Organization ID for tenant isolation

Required string length: 1 - 64
Example:

"org_abc123"

id
string
required

Unique chat identifier

Example:

"chat_abc123"

modelId
string
required

Identifier of the AI model used for this chat.

Example:

"model_large-model"

createdBy
string
required

ID of the user who created this chat

Example:

"user_xyz789"

title
string | null

Chat title

Maximum string length: 500
Example:

"Product Support Chat"

systemPrompt
string | null

System-level instructions for the AI model.

Example:

"You are a helpful customer support assistant."

metadata
any
model
ModelOut · object

Full model object (included when expanded with ?expand[]=model)

Example:
{
"contextWindow": 128000,
"createdAt": "2025-09-08T06:33:19Z",
"creditMultiplier": 2,
"description": "Advanced language model for complex tasks",
"displayName": "large-model Omni",
"enabled": true,
"id": "550e8400-e29b-41d4-a716-446655440000",
"isSystemModel": false,
"maxTokensPerRequest": 4096,
"metadata": {},
"modelName": "large-modelo",
"provider": "provider-a",
"supportsStreaming": true,
"updatedAt": "2025-09-08T06:33:19Z"
}
messages
MessageOut · object[]

Messages in this chat

documentsCount
integer
default:0

Total number of documents associated with the chat.

Required range: x >= 0
Example:

3

visibility
enum<string>
default:private

Chat visibility level

Available options:
private,
organization,
shared
Example:

"private"

sharedWith
string[] | null

List of user IDs this chat is shared with

Example:
["user_123", "user_456"]
deletedAt
string<date-time> | null

Timestamp when the chat was soft-deleted

deletedBy
string | null

ID of the user who deleted this chat

source
string
default:api

Request origin: api, m2m, connector

sourceDetail
string | null

Specific source: dashboard, slack, google_drive, etc.