Skip to content
Peal
Esc
↑↓navigate↵open⌘Jpreview

Get the workspace's billing

Answers with the workspace’s plan (free, payAsYouGo, or a plan priced by tiers of channels a subscription still holds), the subscription that buys it, what each limit allows its billing account, how much of it the workspace uses, and the plans it can be on. On a server that does not bill, nothing is limited. Needs billing:read.

GET/api/v1/workspace/billing
Authorization
AuthorizationBearer token · headerrequired

An API key of a workspace, starting with peal_, or a partner key, starting with peal_partner_.

or
__Secure-peal.session_tokenAPI key · cookierequired

The session cookie the web app's sign-in sets. Requests that change something must come from the web app's origin.

Header parameters
peal-workspacestring

The id of the workspace the request acts in. An API key and an application's token bound to a workspace act in their own workspace without it; a session, the command line's sign-in and a partner key send it.

Responses
200

Billing

accountBillingAccount
Show properties
billingWorkspaceIdstringrequired
billingWorkspaceNamestring | nullrequired
Show properties
Any of:
string
string
null
null
idstringrequired
otherWorkspacesAccountWorkspace[]required
Show properties
Array of AccountWorkspace
namestringrequired
workspaceIdstringrequired
partnerbooleanrequired
payerbooleanrequired
transferBillingTransfer | nullrequired
Show properties
Any of:
BillingTransfer
expiresAtstringrequired
offeredAtstringrequired
offeredBystringrequired
toUserIdstringrequired
null
null
workspacesintegerrequired
min -9007199254740991 · max 9007199254740991
accountsBillingAccountsUsagerequired
Show properties
accountDaysinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
connectedintegerrequired
min -9007199254740991 · max 9007199254740991
estimateMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
nextAccountMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
pooledintegerrequired
min -9007199254740991 · max 9007199254740991
allowancesPlanAllowancesrequired
Show properties
assistantRequestsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
channelsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
mediaStorageinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
membersinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
scheduledPostsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
currencystringrequired
enabledbooleanrequired
estimateMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
metersBillingMeter[] | nullrequired
Show properties
Any of:
BillingMeter[]
Array of BillingMeter
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
billableinteger | nullrequired
Show properties
Any of:
integer
integer
null
null
ceilingMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
estimateMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
groupSpendGroup | nullrequired
Show properties
Any of:
SpendGroup
string
null
null
meterMeterrequired
Allowed:assistantRequestsassistantImagesoutboundMessagesmanagedAdsxApi
mostinteger | nullrequired
Show properties
Any of:
integer
integer
null
null
priceUnitPricerequired
Show properties
centsintegerrequired
min -9007199254740991 · max 9007199254740991
perintegerrequired
min -9007199254740991 · max 9007199254740991
priceConfirmedbooleanrequired
resetsAtstringrequired
usedintegerrequired
min -9007199254740991 · max 9007199254740991
null
null
paymentFailedboolean
paymentMethodbooleanrequired
planPlan | nullrequired
Show properties
Any of:
Plan
string
null
null
plansPlanOffer[]required
Show properties
Array of PlanOffer
allowancesPlanAllowancesrequired
Show properties
assistantRequestsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
channelsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
mediaStorageinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
membersinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
scheduledPostsinteger<int64> | nullrequired
Show properties
Any of:
integer<int64>
integer<int64>
null
null
planPlanrequired

The plan a workspace is on: free without a subscription; starter, pro, business and agency, the plans priced by tiers of connected channels, kept for the subscriptions that hold one; payAsYouGo, pricing per connected account and per use, the only plan sold.

