Messaging API
Contacts
Create, list, update, import, and export messaging contacts.
Contacts are the people you message. They also provide the audience for campaigns.
Create a contact
POST
https://api.tryvox.io/v1/messaging/contacts| Field | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | The contact's number. Use E.164 format |
name | string | No | Display name |
email | string | No | Email address |
tags | string | No | Tags, used to select campaign audiences |
country_code | string | No | Country of the number |
curl -X POST https://api.tryvox.io/v1/messaging/contacts \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{"phone_number": "+919812345678", "name": "Asha", "tags": "vip"}'List contacts
GET
https://api.tryvox.io/v1/messaging/contacts| Parameter | Description |
|---|---|
tag | Only contacts with this tag |
search | Free-text search |
opted_in | true or false |
page, per_page | Page number, and page size up to 100 (default 20) |
Other operations
| Method | Path | Purpose |
|---|---|---|
GET | /v1/messaging/contacts/{id} | Get one contact |
PUT | /v1/messaging/contacts/{id} | Update name, email, tags, or opted_in |
DELETE | /v1/messaging/contacts/{id} | Delete a contact |
GET | /v1/messaging/contacts/export | Export contacts |
Import from CSV
Upload a CSV file as the multipart field file. It must have a phone column.
curl -X POST https://api.tryvox.io/v1/messaging/contacts/import \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-F "file=@contacts.csv"| Data | Accepted column names |
|---|---|
| Phone (required) | phone, phone_number, phonenumber, mobile |
| Name | name, full_name, fullname, contact_name |
email, email_address | |
| Tags | tags, tag, labels |
| Country | country, country_code |
The response reports how many rows were imported and skipped.