Chat
Update a message.
Update a message. The request enforces thread membership and content visibility for the authenticated caller.
PUT
/
api
/
v1
/
chat
/
threads
/
{threadId}
/
messages
/
{messageId}
Update a message.
curl --request PUT \
--url https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "The nightly sync has completed successfully.",
"replyToMessageId": "00000000-0000-4000-8000-000000000001",
"attachments": [
{
"type": "STORAGE_UPLOAD",
"storageUploadSessionId": "00000000-0000-4000-8000-000000000001",
"chatAttachmentId": "00000000-0000-4000-8000-000000000002",
"name": "report.pdf",
"mimeType": "application/pdf"
}
],
"metadata": {
"source": "system",
"severity": "info"
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'The nightly sync has completed successfully.',
replyToMessageId: '00000000-0000-4000-8000-000000000001',
attachments: [
{
type: 'STORAGE_UPLOAD',
storageUploadSessionId: '00000000-0000-4000-8000-000000000001',
chatAttachmentId: '00000000-0000-4000-8000-000000000002',
name: 'report.pdf',
mimeType: 'application/pdf'
}
],
metadata: {source: 'system', severity: 'info'}
})
};
fetch('https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId}"
payload = {
"text": "The nightly sync has completed successfully.",
"replyToMessageId": "00000000-0000-4000-8000-000000000001",
"attachments": [
{
"type": "STORAGE_UPLOAD",
"storageUploadSessionId": "00000000-0000-4000-8000-000000000001",
"chatAttachmentId": "00000000-0000-4000-8000-000000000002",
"name": "report.pdf",
"mimeType": "application/pdf"
}
],
"metadata": {
"source": "system",
"severity": "info"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)Authorizations
Bearer JWT token or API Key (sk-*).
Body
application/json
Message body. Maximum 10kB.
Maximum string length:
10000Example:
"The nightly sync has completed successfully."
Message id this message replies to. Must belong to the same thread.
Example:
"00000000-0000-4000-8000-000000000001"
Attachment descriptors included with the message. Use STORAGE_UPLOAD with storageUploadSessionId for direct uploads that may still be finalizing.
Example:
[
{
"type": "STORAGE_UPLOAD",
"storageUploadSessionId": "00000000-0000-4000-8000-000000000001",
"chatAttachmentId": "00000000-0000-4000-8000-000000000002",
"name": "report.pdf",
"mimeType": "application/pdf"
}
]
Additional application metadata persisted with the message. Values may use any JSON type. Maximum 16 KiB and 64 top-level keys. Top-level keys starting with "__" are reserved for backend use.
Example:
{ "source": "system", "severity": "info" }
Response
200
OK.
⌘I
Update a message.
curl --request PUT \
--url https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "The nightly sync has completed successfully.",
"replyToMessageId": "00000000-0000-4000-8000-000000000001",
"attachments": [
{
"type": "STORAGE_UPLOAD",
"storageUploadSessionId": "00000000-0000-4000-8000-000000000001",
"chatAttachmentId": "00000000-0000-4000-8000-000000000002",
"name": "report.pdf",
"mimeType": "application/pdf"
}
],
"metadata": {
"source": "system",
"severity": "info"
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'The nightly sync has completed successfully.',
replyToMessageId: '00000000-0000-4000-8000-000000000001',
attachments: [
{
type: 'STORAGE_UPLOAD',
storageUploadSessionId: '00000000-0000-4000-8000-000000000001',
chatAttachmentId: '00000000-0000-4000-8000-000000000002',
name: 'report.pdf',
mimeType: 'application/pdf'
}
],
metadata: {source: 'system', severity: 'info'}
})
};
fetch('https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/chat/threads/{threadId}/messages/{messageId}"
payload = {
"text": "The nightly sync has completed successfully.",
"replyToMessageId": "00000000-0000-4000-8000-000000000001",
"attachments": [
{
"type": "STORAGE_UPLOAD",
"storageUploadSessionId": "00000000-0000-4000-8000-000000000001",
"chatAttachmentId": "00000000-0000-4000-8000-000000000002",
"name": "report.pdf",
"mimeType": "application/pdf"
}
],
"metadata": {
"source": "system",
"severity": "info"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)
