# getCreditUsageByType

What used the credits this billing period, per credit type: `series[].totalUnits` for AI_CREDITS, SMS_CREDITS (outbound text segments), CALLING_MINUTES, SKIPTRACE, EMAIL_VERIFICATION and EXPORT_PROPERTIES, the Billing page usage chart's own figures (each day's use, charges less that day's refunds, summed). Pass timeZone (getMyProfile.resolvedTimezone) so the days fall as the person's chart draws them; omitted, they are UTC days. A refund that lands a day after its charge is not netted, so a total can exceed getBillingSummary's `planUsage.usedThisPeriod`; quote this one as what used the credits, that one as what is left. Null before a first billing period. AI use is not split further (no per-employee figure). Read-only. Admin only: a Member is told a workspace admin sees it.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getCreditUsageByType", "variables": {...} }`
- Scope: `ADMIN`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `timeZone`: `String`

## Response (data, an example)

```json
{
  "subscriptionQuery": {
    "dailyCreditUsage": {
      "periodStart": "2026-01-01T00:00:00.000Z",
      "periodEnd": "2026-01-01T00:00:00.000Z",
      "series": [
        {
          "creditType": "EXPORT_PROPERTIES",
          "totalUnits": 0
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getCreditUsageByType",
    "variables": {}
  }'
```
