Send a task message
const url = 'https://api.gopromptless.ai/v1/triggers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"message":"Also document the 429 rate-limit response for this endpoint."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.gopromptless.ai/v1/triggers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "message": "Also document the 429 rate-limit response for this endpoint." }'Append a message to the conversation of a task submitted through POST /v1/triggers, continuing the reply on that same task. Available for tasks submitted over the API or MCP and for tasks created through MCP request_changes.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Identifier of the task, as returned by POST /v1/triggers.
Header Parameters
Section titled “Header Parameters”Optional key of up to 255 characters that makes the message send safe to retry. Reusing the key with the same text returns the original stored message with deduplicated set to true. Reusing it with different text returns 409 idempotency_conflict.
Request Bodyrequired
Section titled “Request Bodyrequired”JSON request body for appending a message to a task’s conversation.
object
The instruction to add. Non-empty after trimming, up to 20,000 characters.
Responses
Section titled “Responses”An idempotent replay of a message stored earlier under the same Idempotency-Key.
Response body returned when a task message is stored or replayed.
object
A single message in a task’s conversation.
object
Stable, immutable identifier for the message. Deduplicate on it.
Identifier of the task this message belongs to.
The message’s order within the task.
Who wrote the message.
object
The customer’s email when available, otherwise null.
ISO 8601 time the message was created.
The message text.
True when this response replays a message stored earlier under the same Idempotency-Key instead of storing a new one.
Example
{ "message": { "id": "b1e2c3d4-5678-90ab-cdef-1234567890ab", "trigger_event_id": "550e8400-e29b-41d4-a716-446655440000", "sequence": 1, "author": { "type": "promptless" } }, "deduplicated": false}Promptless appends the message to the task’s conversation.
Response body returned when a task message is stored or replayed.
object
A single message in a task’s conversation.
object
Stable, immutable identifier for the message. Deduplicate on it.
Identifier of the task this message belongs to.
The message’s order within the task.
Who wrote the message.
object
The customer’s email when available, otherwise null.
ISO 8601 time the message was created.
The message text.
True when this response replays a message stored earlier under the same Idempotency-Key instead of storing a new one.
Example
{ "message": { "id": "b1e2c3d4-5678-90ab-cdef-1234567890ab", "trigger_event_id": "550e8400-e29b-41d4-a716-446655440000", "sequence": 1, "author": { "type": "promptless" } }, "deduplicated": false}The task source does not support messages (unsupported_task_source), or the message is empty or longer than 20,000 characters, or an Idempotency-Key is blank or longer than 255 characters (invalid_message).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}The API key is missing, invalid, or revoked.
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}No task with this id exists for the organization (task_not_found).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}The task has finished and stops accepting messages (task_finished), or the caller reused the same Idempotency-Key with different text (idempotency_conflict).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}The trigger_event_id path parameter is not a valid UUID, or the request body is invalid.
Validation error body returned when the request fails schema validation.
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}Task intake or lookup is temporarily unavailable (runtime_store_unavailable).
Error body returned when an API trigger request is rejected.
object
Stable machine-readable error code.
Human-readable explanation of the error.
Example
{ "error": "authentication_failed", "message": "Authentication failed."}