
A WhatsApp API send message workflow is straightforward once you understand the four core pieces involved: authentication, the business sender, the recipient and the message content.
With MoceanAPI, your backend authenticates an API request, identifies who the message is from and who should receive it, defines the WhatsApp content, and submits the request. If the request is accepted successfully, MoceanAPI returns a message ID that can later be associated with delivery events.
This guide focuses on that first outbound operation. For exact request syntax, current field requirements and code examples, always refer to the MoceanAPI API documentation.
Before making your first request, make sure you have the main pieces required for the outbound workflow.
You will need:
For a first send, you mainly need to understand how those components come together.
Current MoceanAPI documentation uses API Tokens as the authentication method for REST API requests. For the WhatsApp send operation, the token is supplied through Bearer authentication in the request header.
Authentication should happen from your backend or another secure server-side environment.
Do not expose a real API token in browser-side JavaScript, a public repository or client-side application code. Store credentials using an appropriate secure method, such as environment variables or a secrets-management solution that fits your infrastructure.
Older MoceanAPI documentation may still contain examples that use an API key and API secret. For a new implementation, follow the current /docs and its Bearer API-token model instead.
The sender is represented by:
mocean-from
Its job is simple:
Who is this WhatsApp message being sent from?
Current MoceanAPI documentation defines mocean-from as the registered WhatsApp Business sender phone number and requires the number to include its country code.
For example, this is not simply an arbitrary phone number selected by your application. It needs to correspond to the WhatsApp Business sender configured for your implementation.
The complete registration and WhatsApp Business Account onboarding process is a separate setup concern. At the send-request stage, the important point is that your application supplies the correct registered sender.
The recipient is represented by:
mocean-to
This answers:
Who should receive the message?
Current MoceanAPI documentation allows mocean-to to contain either a WhatsApp recipient phone number or a supported Business Scoped User ID (BSUID). Phone numbers must include the country code.
That BSUID support is increasingly important because a phone number should not be treated as the only possible WhatsApp user identifier.
MoceanAPI explains that a BSUID is generated by Meta for a user-business pair and can be used to message the user when their phone number is not available to the business. MoceanAPI also recommends retaining relevant BSUID information for future communication where applicable.
For your first implementation, the practical lesson is simple: validate the identifier you are sending and do not hard-code an assumption that every recipient will always be represented only by a phone number.
The actual WhatsApp message is represented by:
mocean-content
This defines what you want to send.
MoceanAPI currently documents several supported content families, including:
For a first-send workflow, keep the mental model simple and start with text:
message type → message text
The current documentation shows text content using a type of text together with the message text itself. The exact JSON structure should come from the live API reference rather than being copied permanently into a blog article.
If you later need images, video, documents, buttons, lists or other supported content, those message types introduce their own content structures.
Free-form messaging is not available in every WhatsApp messaging context.
Under WhatsApp’s current Business Messaging Policy, a business can reply without an approved template within the 24-hour customer-service window following the user’s last message. Outside that window, business-initiated messaging must use an approved message template.
MoceanAPI’s current API documentation reflects the same high-level rule: templates are required for customers who have not yet messaged the business or who have not sent a message within the previous 24 hours.
Its support guidance also states that a business initiating communication without an open customer-service conversation must begin with a template message.
So before using a simple text message, your application needs to know whether the current WhatsApp messaging context allows it.
Detailed template creation, categories, approval and management are separate topics. For this send operation, the key decision is simply:
Can I send free-form content here, or does this message require an approved template?
Review the WhatsApp Business Messaging Policy for current messaging rules. For platform-level implementation guidance, see the official WhatsApp Business Platform developer documentation.
At this stage, the pieces come together:
Bearer authentication
Current MoceanAPI documentation lists the WhatsApp send endpoint as:
POST https://rest.moceanapi.com/rest/2/send-message/whatsapp
It defines mocean-from, mocean-to and mocean-content as required request elements, while mocean-event-url is optional.
The optional mocean-event-url specifies a webhook destination for delivery events related to the requested message.
Conceptually, each part has a clear responsibility:
Component | Purpose |
Bearer API token | Authenticates your application |
mocean-from | Identifies the registered WhatsApp Business sender |
mocean-to | Identifies the recipient |
mocean-content | Defines the message being sent |
mocean-event-url | Optionally provides a destination for delivery events |
If you are working out how to send a message through the WhatsApp API, this is the main model to remember.
Do not build your production request from a simplified blog table alone. Use the current MoceanAPI WhatsApp API reference for the exact endpoint, header, JSON structure and current field requirements.
One of the most important distinctions in a WhatsApp API to send message workflow is the difference between:
API request accepted
and
message delivered
and
message read.
They are not the same event.
Current MoceanAPI documentation states that a successful send request returns HTTP status 202. The successful response contains a status value and a message_id.
That means the request has successfully reached the appropriate API stage. It does not mean the recipient has already received or read the WhatsApp message.
The returned message_id gives your application a reference to the message transaction.
Depending on your implementation, you may retain that identifier so that later delivery events can be connected with the original outbound message.
MoceanAPI’s delivery-event documentation explicitly states that the webhook message_id is associated with the transaction and comes from the HTTP response of the WhatsApp send request.
You do not need a particular database schema to make use of this. The important design principle is simply to avoid discarding an identifier that your application may need later.
The high-level lifecycle looks like this:
send request accepted
→ message ID returned
→ WhatsApp delivery lifecycle
→ delivery event
Current MoceanAPI documentation reports delivery states including:
The documentation also notes that read-receipt behaviour can affect whether a read event is available.
This matters because the initial API response and the later message outcome solve two different problems.
The send response tells your application whether the outbound request was accepted.
Delivery events tell your application what happened afterwards.
If your application needs to track delivery or customer responses, that becomes a webhook and event-processing implementation rather than part of the initial send request.
A first implementation often fails for relatively simple reasons.
Do not copy an old API-key/API-secret example and assume it is the current method. Current MoceanAPI /docs uses Bearer API-token authentication.
The API token is a credential. Keep authenticated requests in an appropriate backend or server-side component.
Check that mocean-from matches the registered WhatsApp Business sender you intend to use.
Verify the recipient identifier and country-code formatting. Also remember that MoceanAPI currently supports BSUID as well as a phone number.
Check the current customer-service window and template rules before deciding which content type to send.
A successful request is not proof that the message has been delivered or read. Those are later lifecycle states.
If your application needs delivery tracking or correlation, retain the returned message ID.
The standard WhatsApp send operation is a programmable messaging API request. It should not be described as a dedicated bulk campaign system, audience-management platform or campaign scheduler.
Before moving a sending workflow into production, run a controlled test.
Use this checklist:
MoceanAPI also documents a WhatsApp Sandbox for testing supported sending and receiving behaviour using configured test numbers and trial templates. Verify the latest sandbox procedure in current MoceanAPI support material before relying on it for a test workflow.
The complete first-send mental model is:
your application/backend
→ Bearer authentication
→ MoceanAPI WhatsApp API
→ WhatsApp recipient
MoceanAPI provides the programmable WhatsApp messaging layer. Your own application still decides why the message should be sent, which customer it relates to, what business action triggered it and what your system should do with later events.
If you need a WhatsApp Business API to send message requests from your application, start by understanding this workflow, then move to the official reference for implementation.
Review the MoceanAPI API documentation for the exact current endpoint, headers, request structure and response fields.
You can also explore MoceanAPI WhatsApp API to review the broader product and its supported business messaging capabilities.

At a high level, the request needs authentication, a registered sender, a recipient and message content. MoceanAPI currently represents those messaging concepts with mocean-from, mocean-to and mocean-content, with an optional event URL for delivery callbacks.
The message ID identifies the outbound messaging transaction. It can later be used to associate delivery events with the message that your application originally submitted.
No. MoceanAPI currently returns HTTP 202 for a successful send request, while delivery is represented later through message states such as sent, delivered, read or failed.
Yes. Current MoceanAPI documentation supports a Business Scoped User ID, or BSUID, as an alternative recipient identifier where applicable. MoceanAPI explains that BSUIDs allow businesses to address users when their phone number is unavailable.
Start with the API token, sender, recipient format, message content and whether the current messaging context requires a template. Then compare the request and returned error information with the current MoceanAPI API documentation rather than relying on an older implementation example.