Skip to main content

Overview

List the contacts that belong to a specific contact group in your project. Supports pagination and optional date filtering.

Endpoint

GET https://sms.lamah.com/api/project/contacts/{group_id}

Path Parameters

ParameterTypeRequiredDescription
group_idstringThe contact group ID (UUID)

Query Parameters

ParameterTypeRequiredDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 25)
fromstring (date)Filter contacts created on/after this date (YYYY-MM-DD)
tostring (date)Filter contacts created on/before this date (YYYY-MM-DD)

Examples

curl --request GET \
  "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1&per_page=25" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Accept: application/json"

Response

Success Response (200 OK)

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "name": "أحمد محمد",
        "phone": "00218912345678",
        "sex": "male",
        "birthdate": "1992-03-12T00:00:00Z",
        "city": null
      }
    ],
    "per_page": 25,
    "last_page": 2,
    "total": 30
  }
}

Example Response (full paginator)

The response below shows a full Laravel paginator payload for a specific group. Group ID used: 0198faa2-8ddd-72c7-afce-32d980bd60fe
{
  "data": {
    "current_page": 1,
    "data": [
      {
        "name": "Test Contact1",
        "phone": "00218911234568",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact2",
        "phone": "00218911234569",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact3",
        "phone": "00218911234570",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact4",
        "phone": "00218911234571",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact5",
        "phone": "00218911234572",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact6",
        "phone": "00218911234573",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact7",
        "phone": "00218911234574",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact8",
        "phone": "00218911234575",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact9",
        "phone": "00218911234576",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      },
      {
        "name": "Test Contact0",
        "phone": "00218911234567",
        "sex": "male",
        "birthdate": "1989-12-31T23:00:00.000000Z",
        "city": null
      }
    ],
    "first_page_url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=1",
    "from": 1,
    "last_page": 7,
    "last_page_url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=7",
    "links": [
      { "url": null, "label": "« Previous", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=1", "label": "1", "active": true },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=2", "label": "2", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=3", "label": "3", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=4", "label": "4", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=5", "label": "5", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=6", "label": "6", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=7", "label": "7", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=2", "label": "Next »", "active": false }
    ],
    "next_page_url": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe?page=2",
    "path": "https://sms.lamah.com/api/project/contacts/0198faa2-8ddd-72c7-afce-32d980bd60fe",
    "per_page": 10,
    "prev_page_url": null,
    "to": 10,
    "total": 61
  }
}

Response Fields

FieldTypeDescription
dataobjectLaravel paginator object
data.data[]arrayList of contacts in the group
namestringContact name
phonestringPhone number in international format
sexstringGender if provided
birthdatestringBirthdate if provided
citystringCity if provided

Notes

  • Returns contacts for the specified group. Use pagination for large groups.
  • Phone numbers are stored in international format. Example Libyan mobile: +218912345678 (or 00218912345678).
  • Combine with the SMS endpoints to send to contacts using contact_group_id.