Send a message
Send text, one or more media attachments, or both to a conversation participant.
Send text, one or more media attachments, or both to a conversation participant. At least one of content or media_urls is required.
Async delivery: the request returns 202 Accepted immediately with a pending message. Final outcome arrives via the message.sent / message.failed webhook, or by polling GET /v1/conversations/:id/messages.
Scheduling: pass scheduled_at to deliver the message at a future time instead of immediately. The message is returned as pending with scheduled_at set, and the delivery webhook fires when it goes out.
Free-form text messages are only allowed within 24 hours of the contact's last inbound message. Pass instagram.tag as HUMAN_AGENT to reply for up to 7 days after the contact's last message. The window check is always synchronous, so you receive a 422 immediately - for a scheduled message it is applied to scheduled_at, so a send that would land outside the window is rejected up front.
/v1/conversations/{id}/messagesPath Parameters
Text body of the message. Either non-blank content or at least one media URL is required.
1 <= lengthInstagram-specific message options.
Media to attach to the message. Either non-blank content or at least one media URL is required.
ISO 8601 timestamp to deliver the message at, instead of on submit. Must be in the future. The messaging window is checked against this time, so scheduling past the end of the contact's window is rejected with 422.
date-timeResponse Body
const body = JSON.stringify({})fetch("https://api.outstand.so/v1/conversations/string/messages", { method: "POST", headers: { "Content-Type": "application/json" }, body}){
"success": true,
"message": {
"id": "3kPqR",
"conversationId": "string",
"platformMessageId": "string",
"direction": "inbound",
"senderId": "string",
"content": "string",
"mediaUrls": [
"string"
],
"status": "pending",
"error": "string",
"scheduledAt": "2019-08-24T14:15:22Z",
"platformSentAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z"
}
}{
"success": false,
"error": "Conversation not found"
}{
"success": false,
"error": "Conversation not found"
}{
"success": false,
"error": "Conversation not found"
}{
"success": false,
"error": "Internal server error"
}