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
/v1/organizations/usage

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.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

after?string
before?string

Response Body

Success

application/json
  1. response
usage*
billing*
Example Request
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"  }}

Related documentation