Message Usage
Returns daily series and totals for used messages. Use it for consumption dashboards, internal alerts, and campaign reconciliation.
GET https://api.platica.mx/v1/usage/messages Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | Filters the response to one workspace. If omitted, returns all accessible workspaces | — |
startDate | string | ISO 8601 start date. If omitted, uses the start of the billing period | — |
endDate | string | ISO 8601 end date. If omitted, uses the end of the billing period | — |
groupBy | enum | Grouping dimension: type (default), channel, templateCategory, or campaign | — |
mode | enum | fast (default) reads daily aggregates; full scans transactions for detailed cost fields | — |
Response
{
"workspaces": [
{
"id": "g6yCA16pkWl5eXo7KszB",
"name": "My company",
"billingPeriod": {
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-06-30T23:59:59.999Z"
},
"dataSince": "2026-05-21T06:00:00.000Z",
"usage": {
"planName": "Growth",
"credits": 6500,
"mode": "fast",
"groupBy": "type",
"range": {
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-06-30T23:59:59.999Z"
},
"freshness": {
"source": "daily_aggregations",
"lastUpdated": "2026-06-29T18:31:10.000Z",
"expectedLagSeconds": 30
},
"series": [
{ "date": "2026-06-29T12:00:00.000Z", "group": "Servicio", "value": 180 },
{ "date": "2026-06-29T12:00:00.000Z", "group": "Campaña", "value": 40 }
],
"totalsByGroup": [
{ "group": "Servicio", "messages": 950, "creditsUsed": 950, "includedValueCentavos": 0, "overageCentavos": 0, "changePct": null },
{ "group": "Campaña", "messages": 250, "creditsUsed": 370, "includedValueCentavos": 0, "overageCentavos": 0, "changePct": null }
],
"summary": {
"totalMessages": 1200,
"serviceCount": 950,
"campaignCount": 250,
"creditsUsed": 1320,
"credits": 6500,
"totalChangePct": -8.8,
"serviceChangePct": -11.2,
"campaignChangePct": 0
}
}
}
],
"workspacesCount": 1
} Response fields
| Field | Description |
|---|---|
id | Workspace ID |
name | Workspace name |
billingPeriod | Active billing period for the workspace |
usage.planName | Plan name. For enterprise workspaces it is enterprise |
usage.credits | Workspace included credits |
usage.mode | Calculation mode used: fast or full |
usage.groupBy | Grouping dimension applied |
usage.range | Effective date range evaluated |
usage.series | Daily series with date, group, and value |
usage.totalsByGroup | Per-group totals with messages and, on non-enterprise plans, cost fields |
usage.summary.totalMessages | Total messages used |
usage.summary.serviceCount | Service messages |
usage.summary.campaignCount | Campaign or template messages |
usage.summary.creditsUsed | Estimated credits consumed (omitted for enterprise workspaces) |
usage.freshness | Latest update and expected lag |
Modes
| Mode | Recommended use |
|---|---|
fast | Monitoring and dashboards. Usually reflects messages with seconds of lag |
full | Cost and overage reconciliation. Reads transactions and is limited to short ranges |
Nota
For enterprise workspaces, the response keeps credits but omits creditsUsed and cost fields (includedValueCentavos, overageCentavos). These customers have custom rates; use message counts by group for monitoring.