Skip to main content

Overview

Retrieve a paginated list of your project’s SMS consumption records. Useful for billing, analytics, and usage tracking.

Endpoint

GET https://sms.lamah.com/api/project/consumptions

Query Parameters

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

Examples

curl --request GET \
  "https://sms.lamah.com/api/project/consumptions?page=1&per_page=25&from=2024-01-01&to=2024-12-31" \
  --header "Authorization: Bearer YOUR_API_TOKEN" \
  --header "Accept: application/json"

Response

Success Response (200 OK)

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "consumption": 5,
        "type": "SMS",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    ],
    "per_page": 25,
    "last_page": 10,
    "total": 250
  }
}

Response Fields

FieldTypeDescription
dataobjectLaravel paginator object
data.data[]arrayList of consumption records
consumptionintegerUnits consumed (e.g., SMS parts)
typestringFeature type, e.g., SMS or OTP
created_atstringTimestamp when consumption was recorded
updated_atstringTimestamp when record was updated

Notes

  • Records include SMS sends and other usage impacting your balance.
  • Timestamps are returned in UTC. Apply your desired timezone in reporting.
  • Filter by date range to analyze campaigns (e.g., Libyan market promo week).