cURL
curl "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/workers/6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24/messages?order=asc&limit=30" \
-H "Authorization: Bearer $WORKLAYER_API_KEY"const response = await fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/workers/6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24/messages?order=asc&limit=30', {
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
},
});
const data = await response.json();
console.log(data);{
"messages": [
{
"id": "msg_01",
"role": "user",
"parts": [
{
"type": "text",
"text": "Send the tracking number of order 1188 to the customer of ticket 4821."
}
]
},
{
"id": "msg_02",
"role": "assistant",
"parts": [
{
"type": "dynamic-tool",
"toolCallId": "toolu_01Qx8",
"toolName": "zendesk_add_comment",
"input": null,
"state": "output-available",
"output": null
},
{
"type": "text",
"text": "I added the tracking number 1Z999AA10123456784 to ticket 4821."
}
]
}
],
"nextCursor": null
}{
"statusCode": 400,
"message": "Invalid cursor for this request.",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Worker not found.",
"error": "Not Found"
}{
"code": "worker_history_group_too_large",
"message": "More than 512 stored rows share a timestamp."
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Workers
Get Worker Messages
Returns a Worker’s saved message history in AI SDK UIMessage format. Internal execution steps and tool inputs are omitted.
GET
/
v1
/
rooms
/
{roomId}
/
workers
/
{workerId}
/
messages
cURL
curl "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/workers/6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24/messages?order=asc&limit=30" \
-H "Authorization: Bearer $WORKLAYER_API_KEY"const response = await fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/workers/6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24/messages?order=asc&limit=30', {
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
},
});
const data = await response.json();
console.log(data);{
"messages": [
{
"id": "msg_01",
"role": "user",
"parts": [
{
"type": "text",
"text": "Send the tracking number of order 1188 to the customer of ticket 4821."
}
]
},
{
"id": "msg_02",
"role": "assistant",
"parts": [
{
"type": "dynamic-tool",
"toolCallId": "toolu_01Qx8",
"toolName": "zendesk_add_comment",
"input": null,
"state": "output-available",
"output": null
},
{
"type": "text",
"text": "I added the tracking number 1Z999AA10123456784 to ticket 4821."
}
]
}
],
"nextCursor": null
}{
"statusCode": 400,
"message": "Invalid cursor for this request.",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Worker not found.",
"error": "Not Found"
}{
"code": "worker_history_group_too_large",
"message": "More than 512 stored rows share a timestamp."
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
Your factory's Worklayer API key (wrk-...). See Get an API key and Authentication. Requests sent from the playground execute live against your factory.