v8

OpenAPI 3.1.02026-08-033623795.0 MB
Ai chats

Update ai chat

Update an AI chat's title, notification preferences, or associated company context.

Required permissions:

  • ai_chat:update
patch/ai_chats/{id}

Path parameters

idstring required
Example:aich_xxxxxxxxxxxxx

The unique identifier of the AI chat to update (e.g., "ai_chat_XXXXX").

Request body

current_company_idstring nullable

The unique identifier of the company to set as context for the AI chat (e.g., "biz_XXXXX").

notification_preference'all' | 'none'

The notification preference for an AI chat

titlestring nullable

The new display title for the AI chat thread (e.g., "Help with billing").

Response

A successful response

blended_token_usagestring required

The total number of tokens consumed across all messages in this conversation.

created_atstring date-time required

The datetime the ai chat was created.

idstring required

The unique identifier for the ai chat.

last_message_atstring date-time nullable required

The timestamp of the most recent message in this conversation. Null if no messages have been sent yet.

message_countinteger required

The total number of messages exchanged in this conversation.

notification_preference'all' | 'none' required

The notification preference for an AI chat

titlestring nullable required

A short descriptive title for this AI chat conversation. Null if no title has been set.

updated_atstring date-time required

The datetime the ai chat was last updated.

Example response

{
  "blended_token_usage": "123.45",
  "created_at": "2023-12-01T05:00:00.401Z",
  "id": "aich_xxxxxxxxxxxxx",
  "last_message_at": "2023-12-01T05:00:00.401Z",
  "message_count": 42,
  "title": "Weekly Revenue Analysis",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "user": {
    "id": "user_xxxxxxxxxxxxx"
  }
}