update_ai_chat

ArtificialIntelligenceApi.update_ai_chat(chat_id, role_id, action, content_type=None, update_chat_request=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Update chat details or trigger summarization

Requires owner access and action. action=update applies Title, Keywords, and/or Visibility from the body (all optional; omitted fields are unchanged). Visibility is project chats only and can only be set to public (cannot change public back to private). Empty or unchanged body returns “No updates performed.” action=summarize starts summary generation (needs at least 2 messages; body unused).

Parameters:
  • chat_id (str) – Unique identifier of the chat. (required)

  • role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)

  • action (str) – update changes title/keywords/visibility. summarize triggers summary generation. Any other value is rejected. (required)

  • content_type (str) – Request body media type. Optional for action=summarize.

  • update_chat_request (UpdateChatRequest) – Optional. For action=update, Title, Keywords, and/or Visibility. Unused for action=summarize. Extra fields are ignored.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

MessageResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /ai/playground/chats/{chat_id}

Parameter examples

Name

In

Example

chat_id

path

"123e4567-e89b-12d3-a456-426614174000"

Content-Type

header

"application/json"

role_id

header

"custom-role-123e4567-e89b-12d3-a456-426614174000"

action

query

"update"

Request

Optional. For action=update, Title, Keywords, and/or Visibility. Unused for action=summarize. Extra fields are ignored.

The request body is optional.

Update title

{
  "Title": "Q2 sales review"
}

Update keywords

{
  "Keywords": [
    "sales",
    "q2"
  ]
}

Update title and keywords

{
  "Title": "Q2 sales review",
  "Keywords": [
    "sales",
    "q2"
  ]
}

Make project thread public (project chats only)

{
  "Visibility": "public"
}

No body needed for summarize

{}

Success (HTTP 200)

update with changes returns “Chat updated successfully.” Unchanged body returns “No updates performed.” summarize returns “Chat summary generation triggered.” or “Chat summary generation is in progress.”

Fields changed

{
  "Message": "Chat updated successfully."
}

No field changes

{
  "Message": "No updates performed."
}

Summarize started

{
  "Message": "Chat summary generation triggered."
}

Summarize already running

{
  "Message": "Chat summary generation is in progress."
}

Errors

Documented error codes: IPV-1041, AUTH-1012, AI-1008, AUTH-1001, AUTH-1011, GE-1008, DB-1002.

HTTP 400

Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1041 (invalid action or visibility), AUTH-1012 (not owner), AI-1008 (summarize with fewer than 2 messages), AUTH-1001 (missing role_id), AUTH-1011 (caller not authorized).

Missing role_id header

{
  "Message": "AUTH-1001 - Missing role information in event header"
}

Caller not authorized

{
  "Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}

Invalid action query parameter

{
  "Message": "IPV-1041 - Invalid parameter - action, allowed values/keys are [update, summarize]"
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1008 (unexpected backend failure), DB-1002 (persistence failure).

Unexpected backend failure

{
  "Message": "GE-1008 - Could not complete the request. Please try again."
}