Organizations
Get organization usage
Returns usage statistics for the current organization between `after` and `before`, which default to the current calendar month so far.
GET
Returns usage statistics for the current organization between after and before, which default to the current calendar month so far. usage.periodStart and usage.periodEnd echo the window counted.
apiKeyheader
x-api-key<token>after?stringbefore?stringSuccess
application/json- response
usage*billing*import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.organizations.getUsage({});Example Response
{ "usage": { "periodStart": "string", "periodEnd": "string", "smsCount": 0, "emailCount": 0, "whatsappCount": 0, "totalMessages": 0 }, "billing": { "currency": "string", "planName": "string", "includedCredits": 0, "usedCredits": 0, "overageCredits": 0, "overageCost": 0, "includedAiCredits": 0, "usedAiCredits": 0, "overageAiCredits": 0, "overageAiCost": 0, "aiPackCredits": 0, "aiResetsAt": "string", "creditsResetsAt": "string" }}