Allowed:freestarterprobusinessagencypayAsYouGo
pricePlanPrice | nullrequired
Show properties
Any of:
PlanPrice
monthintegerrequired
min -9007199254740991 · max 9007199254740991
yearintegerrequired
min -9007199254740991 · max 9007199254740991
null
null
rateCardRateCard | nullrequired
Show properties
Any of:
RateCard
apiRequestsPerMinuteobjectrequired
Show properties
onRequestintegerrequired
min -9007199254740991 · max 9007199254740991
withoutPaymentMethodintegerrequired
min -9007199254740991 · max 9007199254740991
assistantobjectrequired
Show properties
marginintegerrequired
min -9007199254740991 · max 9007199254740991
daysPerMonthintegerrequired
min -9007199254740991 · max 9007199254740991
displayVatRateintegerrequired
min -9007199254740991 · max 9007199254740991
metersobjectrequired
Show properties
assistantImagesMeterTermsrequired
Show properties
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
allowanceWithoutintegerrequired
min -9007199254740991 · max 9007199254740991
ceilinginteger | nullrequired
Show properties
Any of:
integer
integer
null
null
assistantRequestsMeterTermsrequired
Show properties
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
allowanceWithoutintegerrequired
min -9007199254740991 · max 9007199254740991
ceilinginteger | nullrequired
Show properties
Any of:
integer
integer
null
null
managedAdsMeterTermsrequired
Show properties
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
allowanceWithoutintegerrequired
min -9007199254740991 · max 9007199254740991
ceilinginteger | nullrequired
Show properties
Any of:
integer
integer
null
null
outboundMessagesMeterTermsrequired
Show properties
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
allowanceWithoutintegerrequired
min -9007199254740991 · max 9007199254740991
ceilinginteger | nullrequired
Show properties
Any of:
integer
integer
null
null
xApiMeterTermsrequired
Show properties
allowanceintegerrequired
min -9007199254740991 · max 9007199254740991
allowanceWithoutintegerrequired
min -9007199254740991 · max 9007199254740991
ceilinginteger | nullrequired
Show properties
Any of:
integer
integer
null
null
pricesobjectrequired
Show properties
usdPricesrequired
Show properties
accountsobjectrequired
Show properties
bandsAccountBand[]required
Show properties
Array of AccountBand
monthlyintegerrequired
min -9007199254740991 · max 9007199254740991
upTointeger | nullrequired
Show properties
Any of:
integer
integer
null
null
metersobjectrequired
Show properties
assistantImagesUnitPricerequired
assistantRequestsUnitPricerequired
managedAdsUnitPricerequired
outboundMessagesUnitPricerequired
xApiUnitPricerequired
storageobjectrequired
Show properties
minimuminteger<int64>required
min 0 · max 9007199254740991
perAccountinteger<int64>required
min 0 · max 9007199254740991
withoutPaymentMethodinteger<int64>required
min 0 · max 9007199254740991
unverifiedCeilingintegerrequired
min -9007199254740991 · max 9007199254740991
xobjectrequired
Show properties
defaultCeilingintegerrequired
min -9007199254740991 · max 9007199254740991
ratesobjectrequired
Show properties
dmCreateintegerrequired
min -9007199254740991 · max 9007199254740991
dmEventReadintegerrequired
min -9007199254740991 · max 9007199254740991
ownedReadintegerrequired
min -9007199254740991 · max 9007199254740991
postCreateintegerrequired
min -9007199254740991 · max 9007199254740991
postCreateWithUrlintegerrequired
min -9007199254740991 · max 9007199254740991
postReadintegerrequired
min -9007199254740991 · max 9007199254740991
userReadintegerrequired
min -9007199254740991 · max 9007199254740991
ratesReadOnstringrequired
null
null
subscriptionBillingSubscription | nullrequired
Show properties
Any of:
BillingSubscription
cancelAtPeriodEndbooleanrequired
currentPeriodEndstring | nullrequired
Show properties
Any of:
string
string
null
null
endsAtstring | nullrequired
Show properties
Any of:
string
string
null
null
intervalBillingIntervalrequired
Allowed:monthyear
planPaidPlanrequired

The plan a subscription buys: starter, pro, business and agency, the plans priced by tiers of connected channels, kept for the subscriptions that hold one; payAsYouGo, pricing per connected account and per use, the only plan sold.

Allowed:starterprobusinessagencypayAsYouGo
startedAtstring | nullrequired
Show properties
Any of:
string
string
null
null
statusSubscriptionStatusrequired
Allowed:incompleteincomplete_expiredtrialingactivepast_duecanceledunpaidpaused
trialEndstring | nullrequired
Show properties
Any of:
string
string
null
null
null
null
trialTrialOffer | nullrequired
Show properties
Any of:
TrialOffer
availablebooleanrequired
daysintegerrequired
min -9007199254740991 · max 9007199254740991
planPaidPlanrequired

The plan a subscription buys: starter, pro, business and agency, the plans priced by tiers of connected channels, kept for the subscriptions that hold one; payAsYouGo, pricing per connected account and per use, the only plan sold.

