Update initial messages

Replace initial messages for an assistant.
Note: To delete initial messages, pass an empty array.

Request

PUT https://superinterface.ai/api/cloud/assistants/{assistantId}/initial-messages

Authentication

Include your private API key in the request headers:
Authorization: Bearer YOUR_PRIVATE_API_KEY

Path Parameters

ParameterTypeDescription
assistantIdstringThe ID of an existing assistant to update

Request Body

ParameterTypeRequiredDescription
initialMessagesarray of Initial messagesYesNew initial messages for the assistant

Example request

curl -X PUT "https://superinterface.ai/api/cloud/assistants/00cfe680-fee5-49b9-b386-6a7097eb8497/initial-messages" \ -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \ -H "Content-Type: application/json" -d '{ "initialMessages": [ { "role": "ASSISTANT", "content": "Welcome to the AI builder! How can I assist you today?" } ] }'

Response

ParameterTypeDescription
initialMessagesarray of Initial messagesList of updated initial messages for the assistant

Example response

{ "initialMessages": [ { "id": "00cfe680-fee5-49b9-b386-6a7097eb849", "role": "ASSISTANT", "content": "Welcome to the AI builder! How can I assist you today?", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T10:30:00Z" } ] }

Errors

The endpoint may return the following errors:

401 Unauthorized

This error occurs if the API key is invalid or missing.
{ "error": "Unauthorized", "message": "Invalid or missing API key" }