Project
List Project Contacts
Retrieve contacts from a specific contact group in the project
Endpoint
GET /api/project/contacts/{group_id}Path parameters
| Field | Type | Description |
|---|---|---|
group_id | string (UUID) | The ID of the contact group |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number, minimum 1 (default: 1) |
per_page | integer | No | Results per page, minimum 1 (default: 10) |
from | date | No | Filter contacts created on/after this date (YYYY-MM-DD) |
to | date | No | Filter contacts created on/before this date (YYYY-MM-DD) |
Contacts are returned newest first.
Example
curl "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1&per_page=10" \
-H "Authorization: Bearer YOUR_API_TOKEN"Response
The response is wrapped in a data key containing a Laravel paginator object:
{
"data": {
"current_page": 1,
"data": [
{
"name": "أحمد محمد",
"phone": "00218912345678",
"sex": "male",
"birthdate": "1992-03-12T00:00:00Z",
"city": null
}
],
"first_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=3",
"links": [
{ "url": null, "label": "« Previous", "active": false },
{ "url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1", "label": "1", "active": true },
{ "url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=2", "label": "Next »", "active": false }
],
"next_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=2",
"path": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 30
}
}Top-level response fields
| Field | Type | Description |
|---|---|---|
data | object | Laravel paginator object |
Pagination fields
| Field | Type | Description |
|---|---|---|
current_page | integer | Current page number |
data | array | Contact records on the current page |
first_page_url | string | URL of the first page |
from | integer|null | Index of the first record on the current page |
last_page | integer | Total number of pages |
last_page_url | string | URL of the last page |
links | array | Laravel pagination navigation links |
next_page_url | string|null | URL of the next page |
path | string | Base URL for this paginated resource |
per_page | integer | Results per page |
prev_page_url | string|null | URL of the previous page |
to | integer|null | Index of the last record on the current page |
total | integer | Total number of contacts in the group |
Contact object fields
| Field | Type | Description |
|---|---|---|
name | string | Contact name |
phone | string | Phone number in international format |
sex | string|null | Gender if provided |
birthdate | string|null | Birthdate if provided (ISO 8601) |
city | string|null | City if provided |
Error responses
404 Not Found — Group not found
The group does not exist or is not linked to this project.
{ "message": "Contact group not found" }422 Unprocessable Entity — Malformed group ID
{
"message": "The group id field must be a valid UUID.",
"errors": {
"group_id": ["The group id field must be a valid UUID."]
}
}401 Unauthorized
{ "message": "Invalid or missing token." }{ "message": "Unauthorized IP address." }