How SMS Gateways Work
Each SMS gateway represents a single upstream provider connection. When you send a message, LaraCopilot constructs the upstream endpoint from the gateway’s transport fields and posts the payload using HTTP Basic Auth. The fields that control this behaviour are:Only gateways with
is_active: true will process outbound messages. Deactivating a gateway does not affect messages already in a submitted state.Configuring a Gateway and Sending Your First Message
1
Create the gateway
In the admin panel, navigate to SMS → Gateways and click New Gateway. Fill in
name, provider_type, server_host, server_port, username, and password. Set use_ssl and is_active as appropriate for your provider, then save.2
Verify the gateway is active
Confirm the gateway card shows
is_active: true. If your provider requires a specific api_path (e.g. /api/v2/send), enter it in the API Path field — otherwise the platform defaults to send.3
Send a message via the API
POST to
/api/sms-gateways/{id}/send where {id} is the integer ID of the gateway. Supply the following JSON body:Message Statuses
Every message moves through the followingdelivery_status lifecycle:
The timestamps
requested_at, submitted_at, and delivered_at are set automatically as the message advances through each state. The raw provider response is stored in remote_response, and any error detail is captured in error_message.
Delivery Receipts (DLR Callbacks)
When the provider delivers the message to the handset it calls the URL supplied incallback_url during dispatch. If you did not supply a custom URL, LaraCopilot uses its own DLR endpoint:
message_id, id, or messageId in the request body to match the original SmsMessage, then updates delivery_status and sets delivered_at to the current timestamp. The full callback payload is merged into the remote_response field for debugging.
If you supply a custom
callback_url when sending, your server receives the DLR directly. You are responsible for forwarding it to the platform’s DLR endpoint, or for updating delivery_status through your own logic.