Contacts API

Manage your contact list — create, list, update, and suppress contacts.

GET /v1/contacts

List all contacts with pagination and filtering.

ParameterTypeDefaultDescription
limitinteger50Results per page (max 100)
offsetinteger0Offset for pagination
tagstring-Filter contacts by tag
suppressedboolean-Filter by suppression status
cURL
curl https://api.yoursend.dev/v1/contacts?limit=20&tag=vip \
  -H "Authorization: Bearer ys_live_..."
Response
{
  "contacts": [
    {
      "id": "con_abc123",
      "email": "user@example.com",
      "phone": "+14155551234",
      "name": "Jane Doe",
      "tags": ["vip", "beta"],
      "suppressed": false,
      "metadata": { "plan": "pro" },
      "created_at": "2025-01-01T00:00:00Z"
    }
  ],
  "total": 1,
  "limit": 20,
  "offset": 0
}

GET /v1/contacts/:id

Get a single contact by ID.

cURL
curl https://api.yoursend.dev/v1/contacts/con_abc123 \
  -H "Authorization: Bearer ys_live_..."

POST /v1/contacts

Create a new contact. Either email or phone is required.

FieldTypeRequiredDescription
emailstring*Email address (* either email or phone required)
phonestring*Phone number in E.164 format
namestringNoDisplay name
tagsstring[]NoArray of tags
metadataobjectNoCustom key-value metadata
sourcestringNoSource of the contact (default: "api")
cURL
curl -X POST https://api.yoursend.dev/v1/contacts \
  -H "Authorization: Bearer ys_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "phone": "+14155551234",
    "name": "Jane Doe",
    "tags": ["vip"],
    "metadata": { "plan": "pro" }
  }'

PUT /v1/contacts/:id

Update an existing contact. Pass only the fields you want to change.

FieldDescription
email, phone, nameUpdate contact info
tags, metadataUpdate tags or metadata
email_ok, sms_ok, whatsapp_ok, voice_okChannel opt-in preferences
suppressedSet to true to suppress the contact from future sends
suppressed_reasonReason for suppression (e.g. "unsubscribed", "bounced")
cURL
curl -X PUT https://api.yoursend.dev/v1/contacts/con_abc123 \
  -H "Authorization: Bearer ys_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "tags": ["vip", "enterprise"], "suppressed": false }'