Public API

Queue a text, photo, video or document message to a WhatsApp number

post/v1/messages

Request

  • Base URL: https://otprun.com
  • URL: https://otprun.com/v1/messages
  • Auth: HTTP bearer

Query parameters

waitinteger

Seconds to wait for the delivery outcome, up to 15. The answer then says delivered, or why the message did not reach the phone

Request body

idempotency_keystring
send_atstring date-time

Send later, at this RFC 3339 time, up to 60 days ahead; for reminders

slot_idstring

Send from this slot instead of the automatic choice

textstring

Message text; with media it is the caption, up to 1024 characters, and may be empty

tostring required

Recipient phone in international format such as +77010000000 (spaces, dashes and brackets are ignored), or the name or alias of a saved contact

Response

Accepted

attemptsinteger required
bodystring required
channel'whatsapp_gateway' | 'telegram' | 'telegram_gateway' | 'whatsapp_official' required
contact_namestring required

Name of the recipient in the address book, empty if not saved

created_atstring date-time required
delivered_atstring date-time nullable required
edited_atstring date-time nullable required

When the text was last edited after sending, null if never

error_codestring required
error_detailstring required

The error WhatsApp returned on the last failed attempt, empty when there was none

failed_atstring date-time nullable required
idstring uuid required
outcome'delivered' | 'on_the_way' | 'retrying' | 'unconfirmed' | 'undecrypted' | 'not_delivered' required

What happened to the message in plain terms: unconfirmed means WhatsApp accepted it but the phone has not confirmed it for 10 minutes

project_idinteger required
purpose'notification' | 'otp' required
read_atstring date-time nullable required
revoked_atstring date-time nullable required

When the message was deleted for everyone, null if not

scheduled_atstring date-time required

Earliest moment the gateway sends the message

sent_atstring date-time nullable required
slot_idstring nullable required
status'queued' | 'sending' | 'sent' | 'delivered' | 'read' | 'failed' required
to_phonestring required

Changes

No recorded changes to this operation across all 1 revision of this API.