Skip to content
Xsender

Developers

Documentación API

Request formats, endpoints and response examples for your integration.

Antes de empezar

Authenticate requests with the Api-key header. Replace YOUR_API_KEY with your account API key in your own integration.

Send requests use POST with a JSON contact array and Content-Type: application/json. Use the integer id in data[] to retrieve the latest log status with GET. The id is a DispatchLog identifier, not a UUID or gateway UID.

Responses contain success (boolean), message (translated text) and data. A pending log confirms acceptance, not delivery. Log status is the raw enum string: cancel, pending, schedule, fail, delivered or processing.

All identifiers, recipients and response values below are illustrative samples. Replace them with values from your own requests; no sample API credentials are valid.

Enviar Email

POSThttps://test.wasender.io/api/email/send

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
contactArray of recipients and message data in the JSON body
contact[].subjectRequired string: email subject, at most 255 characters
contact[].emailRequired email address, at most 255 characters
contact[].messageRequired string: email content
contact[].sender_nameOptional string, at most 255 characters
contact[].reply_to_emailOptional reply-to email address, at most 255 characters
contact[].gateway_identifierOptional active email gateway UID available to your account; omit for automatic selection
contact[].schedule_atOptional scheduled date: Y-m-d H:i:s
attachments[]Optional files with multipart/form-data instead of JSON. File count and size follow the configured email attachment limits.

PHP request example

$curl = curl_init();
$postdata = json_decode('{
    "contact": [
        {
            "subject": "demo list info",
            "email": "receiver1@email.com",
            "message": "In publishing and graphic design, Lorem ipsum text",
            "sender_name": "name",
            "reply_to_email": "demo@gmail.com"
        },
        {
            "subject": "demo list info",
            "email": "receiver2@email.com",
            "message": "1",
            "sender_name": "name",
            "reply_to_email": "demo@gmail.com"
        }
    ]
}', true);
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/email/send',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
        'Content-Type: application/json',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

This excerpt shows the first returned log. The full data array contains the dispatch logs created for the request. Text-only SMS/WhatsApp logs have null file_info; WhatsApp media logs can contain uploaded-file metadata.

{
    "success": true,
    "message": "Solicitud de env\u00edo de correo electr\u00f3nico creada correctamente",
    "data": [
        {
            "id": 12001,
            "created_at": "2026-10-09 10:30:00",
            "status": "pending",
            "message": {
                "subject": "demo list info",
                "main_body": "In publishing and graphic design, Lorem ipsum text"
            },
            "contact": {
                "first_name": null,
                "last_name": null,
                "email_contact": "receiver1@email.com",
                "meta_data": null
            }
        }
    ]
}

Get status Email

GEThttps://test.wasender.io/api/get/email/{id}

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
idInteger DispatchLog id returned in data[] by the send request, supplied in the URL; not a UUID. The route permits omission, but retrieving a specific log requires its id.

Supply the numeric log id in the path segment. The status endpoints do not select a log from uid or id query-string parameters; an optional route segment does not provide a query-string fallback.

PHP request example

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/get/email/12001',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

{
    "success": true,
    "message": "Correo electr\u00f3nico obtenido correctamente de los registros",
    "data": {
        "id": 12001,
        "created_at": "2026-10-09 10:30:00",
        "status": "pending",
        "message": {
            "subject": "demo list info",
            "main_body": "In publishing and graphic design, Lorem ipsum text"
        },
        "contact": {
            "first_name": null,
            "last_name": null,
            "email_contact": "receiver1@email.com",
            "meta_data": null
        }
    }
}

Enviar SMS

POSThttps://test.wasender.io/api/sms/send

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
contactArray of recipients and message data in the JSON body
contact[].numberRequired recipient phone number, at most 255 characters
contact[].messageRequired string: message content
contact[].sms_typeOptional encoding hint consumed by the dispatcher: plain or unicode
contact[].gateway_identifierOptional SMS gateway UID available to your account; omit for automatic selection
contact[].schedule_atOptional scheduled date: Y-m-d H:i:s
methodOptional SMS transport preference: android or api; automatic selection and fallback apply when omitted

PHP request example

$curl = curl_init();
$postdata = json_decode('{
    "contact": [
        {
            "number": "11254352345",
            "message": "In publishing and graphic design, Lorem ipsum is a",
            "sms_type": "plain"
        },
        {
            "number": "32234213423",
            "message": "In publishing and graphic design, Lorem ipsum is a",
            "sms_type": "unicode"
        }
    ]
}', true);
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/sms/send',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
        'Content-Type: application/json',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

This excerpt shows the first returned log. The full data array contains the dispatch logs created for the request. Text-only SMS/WhatsApp logs have null file_info; WhatsApp media logs can contain uploaded-file metadata.

{
    "success": true,
    "message": "Solicitud de env\u00edo de SMS creada correctamente",
    "data": [
        {
            "id": 12011,
            "created_at": "2026-10-09 10:30:00",
            "status": "pending",
            "message": {
                "message": "In publishing and graphic design, Lorem ipsum is a",
                "file_info": null
            },
            "contact": {
                "first_name": null,
                "last_name": null,
                "sms_contact": "11254352345",
                "meta_data": null
            }
        }
    ]
}