Allowed:starterprobusinessagencypayAsYouGo
null
null
upcomingInvoiceMoney | nullrequired
Show properties
Any of:
Money
amountintegerrequired
min -9007199254740991 · max 9007199254740991
currencystringrequired
null
null
usageUsagerequired
Show properties
assistantRequestsPeriodUsagerequired
Show properties
resetsAtstringrequired
usedintegerrequired
min -9007199254740991 · max 9007199254740991
channelsintegerrequired
min -9007199254740991 · max 9007199254740991
mediaStorageinteger<int64>required
min 0 · max 9007199254740991
membersintegerrequired
min -9007199254740991 · max 9007199254740991
scheduledPostsPeriodUsagerequired
Show properties
resetsAtstringrequired
usedintegerrequired
min -9007199254740991 · max 9007199254740991
vatRateintegerrequired
min -9007199254740991 · max 9007199254740991
withdrawableUntilstring | nullrequired
Show properties
Any of:
string
string
null
null
xXUsage | null
Show properties
Any of:
XUsage
readsbooleanrequired
setAtstring | nullrequired
Show properties
Any of:
string
string
null
null
null
null
400

The request names no workspace, and its credential belongs to none: send the workspace's id in the Peal-Workspace header. Nothing was done.

_tagstringrequired
Allowed:WorkspaceRequired
codestring
messagestring
requestIdstring
401

Sign in, or send an API key as a bearer token: the request has no valid credentials.

_tagstringrequired
Allowed:Unauthenticated
codestring
messagestring
requestIdstring
403

