Contacts API
Fetch Groups

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

FieldTypeDescription
groupsarrayArray of group objects
groups[].idintegerUnique identifier for the group
groups[].account_idintegerID of the associated account
groups[].creator_idintegerID of the user who created the group
groups[].namestringName of the group
groups[].descriptionstringDescription of the group
groups[].is_privatebooleanWhether the group is private
groups[].total_contactsintegerNumber of contacts in the group
groups[].created_atstringISO 8601 timestamp of creation
groups[].updated_atstringISO 8601 timestamp of last update
paginationobjectPagination information
pagination.countintegerTotal number of groups
pagination.next_pageinteger|nullNext page number (if available)
pagination.num_pagesintegerTotal number of pages
pagination.pageintegerCurrent page number
pagination.perintegerNumber of items per page
pagination.prev_pageinteger|nullPrevious page number (if available)