Get status SMS

GEThttps://test.wasender.io/api/get/sms/{id}

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
idInteger DispatchLog id returned in data[] by the send request, supplied in the URL; not a UUID. The route permits omission, but retrieving a specific log requires its id.

Supply the numeric log id in the path segment. The status endpoints do not select a log from uid or id query-string parameters; an optional route segment does not provide a query-string fallback.

PHP request example

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/get/sms/12011',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

The current GET resource returns the phone number under contact.email_contact. This field name is intentional here to match the server response.

{
    "success": true,
    "message": "SMS obtenidos con \u00e9xito de los registros",
    "data": {
        "id": 12011,
        "created_at": "2026-10-09 10:30:00",
        "status": "pending",
        "message": {
            "message": "In publishing and graphic design, Lorem ipsum is a"
        },
        "contact": {
            "first_name": null,
            "last_name": null,
            "email_contact": "11254352345",
            "meta_data": null
        }
    }
}

Enviar WhatsApp

POSThttps://test.wasender.io/api/whatsapp/send

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
contactArray of recipients and message data in the JSON body
contact[].numberRequired recipient phone number, at most 255 characters
contact[].messageRequired string unless a template_name is supplied at request or contact level
contact[].mediaOptional: image, audio, video or document
contact[].urlOptional valid media URL when sending media
contact[].filenameOptional document filename, at most 255 characters
contact[].gateway_identifierOptional accessible gateway UID; overrides the request-level selection
contact[].gateway_typeOptional node or cloud; overrides the request-level selection
contact[].template_nameOptional Cloud template name, at most 512 characters; templates require cloud
contact[].template_languageOptional template language, at most 20 characters
contact[].template_componentsOptional array of Cloud template components
contact[].schedule_atOptional scheduled date: Y-m-d H:i:s
gateway_typeOptional node or cloud, applied to all contacts unless overridden per contact
gateway_identifierOptional accessible gateway UID, at most 191 characters
template_nameOptional approved Cloud template name, at most 512 characters
template_languageOptional template language, at most 20 characters
template_componentsOptional array of Cloud template components

PHP request example

$curl = curl_init();
$postdata = json_decode('{
    "contact": [
        {
            "number": "880123456789",
            "message": "In publishing and graphic design, Lorem ipsum"
        },
        {
            "number": "880123456789",
            "message": "In publishing and graphic design, Lorem ipsum",
            "media": "image",
            "url": "https://example.com/image.jpeg"
        },
        {
            "number": "880123456799",
            "message": "In publishing an audio file, Lorem ipsum",
            "media": "audio",
            "url": "https://example.com/audio.mp3"
        },
        {
            "number": "880123456799",
            "message": "In publishing a video file, Lorem ipsum",
            "media": "video",
            "url": "https://example.com/video.mp4"
        },
        {
            "number": "880123456799",
            "message": "In publishing a document file, Lorem ipsum",
            "media": "document",
            "url": "https://example.com/document.pdf"
        }
    ]
}', true);
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/whatsapp/send',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode($postdata),
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
        'Content-Type: application/json',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

This excerpt shows the first returned log. The full data array contains the dispatch logs created for the request. Text-only SMS/WhatsApp logs have null file_info; WhatsApp media logs can contain uploaded-file metadata.

{
    "success": true,
    "message": "Solicitud de env\u00edo de WhatsApp creada exitosamente",
    "data": [
        {
            "id": 12021,
            "created_at": "2026-10-09 10:30:00",
            "status": "pending",
            "message": {
                "message": "In publishing and graphic design, Lorem ipsum",
                "file_info": null
            },
            "contact": {
                "first_name": null,
                "last_name": null,
                "whatsapp_contact": "880123456789",
                "meta_data": null
            }
        }
    ]
}

Get status WhatsApp

GEThttps://test.wasender.io/api/get/whatsapp/{id}

Parámetros

ParameterDescripción
Api-keyAccount API key, sent as a request header
idInteger DispatchLog id returned in data[] by the send request, supplied in the URL; not a UUID. The route permits omission, but retrieving a specific log requires its id.

Supply the numeric log id in the path segment. The status endpoints do not select a log from uid or id query-string parameters; an optional route segment does not provide a query-string fallback.

PHP request example

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://test.wasender.io/api/get/whatsapp/12021',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
        'Api-key: YOUR_API_KEY',
    ),
));
$response = curl_exec($curl);
curl_close($curl);

Response example

Illustrative sample: success is boolean, id is an integer, created_at is Y-m-d H:i:s and status is a raw lowercase enum string. Message and contact are nested objects; optional metadata can be null.

The current GET resource returns the phone number under contact.email_contact. This field name is intentional here to match the server response.

{
    "success": true,
    "message": "Obtuve WhatsApp de los registros con \u00e9xito",
    "data": {
        "id": 12021,
        "created_at": "2026-10-09 10:30:00",
        "status": "pending",
        "message": {
            "message": "In publishing and graphic design, Lorem ipsum",
            "file_info": null
        },
        "contact": {
            "first_name": null,
            "last_name": null,
            "email_contact": "880123456789",
            "meta_data": null
        }
    }
}