API documentation

Contacts API

Store recipients, names and groups so you can send without keeping your own list.

GET /contacts

Query params: page (default 1), limit (default 20), search, group_id.

200 OK
{
  "success": true,
  "data": {
    "contacts": [ { "id": 15, "phone": "+233241234567", "name": "Ama Mensah", "email": null, "group_id": 2, "tags": ["vip"], "custom_fields": { "branch": "Osu" } } ],
    "pagination": { "page": 1, "limit": 20, "total": 1, "pages": 1 }
  }
}

POST /contacts

phonestring, requiredMobile number
name, emailstring, optional
group_idinteger, optionalContact group
tagsarray, optionalAny labels you choose
custom_fieldsobject, optionalAny extra data for personalisation
request
curl -X POST https://tiansms.com/api/v1/contacts 
  -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" 
  -d '{"phone":"+233241234567","name":"Ama Mensah","tags":["vip"],"custom_fields":{"branch":"Osu"}}'

Returns 201 Created with the contact in data.

GET /contacts/{id}

Returns a single contact, or 404 if it does not belong to your account.

PUT /contacts/{id}

Partial update — send only the fields you want to change.

DELETE /contacts/{id}

200 OK
{ "success": true, "message": "Contact deleted successfully" }