update_ai_chat_config

ArtificialIntelligenceApi.update_ai_chat_config(role_id, ai_chats_config, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Set chat config

Updates the calling user’s AIChatsConfig. Body may include NotesExpirationDays and/or ChatExpirationDays (0-365). Omitted keys keep the stored value, or 180 / 30 if never set. Extra body fields are ignored. JSON body is required. Returns Message.

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

  • ai_chats_config (AIChatsConfig) – Partial or full config. Omitted fields keep existing or default values. Extra fields are ignored. (required)

  • content_type (str) – Request body media type.

  • _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/config

Parameter examples

Name

In

Example

Content-Type

header

"application/json"

role_id

header

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

Request

Partial or full config. Omitted fields keep existing or default values. Extra fields are ignored.

Set both retention values

{
  "NotesExpirationDays": 180,
  "ChatExpirationDays": 30
}

Update chat retention only

{
  "ChatExpirationDays": 60
}

Update notes retention only

{
  "NotesExpirationDays": 90
}

Disable automatic expiration (0 days)

{
  "NotesExpirationDays": 0,
  "ChatExpirationDays": 0
}

Success (HTTP 200)

Config saved.

Request / response example

{
  "Message": "Chats config updated successfully"
}

Errors

Documented error codes: IPV-1012, IPV-1001, IPV-1002, AUTH-1001, AUTH-1011.

HTTP 400

Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1012 (NotesExpirationDays out of range), IPV-1001 (missing ChatExpirationDays), IPV-1002 (user not found), 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"
}

Retention days out of range

{
  "Message": "IPV-1012 - Invalid input parameter(s) - NotesExpirationDays, allowed range is 0 to 365"
}