Get the usage summary

SDK platic.usage.summary()

Read the workspace summary: total and billable messages, failed messages, credits used, conversations, and autonomy rate.

Example

await platic.usage.summary();

Query parameters

ParameterTypeDescriptionRequired
workspacestringWorkspace ID. Required when your credential covers several workspaces (list workspaces); without it the answer is 400When the credential has several
startDatestringISO 8601 start date with offset. If omitted, uses the start of the billing period—
endDatestringISO 8601 end date with offset. If omitted, uses the end of the billing period—

Response

{
  "status": "success",
  "data": {
    "workspaceId": "g6yCA16pkWl5eXo7KszB",
    "billingType": "subscription",
    "plan": {
      "name": "Growth",
      "credits": 6500
    },
    "billingPeriod": {
      "startDate": "2026-06-01T00:00:00.000Z",
      "endDate": "2026-06-30T23:59:59.999Z"
    },
    "range": {
      "startDate": "2026-06-01T00:00:00.000Z",
      "endDate": "2026-06-30T23:59:59.999Z"
    },
    "dataSince": "2026-05-21T06:00:00.000Z",
    "messages": {
      "totalMessages": 1200,
      "billableMessages": 1188,
      "nonBillableMessages": 12,
      "failedMessages": 12,
      "serviceCount": 950,
      "humanServiceCount": 120,
      "campaignCount": 250,
      "creditsUsed": 1320,
      "credits": 6500,
      "totalChangePct": -8.8,
      "serviceChangePct": -11.2,
      "campaignChangePct": 0
    },
    "comments": {
      "received": 340,
      "agentReplies": 210
    },
    "conversations": {
      "conversationCount": 340,
      "assistedConversationCount": 28,
      "assistanceRequestCount": 35,
      "autonomyRate": 91.76
    },
    "freshness": {
      "usage": {
        "source": "transactions",
        "lastUpdated": null,
        "expectedLagSeconds": 0
      },
      "conversations": {
        "source": "daily_aggregations",
        "lastUpdated": "2026-06-29T18:00:05.000Z",
        "expectedLagMinutes": 60
      }
    },
    "generatedAt": "2026-06-29T18:05:12.000Z"
  }
}

Response fields

FieldDescription
workspaceIdWorkspace ID
billingTypeWorkspace billing type
planWorkspace plan and included credits
billingPeriodActive billing period of the workspace
rangeEffective date range evaluated
dataSinceEarliest reliable date for billable metrics
messages.totalMessagesTotal volume, including failed/non-billable messages
messages.billableMessagesMessages that are charged
messages.nonBillableMessagesMessages that are not charged
messages.failedMessagesFailed messages; they do not consume balance
messages.serviceCountService messages
messages.humanServiceCountPart of serviceCount sent by a person from the inbox
messages.campaignCountCampaign or template messages
messages.creditsWorkspace included credits
messages.creditsUsedEstimated credits consumed (omitted for enterprise workspaces)
messages.totalChangePctPercentage change vs the previous period
comments.receivedInstagram and Facebook comments received in the range
comments.agentRepliesCharged comment replies the agent delivered (private replies sent by your team are not included)
conversations.conversationCountTotal conversations (posts excluded)
conversations.assistedConversationCountConversations that required human assistance
conversations.assistanceRequestCountAssistance requests recorded
conversations.autonomyRatePercentage of conversations resolved without human assistance
freshnessLatest update and expected lag per source. usage.source is transactions when messages were counted exactly (ranges up to 92 days) and daily_aggregations on longer ranges and on enterprise
generatedAtWhen the response was generated

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTA query parameter is not valid: one the endpoint does not know or a date that is not ISO 8601 with offset. details.issues says which one
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the IDs you can use and details.requested the one you sent
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENWith an OAuth token, the person has no access to the dashboard (statistics) in that workspace. The message is Missing dashboard permission
404NOT_FOUNDThe workspace no longer exists. This is rare
{
  "code": 400,
  "error": "Bad Request - The request has validation errors",
  "details": {
    "code": "INVALID_REQUEST",
    "message": "The request has validation errors",
    "issues": [
      {
        "code": "unrecognized_keys",
        "keys": ["from"],
        "path": [],
        "message": "Unrecognized key(s) in object: 'from'"
      }
    ]
  }
}

The general error format is in Errors.