Get workspace billing status with GET /api/v1/workspaces/{workspaceId}/billing. Requires an API key with the read scope or a signed-in workspace member.
Request
| Parameter | In | Type | Required |
|---|---|---|---|
workspaceId |
path | UUID | Yes |
Response
- HTTP 200:
WorkspaceBillingwithworkspaceId,plan,status,paymentStatus,interval,gateway,periodStart,periodEnd,cancelAtPeriodEnd,creditBalanceMicros,creditBalance,spendControls,currentPeriod.plan:payg,pro,platform,enterprisestatus:active,trialing,past_due,canceled,incomplete,unpaidpaymentStatus:ok,payment_required,insufficient_credit,spend_cap_reachedgateway:fake,stripe
The OpenAPI document has each field’s type.
Examples
const billing = await workspace.billing.get();billing = workspace.billing.get()curl "https://pubnio.com/api/v1/workspaces/$WORKSPACE_ID/billing" \
-H "Authorization: Bearer $PUBNIO_API_KEY"pnio billing statusasync () => {
const response = await codemode.request({
method: "GET",
path: `/api/v1/workspaces/${codemode.workspaceId}/billing`,
});
return response.data;
};Errors
invalid-billing-date-range: HTTP 400, Invalid billing date range
It also declares the problems most operations declare.
Idempotency
None needed: a read is safe to retry.
Limits
- Field lengths and ranges are in the OpenAPI document.