Skip to main content

Get SMS Summary (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/sms/summary

Description

Get SMS usage summary including total messages, costs, and payment information.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Response 200 OK

{
"totalMessages": 1250,
"totalCost": 62.50,
"totalPaid": 50.00,
"outstandingBalance": 12.50,
"byType": {
"otp": 800,
"notification": 400,
"other": 50
},
"byStatus": {
"sent": 1200,
"pending": 30,
"failed": 20
}
}

Response Fields

  • totalMessages (number): Total number of SMS messages sent
  • totalCost (number): Total cost of all SMS messages
  • totalPaid (number): Total amount paid for SMS
  • outstandingBalance (number): Outstanding balance (totalCost - totalPaid)
  • byType (object): Message count grouped by type (otp, notification, other)
  • byStatus (object): Message count grouped by status (sent, pending, failed)

Common Errors

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have permission to view SMS data

404 Not Found: Workspace not found

500 Internal Server Error: Server error occurred while processing the request