API docs
Contacts
Add your customers to your WeSend contact list as they sign up, then send them promotions from the dashboard in one click.
A contact is someone you send promotions to: a phone number, an email address or both. Add them on the dashboard, from a CSV or Excel file, or with this API. Then, under Send, pick everyone, a group or a tag and send.
Promotions go out only between 09:00 and 21:00, Ulaanbaatar time. Every SMS starts with {brand}: and every email ends with an unsubscribe link, added automatically.
Add or update a contact
/v1/contactsAdds a contact, or updates the one with the same external_id, phone or email.
Call it whenever someone registers in your system. Sending the same person again updates them instead of adding a second contact: they are matched by external_id, then phone, then email.
curl -X POST https://dev-api.wesend.mn/v1/contacts \
-H "Authorization: Bearer $WESEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "user_1024",
"name": "Бат-Эрдэнэ",
"phone": "99112233",
"email": "[email protected]",
"company": "DoDo Shop",
"tags": [
"vip"
],
"groups": [
"Шинэ хэрэглэгч"
],
"marketing": {
"sms": true,
"email": true
}
}'{
"id": "0b9c1a52-6f0e-4d8b-9a3c-2f1e5d7c8a90",
"external_id": "user_1024",
"name": "Бат-Эрдэнэ",
"phone": "99112233",
"email": "[email protected]",
"company": "DoDo Shop",
"note": null,
"tags": [
"vip"
],
"groups": [
"Шинэ хэрэглэгч"
],
"marketing": {
"sms": "subscribed",
"email": "subscribed"
},
"sandbox": false,
"created_at": "2026-10-23T03:15:30.000Z",
"updated_at": "2026-10-23T03:15:30.000Z",
"created": true
}Request fields
phonestring- An 8-digit Mongolian mobile number.
phoneoremailis required. emailstring- An email address.
external_idstring- The person's id in your system, up to 100 characters. Finds the same person even after their phone or email changes.
namestring- Full name, up to 120 characters.
companystring- Company.
notestring- An internal note, up to 1,000 characters.
tagsstring[]- Up to 20 tags. Replaces the contact's tags when sent.
groupsstring[]- Group names. A group that does not exist yet is created. Replaces the contact's groups when sent.
marketing.smsbooleantrue: agreed to promotional SMS.false: said no.marketing.emailbooleantrue: agreed to promotional email.false: said no.
- A new contact answers
201, an updated one200;createdsays which. - Fields you leave out stay as they are.
nullclears a field. - A project keeps up to 100,000 contacts and 100 groups.
- Contacts added with a sandbox key are kept apart, never shown on the dashboard or sent to, and deleted after 30 days.
Consent to promotions
Each contact has a marketing state per channel: unknown, subscribed or unsubscribed. An unknown contact receives promotions until they say no; an unsubscribed one never does.
- A no sticks. Deleting a contact and adding it again, or an import, does not turn it back on.
- When someone turns promotions off in your app, send
marketing.sms: falsewithPATCH /contacts/{id}. SMS cannot be answered with STOP, so this is the main way an SMS opt-out reaches WeSend. truelifts a no your project recorded. It does not lift one the person made themselves, with the unsubscribe link or by marking an email as spam.
Add many at once
/v1/contacts/bulkUp to 1,000 contacts in one call. Each is answered on its own: one bad row does not stop the rest.
curl -X POST https://dev-api.wesend.mn/v1/contacts/bulk \
-H "Authorization: Bearer $WESEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contacts": [
{
"external_id": "user_1024",
"phone": "99112233",
"name": "Бат-Эрдэнэ"
},
{
"external_id": "user_1025",
"email": "[email protected]",
"name": "Сараа",
"marketing": {
"email": true
}
}
]
}'{
"created": 1,
"updated": 1,
"results": [
{
"id": "0b9c1a52-6f0e-4d8b-9a3c-2f1e5d7c8a90",
"created": false
},
{
"id": "7d3e2f10-1c4b-4a8e-9f62-3b5a7c9d0e21",
"created": true
}
]
}Find and list
/v1/contactsA page of contacts, or the one contact with an external_id, phone or email.
curl "https://dev-api.wesend.mn/v1/contacts?external_id=user_1024" \
-H "Authorization: Bearer $WESEND_API_KEY"Filters
external_id, phone, emailstring- Finds one contact.
qstring- Searches name, phone, email and company.
tagstring- Contacts with the tag.
groupstring- A group name.
page, limitnumber- The page, and 1 to 100 per page (50 by default).
/v1/contacts/{id}One contact.
/v1/contact-groupsThe project's groups.
Update and delete
/v1/contacts/{id}Changes only the fields that are sent.
curl -X PATCH https://dev-api.wesend.mn/v1/contacts/0b9c1a52-6f0e-4d8b-9a3c-2f1e5d7c8a90 \
-H "Authorization: Bearer $WESEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketing": {
"sms": false
}
}'/v1/contacts/{id}Deletes the contact. Any no it gave is kept.
curl -X DELETE https://dev-api.wesend.mn/v1/contacts/0b9c1a52-6f0e-4d8b-9a3c-2f1e5d7c8a90 \
-H "Authorization: Bearer $WESEND_API_KEY"{
"id": "0b9c1a52-6f0e-4d8b-9a3c-2f1e5d7c8a90",
"deleted": true
}