Messages
API Reference​
List all messages in a thread.​
Returns a list of messages within a thread, allowing users to view the conversation flow.
path=/threads/{threadId}/messages
method=get
Request
JavaScript
const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/messages', {
method: 'GET',
headers: {"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
});
const data = await response.json();
Python
import requests
response = requests.get(
"https://api.umamiai.xyz/v1/threads/{threadId}/messages",
headers={"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
)
data = response.json()
Curl
curl -L \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
'https://api.umamiai.xyz/v1/threads/{threadId}/messages'
Response
[
{
"id": "text",
"assistant_id": "text",
"attachments": [
{
"file_id": "text",
"tools": []
}
],
"completed_at": 0,
"content": [
{
"text": {
"annotations": [],
"value": "text"
},
"type": "text"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"object": "thread.message",
"role": "user",
"run_id": "text",
"status": "in_progress",
"thread_id": "text"
}
]
Create a new message in a thread.​
Creates a new message within a thread, contributing to the conversation.
path=/threads/{threadId}/messages
method=post
Request
JavaScript
const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/messages', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"
},
body: JSON.stringify({
"role": "text",
"content": "text"
}),
});
const data = await response.json();
Python
import requests
response = requests.post(
"https://api.umamiai.xyz/v1/threads/{threadId}/messages",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={"role":"text","content":"text"}
)
data = response.json()
Curl
curl -L \
-X POST \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
-H 'Content-Type: application/json' \
'https://api.umamiai.xyz/v1/threads/{threadId}/messages' \
-d '{"role":"text","content":"text"}'
Response
{
"id": "text",
"assistant_id": "text",
"attachments": [
{
"file_id": "text",
"tools": []
}
],
"completed_at": 0,
"content": [
{
"text": {
"annotations": [],
"value": "text"
},
"type": "text"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"object": "thread.message",
"role": "user",
"run_id": "text",
"status": "in_progress",
"thread_id": "text"
}
Get details of a specific message.​
Retrieves a single message from a thread by its ID.
path=/threads/{threadId}/messages/{messageId}
method=get
Request
JavaScript
const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}', {
method: 'GET',
headers: {"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
});
const data = await response.json();
Python
import requests
response = requests.get(
"https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}",
headers={"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
)
data = response.json()
Curl
curl -L \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
'https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}'
Response
{
"id": "text",
"assistant_id": "text",
"attachments": [
{
"file_id": "text",
"tools": []
}
],
"completed_at": 0,
"content": [
{
"text": {
"annotations": [],
"value": "text"
},
"type": "text"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"object": "thread.message",
"role": "user",
"run_id": "text",
"status": "in_progress",
"thread_id": "text"
}
Update a message in a thread.​
Updates an existing message in a thread.
path=/threads/{threadId}/messages/{messageId}
method=post
Request
JavaScript
const response = await fetch('https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY"
},
body: JSON.stringify({}),
});
const data = await response.json();
Python
import requests
response = requests.post(
"https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}",
headers={"Content-Type":"application/json","Authorization": "Bearer YOUR_UMAMIAI_API_KEY"},
json={}
)
data = response.json()
Curl
curl -L \
-X POST \
-H 'Authorization: Bearer YOUR_UMAMIAI_API_KEY' \
-H 'Content-Type: application/json' \
'https://api.umamiai.xyz/v1/threads/{threadId}/messages/{messageId}' \
-d '{}'
Response
{
"id": "text",
"assistant_id": "text",
"attachments": [
{
"file_id": "text",
"tools": []
}
],
"completed_at": 0,
"content": [
{
"text": {
"annotations": [],
"value": "text"
},
"type": "text"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"object": "thread.message",
"role": "user",
"run_id": "text",
"status": "in_progress",
"thread_id": "text"
}