Skip to content

Test mode

View as Markdown

Drive the test-mode simulator on purpose. Test keys only.

Endpoints

Simulate a customer message

posthttps://api.saei.automize.sa/v1/test/inbound_messages
  • Scope: messages:send
  • Test keys only

As if a customer had just written to you. Fires message.received to your test endpoints and opens the simulated 24-hour window for that number. Test keys only.

Request body

  • fromstringrequired

    The customer number the message comes from, in E.164.

  • tostringoptional
  • typestringoptional

    One oftextbutton_reply

  • textobjectoptional
    Child fields (1)
    • bodystringoptional
  • button_replyobjectoptional
    Child fields (2)
    • idstringoptional
    • titlestringoptional
  • profile_namestringoptional
Response fields201
  • idstringrequired

    Unique id. Opaque: store it as a string of up to 64 characters.

  • object"message"required
  • livemodebooleanrequired
  • directionstringrequired

    outbound for messages you send, inbound for customer messages.

    One ofoutboundinbound

  • channelstringrequired

    One ofwhatsappinstagrammessenger

  • fromstring | nulloptional

    Sender, in E.164 for WhatsApp.

  • tostring | nulloptional

    Recipient, in E.164 for WhatsApp.

  • typestringrequired

    What kind of content the message carries.

  • textobjectoptional
    Child fields (1)
    • bodystringoptional
  • templateobjectoptional
    Child fields (4)
    • namestringoptional
    • languagestringoptional
    • variablesobjectoptional
    • bodystringoptional
  • imageobjectoptional

    Media messages carry link (or media_id), caption, filename and mime_type when known.

  • videoobjectoptional
  • audioobjectoptional
  • documentobjectoptional
  • stickerobjectoptional
  • locationobjectoptional
  • contactsarrayoptional
  • interactiveobjectoptional

    What you sent (type, body, buttons…), or for a customer's tap, reply: {id, title}.

  • reactionobjectoptional
  • statusstringrequired

    accepted → sent → delivered → read, or failed. Customer messages are received. Status changes arrive as webhook events.

    One ofacceptedsentdeliveredreadfailedreceived

  • errorobject | nulloptional

    Why delivery failed, when status is failed.

    Child fields (3)
    • codestring | nulloptional
    • titlestring | nulloptional
    • messagestring | nulloptional
  • referencestring | nulloptional

    Your own reference, echoed back from the send request and in every event.

  • conversation_idstring | nulloptional
  • provider_message_idstring | nulloptional

    WhatsApp's own message id (wamid).

  • contactobject | nulloptional
    Child fields (1)
    • namestring | nulloptional
  • contextobject | nulloptional

    For a reply, the message being replied to.

    Child fields (1)
    • provider_message_idstringoptional
  • created_atstring | nullrequired
  • updated_atstring | nulloptional
Errors this can return2
Try it
curl -X POST https://api.saei.automize.sa/v1/test/inbound_messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "+966500000004",
  "type": "text",
  "text": {
    "body": "مرحبا، أين طلبي؟"
  },
  "profile_name": "Sara"
}'
Response

The simulated inbound message.

{
  "id": "msg_48213",
  "object": "message",
  "livemode": false,
  "direction": "outbound",
  "channel": "whatsapp",
  "from": "+966112345678",
  "to": "+966501234567",
  "type": "text",
  "text": {
    "body": "string"
  },
  "template": {
    "name": "string",
    "language": "string",
    "variables": {},
    "body": "string"
  },
  "image": {},
  "video": {},
  "audio": {},
  "document": {},
  "sticker": {},
  "location": {},
  "contacts": [],
  "interactive": {},
  "reaction": {},
  "status": "accepted",
  "error": {
    "code": "string",
    "title": "string",
    "message": "string"
  },
  "reference": "string",
  "conversation_id": "string",
  "provider_message_id": "string",
  "contact": {
    "name": "string"
  },
  "context": {
    "provider_message_id": "string"
  },
  "created_at": "2026-10-01T09:30:00Z",
  "updated_at": "2026-10-01T09:30:00Z"
}

