Fetch Groups
Fetches all groups associated with the sub-account.
Endpoint
GET https://api.smsleopard.com/v1/groups/fetch
Authentication
This endpoint requires Basic Authentication using your API credentials. Click to Generate Credentials (API Keys and Secrets) (opens in a new tab)
Code Examples
curl -X GET "https://api.smsleopard.com/v1/groups/fetch" \
-u "your_api_key:your_api_secret" \
-H "Content-Type: application/json"
Response
Success Response (200 OK)
{
"groups": [
{
"id": 2,
"account_id": 1,
"creator_id": 1,
"name": "Family",
"description": "",
"is_private": false,
"total_contacts": 1,
"created_at": "2025-05-06T11:12:55.22144Z",
"updated_at": "2025-05-06T11:12:55.22144Z"
}
],
"pagination": {
"count": 1,
"next_page": null,
"num_pages": 1,
"page": 1,
"per": 20,
"prev_page": null
}
}
Response Fields
Field | Type | Description |
---|---|---|
groups | array | Array of group objects |
groups[].id | integer | Unique identifier for the group |
groups[].account_id | integer | ID of the associated account |
groups[].creator_id | integer | ID of the user who created the group |
groups[].name | string | Name of the group |
groups[].description | string | Description of the group |
groups[].is_private | boolean | Whether the group is private |
groups[].total_contacts | integer | Number of contacts in the group |
groups[].created_at | string | ISO 8601 timestamp of creation |
groups[].updated_at | string | ISO 8601 timestamp of last update |
pagination | object | Pagination information |
pagination.count | integer | Total number of groups |
pagination.next_page | integer|null | Next page number (if available) |
pagination.num_pages | integer | Total number of pages |
pagination.page | integer | Current page number |
pagination.per | integer | Number of items per page |
pagination.prev_page | integer|null | Previous page number (if available) |