Retrieves a Capacity resource.
const url = 'https://api.facteur.local/capacity';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.facteur.local/capacity \ --header 'Authorization: Bearer <token>'Retrieves a Capacity resource.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Capacity resource
What the organization holds in its open billing period, where it went, and what it may still spend.
object
The operations of the period: what the plan, the packs and the adjustments give, and what was spent. One message received is one operation.
object
The operations left in the period. Null when the volume is unlimited.
The messages received past what the period holds, billed as pay as you go within the spending cap.
The operations the period holds, spent or not: the volume of the plan and the valid credits. Null when the volume is unlimited.
Each credit that has not expired, the one due first first. Overage billed as pay as you go is never a source.
object
The first day the credit no longer counts (YYYY-MM-DD, UTC).
True when the end of the subscription holds the credit: it counts again when the subscription resumes.
The operations the credit holds. Negative for an adjustment that takes operations back.
Plan_grant: the volume of the plan for the open period; pack: a pack bought; adjustment: operations granted or taken back.
The operations left: operations minus used. A frozen credit keeps them.
The operations already drawn from the credit.
The operations of the period drawn on what it holds.
True while no subscription runs, cut for non-payment or ended: the packs are held, not lost, and count again when a subscription resumes.
How the messages of the period ended. A refused message names its cause, so a gap in a flow can be explained.
object
The messages received and kept, the overage included. Each one is one operation.
Refused because the period held no more operations and the plan bills no overage (PLAN_QUOTA_EXCEEDED).
Refused by the daily limit of the overage, which keeps one day from spending the whole cap; it clears the next day (DAILY_SPIKE_CAP).
Refused by a ceiling set on an inbox or on a workspace (INBOX_QUOTA_EXCEEDED, WORKSPACE_QUOTA_EXCEEDED).
Refused at the spending cap (OVERAGE_CAP_REACHED).
Refused because the account is cut for an unpaid subscription (SUBSCRIPTION_SUSPENDED).
What can be bought to hold more. A pack is bought in the Facteur app, never with a key.
object
The packs of operations on sale, the smallest first.
object
In cents without tax: the price of the pack.
The operations the pack gives.
The billing period now open. It runs from one anniversary of the subscription to the next, so it is not the calendar month unless the account was opened on the first.
object
The day of the period today is, 1 on its first day.
The day the next period opens and the volume of the plan starts again (YYYY-MM-DD, UTC).
The first day of the period, which names it (YYYY-MM-DD, UTC).
The days of the period.
When the operations of the period run out at the current pace: the figure the consumption screen and the alert both read.
object
The day (YYYY-MM-DD, UTC) the capacity runs out at the current pace, or null when there is nothing honest to say: under three days observed, nothing consumed, no capacity, a capacity already spent, or a date past the period.
The days of the period left once the capacity is gone, or null without a projection.
The operations used per day observed so far, or null under three days observed or when nothing was used.
What the organization allows itself to be billed past what the period holds, in cents without tax. Null on a plan with no pay as you go, where a message past the capacity is refused.
object
True until the first payment has cleared: the ceiling is then the default.
The highest cap that may be set.
The cap that applies when none was set.
The cap that was set, or null when the cap follows the capacity. Zero is not null: zero refuses any overage.
Example
{ "capacity": { "sources": [ { "origin": "plan_grant" } ] }}No key, or a key that is refused. WWW-Authenticate says where to read how to present one.
A refusal, as RFC 9457 application/problem+json with the code of the register. A code adds the members its rule needs (retryAfter, permission…), so more members than these may come.
object
The stable code of the refusal. It never changes once shipped.
English prose for the person who reads the answer. It may be reworded: branch on code.
The HTTP status.
The name of the HTTP status.
The address of the problem: /errors/<code>.
On a body that fails validation, one entry per field.
object
Example
{ "code": "BAD_REQUEST", "status": 404, "title": "Not Found", "type": "/errors/INBOX_NOT_FOUND", "violations": [ { "code": "BAD_REQUEST" } ]}The key does not hold the permission of the operation, or the operation refuses every key.
A refusal, as RFC 9457 application/problem+json with the code of the register. A code adds the members its rule needs (retryAfter, permission…), so more members than these may come.
object
The stable code of the refusal. It never changes once shipped.
English prose for the person who reads the answer. It may be reworded: branch on code.
The HTTP status.
The name of the HTTP status.
The address of the problem: /errors/<code>.
On a body that fails validation, one entry per field.
object
Example
{ "code": "BAD_REQUEST", "status": 404, "title": "Not Found", "type": "/errors/INBOX_NOT_FOUND", "violations": [ { "code": "BAD_REQUEST" } ]}More calls than the key may make in a minute. Retry-After says when to try again.
A refusal, as RFC 9457 application/problem+json with the code of the register. A code adds the members its rule needs (retryAfter, permission…), so more members than these may come.
object
The stable code of the refusal. It never changes once shipped.
English prose for the person who reads the answer. It may be reworded: branch on code.
The HTTP status.
The name of the HTTP status.
The address of the problem: /errors/<code>.
On a body that fails validation, one entry per field.
object
Example
{ "code": "BAD_REQUEST", "status": 404, "title": "Not Found", "type": "/errors/INBOX_NOT_FOUND", "violations": [ { "code": "BAD_REQUEST" } ]}default
Section titled “default”Any refusal: an application/problem+json body whose code says which.
A refusal, as RFC 9457 application/problem+json with the code of the register. A code adds the members its rule needs (retryAfter, permission…), so more members than these may come.
object
The stable code of the refusal. It never changes once shipped.
English prose for the person who reads the answer. It may be reworded: branch on code.
The HTTP status.
The name of the HTTP status.
The address of the problem: /errors/<code>.
On a body that fails validation, one entry per field.
object
Example
{ "code": "BAD_REQUEST", "status": 404, "title": "Not Found", "type": "/errors/INBOX_NOT_FOUND", "violations": [ { "code": "BAD_REQUEST" } ]}