Force a message status

posthttps://api.saei.automize.sa/v1/test/messages/{id}/status
  • Scope: messages:send
  • Test keys only

Move a test message to sent, delivered, read or failed now and fire the matching event. Statuses only move forward. Test keys only.

Path parameters

  • idstringrequired

    The object's id.

Request body

  • statusstringrequired

    One ofsentdeliveredreadfailed

  • error_codestringoptional
  • error_messagestringoptional
Response fields200
  • idstringrequired

    Unique id. Opaque: store it as a string of up to 64 characters.

  • object"message"required
  • livemodebooleanrequired
  • directionstringrequired

    outbound for messages you send, inbound for customer messages.

    One ofoutboundinbound

  • channelstringrequired

    One ofwhatsappinstagrammessenger

  • fromstring | nulloptional

    Sender, in E.164 for WhatsApp.

  • tostring | nulloptional

    Recipient, in E.164 for WhatsApp.

  • typestringrequired

    What kind of content the message carries.

  • textobjectoptional
    Child fields (1)
    • bodystringoptional
  • templateobjectoptional
    Child fields (4)
    • namestringoptional
    • languagestringoptional
    • variablesobjectoptional
    • bodystringoptional
  • imageobjectoptional

    Media messages carry link (or media_id), caption, filename and mime_type when known.

  • videoobjectoptional
  • audioobjectoptional
  • documentobjectoptional
  • stickerobjectoptional
  • locationobjectoptional
  • contactsarrayoptional
  • interactiveobjectoptional

    What you sent (type, body, buttons…), or for a customer's tap, reply: {id, title}.

  • reactionobjectoptional
  • statusstringrequired

    accepted → sent → delivered → read, or failed. Customer messages are received. Status changes arrive as webhook events.

    One ofacceptedsentdeliveredreadfailedreceived

  • errorobject | nulloptional

    Why delivery failed, when status is failed.

    Child fields (3)
    • codestring | nulloptional
    • titlestring | nulloptional
    • messagestring | nulloptional
  • referencestring | nulloptional

    Your own reference, echoed back from the send request and in every event.

  • conversation_idstring | nulloptional
  • provider_message_idstring | nulloptional

    WhatsApp's own message id (wamid).

  • contactobject | nulloptional
    Child fields (1)
    • namestring | nulloptional
  • contextobject | nulloptional

    For a reply, the message being replied to.

    Child fields (1)
    • provider_message_idstringoptional
  • created_atstring | nullrequired
  • updated_atstring | nulloptional
Errors this can return2
Try it
curl -X POST https://api.saei.automize.sa/v1/test/messages/msg_test_01j9x3k2m4n5p6q7r8s9t0v1w2/status \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "failed",
  "error_code": "131026"
}'
Response

The message with its new status.

{
  "id": "msg_48213",
  "object": "message",
  "livemode": false,
  "direction": "outbound",
  "channel": "whatsapp",
  "from": "+966112345678",
  "to": "+966501234567",
  "type": "text",
  "text": {
    "body": "string"
  },
  "template": {
    "name": "string",
    "language": "string",
    "variables": {},
    "body": "string"
  },
  "image": {},
  "video": {},
  "audio": {},
  "document": {},
  "sticker": {},
  "location": {},
  "contacts": [],
  "interactive": {},
  "reaction": {},
  "status": "accepted",
  "error": {
    "code": "string",
    "title": "string",
    "message": "string"
  },
  "reference": "string",
  "conversation_id": "string",
  "provider_message_id": "string",
  "contact": {
    "name": "string"
  },
  "context": {
    "provider_message_id": "string"
  },
  "created_at": "2026-10-01T09:30:00Z",
  "updated_at": "2026-10-01T09:30:00Z"
}