The credentials are valid but do not allow this request. reason says why: the OAuth client was not given the scope the request takes (missingScope, with scope and permission: the user connects the client again and allows it), the member's role or the API key lacks a permission (missingPermission, with permission: an owner or an admin changes the role, or creates a key with it), only a person in their own session may do it (personRequired), the key or token belongs to another workspace (wrongWorkspace), the account is suspended (suspended), a browser sent the cookie from another site (untrustedOrigin), or the workspace requires two-step verification and the member's account does not have it on (twoStepRequired: they turn it on in the web app's account settings, and their sessions, applications and command line work again at once; API keys are never refused for it).

_tagstringrequired
Allowed:Forbidden
codestring
messagestring
requestIdstring
permissionPermission

One action on one resource of a workspace.

Allowed:activity:readads:readads:manageads:spendads:authorizeanalytics:readapiKey:createapiKey:readapiKey:updateapiKey:deleteassistant:useassistant:configurebilling:readbilling:managechannel:readchannel:connectchannel:disconnectengagement:readengagement:replyengagement:messageengagement:readMessagesinvitation:createinvitation:cancelmedia:readmedia:uploadmedia:deletemember:createmember:updatemember:deleteorganization:updateorganization:deleteorganization:securepartner:readpartner:managepost:readpost:createpost:updatepost:deletepost:schedulepost:approvepost:publishwebhook:readwebhook:manage
reasonForbiddenReason
Allowed:missingScopemissingPermissionpersonRequiredwrongWorkspacesuspendeduntrustedOrigintwoStepRequired
scopestring
404

No workspace with this id is open to the caller.

_tagstringrequired
Allowed:WorkspaceNotFound
codestring
messagestring
requestIdstring
429

This credential sent more than limit requests in windowSeconds seconds: nothing was done. Wait retryAfterSeconds seconds, as the Retry-After header says, then send the request again. Every answer to a key or a token carries the RateLimit-Policy and RateLimit headers, which say how many requests are left. policy says which limit applied: on a server that bills, a billing account without a payment method sends fewer (free), and withPaymentMethod is what a payment method gives.

_tagstringrequired
Allowed:TooManyRequests
codestring
messagestring
requestIdstring
limitintegerrequired
min -9007199254740991 · max 9007199254740991
policystring
Allowed:defaultfreeoverride
retryAfterSecondsintegerrequired
min -9007199254740991 · max 9007199254740991
windowSecondsintegerrequired
min -9007199254740991 · max 9007199254740991
withPaymentMethodinteger
min -9007199254740991 · max 9007199254740991
Request
curl -X GET 'https://api.example.com/api/v1/workspace/billing' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "account": {
    "billingWorkspaceId": "string",
    "billingWorkspaceName": "string",
    "id": "string",
    "otherWorkspaces": [
      {
        "name": "string",
        "workspaceId": "string"
      }
    ],
    "partner": true,
    "payer": true,
    "transfer": {
      "expiresAt": "string",
      "offeredAt": "string",
      "offeredBy": "string",
      "toUserId": "string"
    },
    "workspaces": -9007199254740991
  },
  "accounts": {
    "accountDays": -9007199254740991,
    "connected": -9007199254740991,
    "estimate": {
      "amount": -9007199254740991,
      "currency": "string"
    },
    "nextAccount": {
      "amount": -9007199254740991,
      "currency": "string"
    },
    "pooled": -9007199254740991
  },
  "allowances": {
    "assistantRequests": -9007199254740991,
    "channels": -9007199254740991,
    "mediaStorage": -9007199254740991,
    "members": -9007199254740991,
    "scheduledPosts": -9007199254740991
  },
  "currency": "string",
  "enabled": true,
  "estimate": {
    "amount": -9007199254740991,
    "currency": "string"
  },
  "meters": [
    {
      "allowance": -9007199254740991,
      "billable": -9007199254740991,
      "ceiling": {
        "amount": -9007199254740991,
        "currency": "string"
      },
      "estimate": {
        "amount": -9007199254740991,
        "currency": "string"
      },
      "group": "assistant",
      "meter": "assistantRequests",
      "most": -9007199254740991,
      "price": {
        "cents": -9007199254740991,
        "per": -9007199254740991
      },
      "priceConfirmed": true,
      "resetsAt": "string",
      "used": -9007199254740991
    }
  ],
  "paymentFailed": true,
  "paymentMethod": true,
  "plan": "free",
  "plans": [
    {
      "allowances": {
        "assistantRequests": -9007199254740991,
        "channels": -9007199254740991,
        "mediaStorage": -9007199254740991,
        "members": -9007199254740991,
        "scheduledPosts": -9007199254740991
      },
      "plan": "free",
      "price": {
        "month": -9007199254740991,
        "year": -9007199254740991
      }
    }
  ],
  "rateCard": {
    "apiRequestsPerMinute": {
      "onRequest": -9007199254740991,
      "withoutPaymentMethod": -9007199254740991
    },
    "assistant": {
      "margin": -9007199254740991
    },
    "daysPerMonth": -9007199254740991,
    "displayVatRate": -9007199254740991,
    "meters": {
      "assistantImages": {
        "allowance": -9007199254740991,
        "allowanceWithout": -9007199254740991,
        "ceiling": -9007199254740991
      },
      "assistantRequests": {
        "allowance": -9007199254740991,
        "allowanceWithout": -9007199254740991,
        "ceiling": -9007199254740991
      },
      "managedAds": {
        "allowance": -9007199254740991,
        "allowanceWithout": -9007199254740991,
        "ceiling": -9007199254740991
      },
      "outboundMessages": {
        "allowance": -9007199254740991,
        "allowanceWithout": -9007199254740991,
        "ceiling": -9007199254740991
      },
      "xApi": {
        "allowance": -9007199254740991,
        "allowanceWithout": -9007199254740991,
        "ceiling": -9007199254740991
      }
    },
    "prices": {
      "usd": {
        "accounts": {
          "bands": [
            {
              "monthly": -9007199254740991,
              "upTo": -9007199254740991
            }
          ]
        },
        "meters": {
          "assistantImages": {
            "cents": -9007199254740991,
            "per": -9007199254740991
          },
          "assistantRequests": {
            "cents": -9007199254740991,
            "per": -9007199254740991
          },
          "managedAds": {
            "cents": -9007199254740991,
            "per": -9007199254740991
          },
          "outboundMessages": {
            "cents": -9007199254740991,
            "per": -9007199254740991
          },
          "xApi": {
            "cents": -9007199254740991,
            "per": -9007199254740991
          }
        }
      }
    },
    "storage": {
      "minimum": 0,
      "perAccount": 0,
      "withoutPaymentMethod": 0
    },
    "unverifiedCeiling": -9007199254740991,
    "x": {
      "defaultCeiling": -9007199254740991,
      "rates": {
        "dmCreate": -9007199254740991,
        "dmEventRead": -9007199254740991,
        "ownedRead": -9007199254740991,
        "postCreate": -9007199254740991,
        "postCreateWithUrl": -9007199254740991,
        "postRead": -9007199254740991,
        "userRead": -9007199254740991
      },
      "ratesReadOn": "string"
    }
  },
  "subscription": {
    "cancelAtPeriodEnd": true,
    "currentPeriodEnd": "string",
    "endsAt": "string",
    "interval": "month",
    "plan": "starter",
    "startedAt": "string",
    "status": "incomplete",
    "trialEnd": "string"
  },
  "trial": {
    "available": true,
    "days": -9007199254740991,
    "plan": "starter"
  },
  "upcomingInvoice": {
    "amount": -9007199254740991,
    "currency": "string"
  },
  "usage": {
    "assistantRequests": {
      "resetsAt": "string",
      "used": -9007199254740991
    },
    "channels": -9007199254740991,
    "mediaStorage": 0,
    "members": -9007199254740991,
    "scheduledPosts": {
      "resetsAt": "string",
      "used": -9007199254740991
    }
  },
  "vatRate": -9007199254740991,
  "withdrawableUntil": "string",
  "x": {
    "reads": true,
    "setAt": "string"
  }
}

Was this page helpful?