إرسال
Project

Usage and Consumptions

View SMS usage and consumption history for the project

Endpoint

GET /api/project/consumptions

Query parameters

FieldTypeRequiredDescription
pageintegerNoPage number (default: 1)
per_pageintegerNoResults per page (default: 10)
fromdateNoFilter records on/after this date (YYYY-MM-DD)
todateNoFilter records on/before this date (YYYY-MM-DD)

Example

curl "https://sms.lamah.com/api/project/consumptions?from=2024-01-01&to=2024-01-31" \
  -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": [
      {
        "consumption": 5,
        "type": "SMS",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    ],
    "per_page": 10,
    "last_page": 10,
    "total": 250
  }
}

Top-level response fields

FieldTypeDescription
dataobjectLaravel paginator object

Pagination fields

FieldTypeDescription
current_pageintegerCurrent page number
per_pageintegerResults per page
last_pageintegerTotal number of pages
totalintegerTotal number of consumption records

Consumption record fields

FieldTypeDescription
consumptionintegerUnits consumed (e.g., SMS parts)
typestringFeature type: SMS or OTP
created_atstringISO 8601 timestamp when consumption was recorded
updated_atstringISO 8601 timestamp when record was last updated

Use this to build usage reports or billing dashboards for your users. Timestamps are returned in UTC.

On this page