Segments

List segment contacts

GET/segments/{id}/contactsScope contacts:read

Works out the segment's members at the moment you call, and returns them a page at a time.

To message everyone in a segment you do not need this: pass segmentId to Start a campaign and it is done in one call.

Path parameters

  • idstringrequired

    The segment's id from List segments.

Query parameters

  • limitinteger

    Up to 500. Defaults to 100.

  • offsetinteger

    How many to skip. Defaults to 0.

Good to know

  • Only contacts you can actually message are returned. Opted-out contacts and numbers WhatsApp refused are left out.
  • Keep paging while meta.hasMore is true. total can change between pages if contacts change while you read.

Errors

StatusCodeWhen
404NOT_FOUNDNo segment with that id.

Plus the errors any endpoint can return, such as a missing key or scope. See Errors.

# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl "https://api.wamafy.com/api/v1/public/segments/0f2c8a1e-6b3d-4c9a-8e2f-5d7b1a3c9e40/contacts?limit=500" \
  -H "Authorization: Bearer $WAMAFY_API_KEY"
Response 200
{
  "success": true,
  "data": [
    {
      "id": "9d3f6b2a-4e1c-4a8b-9f0d-2c7e5a1b3d64",
      "phone": "919876543210",
      "name": "Priya Sharma",
      "email": null,
      "tags": [
        "vip"
      ]
    }
  ],
  "meta": {
    "total": 128,
    "limit": 500,
    "offset": 0,
    "hasMore": false
  }
}

Base URL https://api.wamafy.com/api/v1/public

    List segment contacts - Wamafy API