An account is where one of your customers’ sessions run. You create one per customer, set its limits, and suspend or delete it when your customer leaves. Every account route takes your partner id in the path and is called with your partner key (an access token cannot manage accounts).
People of your organization with the Partner operator or Partner admin permission can also open each account in the dashboard: on the Partner page, under Accounts, choose an account to see its state, limits, usage this period, daily usage, recent events and signing credentials. A partner admin can also Edit account (its name, limits and the day its period starts), Add extra minutes, Suspend and Resume it there. Deleting an account stays in the API.
The account’s other tabs, Sessions, Builds, Apps, Submissions and Settings, show the account’s sessions, cloud builds with their logs, apps and app builds, store submissions, build variable names, Google Play keys and embed keys. They are read only: you cannot watch a session, download a build or see a secret value there. A tab your contract does not include says so.
The examples set these variables first:
export VIBEVIEW_KEY='vvp_test_…'
export PTN='ptn_34e771b2c0472a4d'
Create an account
POST /api/v1/partners/{ptn}/accounts, scope accounts:write.
| Field | Rules |
|---|---|
external_ref | Required. Your own id for the customer: 1 to 128 letters, digits, ., _ or -. It never changes, and no two of your live accounts share one. Do not put personal data in it (no email address, no name). |
display_name | Optional. 1 to 256 characters. Only you see it; it is never sent in events. Defaults to external_ref. |
limits | Optional. Any of the limits below. A limit you leave out takes your contract’s default. |
period_anchor_day | Optional. The day of the month, 1 to 31, the account’s periods start on (see Periods). Defaults to the day of the month (UTC) the account is created. |
curl https://vibeview.io/api/v1/partners/$PTN/accounts \
-H "Authorization: Bearer $VIBEVIEW_KEY" \
-H 'Idempotency-Key: acct-cust_1042' \
-H 'Content-Type: application/json' \
-d '{"external_ref":"cust_1042","display_name":"Northwind Traders"}'
{
"object": "account",
"id": "org_95aa9b33d49e3752",
"external_ref": "cust_1042",
"display_name": "Northwind Traders",
"status": "active",
"suspended_by": [],
"livemode": false,
"created": 1795269940,
"limits": {
"concurrent_sessions": 1,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 1,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": null
}
Send an Idempotency-Key on every create. If your call times out, send it again with the
same key and the same body: you get the same account back (201 with an
Idempotent-Replayed: true header), never a second one.
If a live account already has that external_ref, the create is refused and the error names
the account that holds it. Use that account instead of creating another:
{
"detail": "A live account of yours already has this external_ref.",
"error": {
"code": "external_ref_taken",
"message": "A live account of yours already has this external_ref.",
"field": "external_ref",
"request_id": "req_2287163ed2c0b5327db344fc",
"account": "org_95aa9b33d49e3752",
"status": "active"
}
}
Other refusals you may meet: 422 invalid_request (field: external_ref or
field: period_anchor_day for a value outside the rules), 422 limit_above_contract, 422 unknown_limit, 422 invalid_limit
(see Limits) and 409 max_accounts_reached when you already have as many live
accounts as your contract allows.
Find an account by your id
curl "https://vibeview.io/api/v1/partners/$PTN/accounts?external_ref=cust_1042" \
-H "Authorization: Bearer $VIBEVIEW_KEY"
The answer is a list with the one live account that has this external_ref (exact match).
No match is a 200 with an empty list, not a 404:
{"object": "list", "data": [], "has_more": false}
List accounts
GET /api/v1/partners/{ptn}/accounts, scope accounts:read. Your live accounts, newest
first, in pages:
curl "https://vibeview.io/api/v1/partners/$PTN/accounts?limit=2" \
-H "Authorization: Bearer $VIBEVIEW_KEY"
{
"object": "list",
"data": [
{"object": "account", "id": "org_489d46ec889eb90b", "external_ref": "cust_1044", "display_name": "cust_1044", "status": "active", "suspended_by": [], "livemode": false, "created": 1795269954, "limits": {"concurrent_sessions": 1, "max_session_minutes": 30, "streaming_minutes_per_month": 600, "build_minutes_per_month": 10, "build_minutes_mac_per_month": 0, "concurrent_builds": 1, "storage_bytes": 1000000, "collab_guests_per_session": 1, "build_time_limit_s": 1800}, "period_anchor_day": 21, "period": {"start": 1795219200, "end": 1797811200}, "extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200}, "suspended_reason": null},
{"object": "account", "id": "org_5c450c1030ce18e8", "external_ref": "cust_1043", "display_name": "cust_1043", "status": "active", "suspended_by": [], "livemode": false, "created": 1795269954, "limits": {"concurrent_sessions": 1, "max_session_minutes": 30, "streaming_minutes_per_month": 600, "build_minutes_per_month": 10, "build_minutes_mac_per_month": 0, "concurrent_builds": 1, "storage_bytes": 1000000, "collab_guests_per_session": 1, "build_time_limit_s": 1800}, "period_anchor_day": 21, "period": {"start": 1795219200, "end": 1797811200}, "extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200}, "suspended_reason": null}
],
"has_more": true
}
For the next page, pass the last id you got as starting_after:
curl "https://vibeview.io/api/v1/partners/$PTN/accounts?limit=2&starting_after=org_5c450c1030ce18e8" \
-H "Authorization: Bearer $VIBEVIEW_KEY"
See Pagination.
Read an account and its usage
GET /api/v1/partners/{ptn}/accounts/{org}, scope accounts:read. The account, plus its
usage in its current period (see Periods):
curl https://vibeview.io/api/v1/partners/$PTN/accounts/org_95aa9b33d49e3752 \
-H "Authorization: Bearer $VIBEVIEW_KEY"
{
"object": "account",
"id": "org_95aa9b33d49e3752",
"external_ref": "cust_1042",
"display_name": "Northwind Traders",
"status": "active",
"suspended_by": [],
"livemode": false,
"created": 1795269940,
"limits": {
"concurrent_sessions": 1,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 1,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": null,
"usage": {
"period": {"start": 1795219200, "end": 1797811200},
"streaming_seconds": 0,
"build_minutes": 0,
"build_minutes_mac": 0,
"storage_bytes": 0
}
}
Usage is in whole numbers. streaming_seconds counts every session that started in the
period, live ones included, in seconds (the limit, streaming_minutes_per_month, is in
minutes). The period in usage is the account’s period.
An id that is not one of your live accounts is 404 account_not_found.
Usage
VibeView keeps a record of what each account used, one per UTC day and usage unit. Read it two ways (see the API reference for the parameters and examples):
- All your accounts:
GET /api/v1/partners/{ptn}/usage, with a partner key that holdspartner_usage:read, or signed in as a person of your organization with the Partner operator or Partner admin permission. - One account:
GET /api/v1/usage, with an access token of the account that holdsusage:read(it reads its own account), or with a partner key that holdsusage:readand names the account inVibeView-Account.
| Unit | What one record holds |
|---|---|
streaming_seconds | The time of the sessions that started that day, in whole seconds. A session’s whole time counts on the day it started, even when it runs past midnight. |
build_minutes | The metered minutes of the builds created that day on the Linux builders (every build that does not count in build_minutes_mac). |
build_minutes_over_limit | The part of build_minutes past the account’s build_minutes_per_month and the extra build minutes you gave it (in the account’s period the build was created in). Minutes the extra build minutes cover are within the limit: they are priced like any build minute. |
build_minutes_mac | The metered minutes of the builds created that day on the Mac builders: iOS and Apple TV builds. |
build_minutes_mac_over_limit | The part of build_minutes_mac past the account’s build_minutes_mac_per_month and its extra Mac build minutes, as build_minutes_over_limit. |
storage_bytes | The most bytes the account stored at any point that day (checked about every hour). |
An account’s builds appear once they are counted: a build’s minutes are counted when it ends (a build that never ran counts none).
- Days are UTC.
dayisYYYY-MM-DD; a month is its UTC calendar month. Records, their default range and your invoice follow calendar months, whatever an account’s period: to read an account’s usage in its own period, ask forfrom= the day ofperiod.startandto= today (see Periods). - Records change until they are final. Records are brought up to date about every
hour, so today’s record is a running figure. A
storage_bytesrecord isfinalonce its day is over; the others three days after their day, once nothing that started on it is still running (a session that runs for days keeps its start day open until it ends). Whilefinalisfalsethequantitycan still change; once it istrueit never does. - Paging through days that are not final: their records can change, and new records for
them can appear, while you page. For a complete, stable month, read it once all its days are
final, or process only the records that arefinal. - A day with nothing used may have no record: read a missing record as zero.
- Deleted accounts keep their records. Usage stays readable after an account is
deleted, with
account=on the partner route, so you can bill it. priceis the unit price your contract had at the very end of that day (UTC) for the unit’s price key:streaming_minuteforstreaming_seconds,build_minuteforbuild_minutes,build_minute_over_limitforbuild_minutes_over_limit,build_minute_macforbuild_minutes_mac,build_minute_mac_over_limitforbuild_minutes_mac_over_limit,storage_gb_monthforstorage_bytes. It is in whole micro-dollars (1,000,000 is $1.00), andnullwhen your contract sets no price for that key. It is never an amount. Test partners are not charged: their prices are zero or absent.current_period: on a page of one account (account=on the partner route, always on the account route) whosetois today or later, the account’s current period so far (see Periods), computed when you ask (as_of), with the members ofusageon the account. Itsstreaming_seconds,build_minutesandbuild_minutes_macequal the sum of the period’s records once those are up to date;storage_bytesis what the account stores now. Otherwise it isnull.
Work out a month’s amount
Amounts are worked out per month and price key, never per record. Take the month’s records of the unit, and group consecutive days that have the same unit price:
| Price key | Amount of a group |
|---|---|
streaming_minute | sum of streaming_seconds ÷ 60 × price |
build_minute | sum of build_minutes × price |
build_minute_over_limit | sum of build_minutes_over_limit × price (a surcharge on top of build_minute, for those minutes only) |
build_minute_mac | sum of build_minutes_mac × price |
build_minute_mac_over_limit | sum of build_minutes_mac_over_limit × price (a surcharge on top of build_minute_mac, for those minutes only) |
storage_gb_month | sum of the daily storage_bytes ÷ the days in the month ÷ 1,000,000,000 × price |
Round each group half up to a whole micro-dollar and add the groups. With one price all
month, that is the month’s total priced once. For example, 30 days of 2 GB stored in a
30-day month at storage_gb_month 50,000 is 60,000,000,000 ÷ 30 ÷ 1,000,000,000 × 50,000 =
100,000 micro-dollars ($0.10).
Limits
Every account has these limits. Your contract sets the default a new account gets and the
highest value you may give one; read both with GET /api/v1/partners/{ptn}/contract
(account_defaults and account_maxima).
| Limit | What it caps today |
|---|---|
concurrent_sessions | Sessions the account may have at once, counted from creation until they end. One more from your server is refused with 403 concurrent_sessions_limit; a session one of your embed keys starts waits for a free place instead (see Embedding a device in your product). |
max_session_minutes | How long one session may run. The session ends with end_reason: "session_length_limit". |
streaming_minutes_per_month | Session minutes per period of the account (see Periods), plus any extra minutes you gave it for the period. When they run out, new sessions are refused with 403 streaming_minutes_exhausted; running ones get session.cutoff_warning up to two minutes before, and end with end_reason: "usage_limit_reached" when the minutes run out. |
collab_guests_per_session | Browsers that may watch or use one session at once. |
build_minutes_per_month | Build minutes per period of the account on the Linux builders, plus any extra build minutes you gave it for the period. A new build is refused with 403 build_minutes_exhausted when the minutes left do not cover its unfinished builds and the new one (see Start a build from a template). |
build_minutes_mac_per_month | The same for builds on the Mac builders: iOS and Apple TV builds (see iOS and Apple TV builds), with their own extra Mac build minutes. Your contract grants none until it includes Mac builds. |
concurrent_builds | Builds the account may run at once. More builds wait in the queue until one ends. |
storage_bytes | Bytes the account may store: its build files and its build variable files over 64 KB. A new build or a large file over the limit is refused with 403 storage_limit_reached. |
build_time_limit_s | How long one of the account’s builds may run, in seconds (a production build gets 20 minutes more). Past it, the build ends failed with failure_reason timeout. |
A value is a whole number, or "unlimited" where your contract allows it (never for
build_minutes_per_month, build_minutes_mac_per_month or concurrent_builds). build_time_limit_s is a whole number of
seconds from 60 up to your contract’s build_time_limit_s; send null to go back to your
contract’s. The account’s limits show the one that applies: its own where it is lower than
your contract’s, otherwise your contract’s (so a contract lowered below it shows, and
applies, the contract’s). It is not a monthly limit and has no account_maxima entry. A
value above your contract’s maximum is refused:
{
"detail": "concurrent_sessions is above your contract's maximum of 2.",
"error": {
"code": "limit_above_contract",
"message": "concurrent_sessions is above your contract's maximum of 2.",
"field": "limits.concurrent_sessions",
"request_id": "req_3537dbc235a4ba96c0231b0e",
"max": 2
}
}
A name that is not a limit is 422 unknown_limit (field: limits.seats); a value below a
limit’s floor, or "unlimited" where it is not allowed, is 422 invalid_limit.
Your contract also caps all your accounts together (caps.concurrent_sessions): when your
accounts together use that many sessions, a new one is refused with
403 partner_concurrent_sessions_limit even if its own account has room. Builds past
caps.concurrent_builds, or Mac builds past caps.concurrent_builds_mac, wait in the queue.
Update an account
PATCH /api/v1/partners/{ptn}/accounts/{org}, scope accounts:write. Send only what
changes: display_name (null goes back to external_ref), any limits,
period_anchor_day (see Change the anchor day) and
extra.streaming_minutes, extra.build_minutes or extra.build_minutes_mac (see
Set what is left).
Limits you do not send keep their value.
curl -X PATCH https://vibeview.io/api/v1/partners/$PTN/accounts/org_95aa9b33d49e3752 \
-H "Authorization: Bearer $VIBEVIEW_KEY" \
-H 'Content-Type: application/json' \
-d '{"display_name":"Northwind","limits":{"concurrent_sessions":2,"collab_guests_per_session":2}}'
{
"object": "account",
"id": "org_95aa9b33d49e3752",
"external_ref": "cust_1042",
"display_name": "Northwind",
"status": "active",
"suspended_by": [],
"livemode": false,
"created": 1795269940,
"limits": {
"concurrent_sessions": 2,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 2,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": null
}
external_ref cannot be changed: sending it is 422 invalid_request with
field: external_ref. A changed name, period or extra minutes send account.updated;
changed limits send limits.changed, which carries the old values in previous_limits.
Periods
An account’s monthly limits (streaming_minutes_per_month, build_minutes_per_month, build_minutes_mac_per_month)
count in the account’s own period, which starts on its anchor day each month, at
midnight UTC. The account’s period_anchor_day is that day (1 to 31) and period is the
current period, as unix seconds (start, and end, the first second after it). When the
period ends, the account’s minutes start again from zero.
- The anchor day is the day of the month the account was created (UTC), unless you set another when you create it or later. Match it to the day your customer’s own plan renews.
- Short months. In a month without the anchor day, the period starts on the month’s last day, and the next one starts on the anchor day again: an account anchored on the 31st has periods starting on January 31, February 28 (29 in a leap year), March 31, April 30, and so on.
- Whole UTC days. A period starts at midnight UTC, which can be up to a day before your customer’s own renewal time.
- Each session counts in the period it started in, whole, even when it runs past the end of the period. A session still running after its period ended is still measured against that period’s limit: it does not use the new period’s minutes, and it ends if its own period’s minutes run out.
- Usage, records and invoices are unchanged: usage records are per UTC day, and your
invoice is per calendar month, whatever the account’s period. To read an account’s usage
in its current period from the records, ask the usage routes for
from= the day ofperiod.startandto= today;current_periodgives the same totals, computed now (the records catch up within about an hour).
Change the anchor day
Send period_anchor_day in a PATCH to change it. The current period keeps its start
and now ends at the next occurrence of the new day (today included); the periods after it
follow the new day. Nothing is prorated: the current period is cut short or runs on. One
change never makes it run past the next occurrence of the new day; changing the day again
before then keeps the same start and can extend the period further, so your customer only
gets fewer resets.
For example, an account anchored on the 15th, changed on November 20:
| New anchor day | The period that started November 15 | The next periods |
|---|---|---|
| 25 | November 15 to November 25 | November 25 to December 25, then from the 25th |
| 10 | November 15 to December 10 | December 10 to January 10, then from the 10th |
| 20 | November 15 to November 20 (it has ended: today starts the next) | November 20 (today) to December 20 |
When the new period starts today, the usage of the whole day counts in it, including the sessions that started earlier today. Sending the account’s current anchor day changes nothing. Two changes in one period keep the period’s start, so a change can never shift usage into another period.
A change is refused with 409 period_change_blocked while a session or build of the
account that started before the period that will be current after the change is still
running: before the current period’s start for a change to a later day, before today for a
change to today’s day. Send it again once that session has ended: the wait is at most as long
as the oldest running session (at most the account’s max_session_minutes). A change to
another day is not held up by sessions that started in the current period.
The answer and the account.updated event carry the new period_anchor_day and period.
When the change starts a new period today, all the extra minutes given for
the period that ended, streaming and build alike, move to the new one in full (the part
already used included), so running sessions keep them. The new period’s usage starts from
zero, so the account’s extra can read more after the change than before it. A change that
keeps the current period’s start leaves them where they are.
Extra minutes
You can give an account streaming minutes beyond its streaming_minutes_per_month, and build
minutes beyond its build_minutes_per_month, for one period, for example when your customer
buys more. Extra minutes:
- are used only once the period’s monthly minutes of their kind are used up;
- end with the period (
extra.expires_atis the period’send). What is left is not carried over: a top-up that should last longer is yours to add again in the next period; - cost you what any streaming or build minute costs: they raise the account’s ceiling, they
are not a purchase from VibeView. Build minutes they cover are within the limit, so they are
not in
build_minutes_over_limit; - for streaming, do not apply to an account whose
streaming_minutes_per_monthis"unlimited": adding and setting streaming minutes are409 extra_not_applicable, and itsextra.streaming_minutesalways reads0. Build minutes are never unlimited, so extra build minutes always apply.
Extra Mac build minutes (build_minutes_mac) work exactly like extra build minutes, for the
builds that count in build_minutes_mac_per_month.
The account’s extra shows what is left now in its current period (streaming minutes rounded
down to whole minutes), and when it ends:
{"streaming_minutes": 25, "build_minutes": 40, "build_minutes_mac": 0, "expires_at": 1797811200}
Add extra minutes
POST /api/v1/partners/{ptn}/accounts/{org}/extra-minutes, scope accounts:write.
| Field | Rules |
|---|---|
streaming_minutes | Optional. Streaming minutes to add, 1 to 100,000. Each call adds to what the period already has; a period’s total is at most 1,000,000. |
build_minutes | Optional. Build minutes to add, 1 to 100,000, with the same rules. |
build_minutes_mac | Optional. Mac build minutes to add, with the same rules as build_minutes. |
period_start | Optional. Which period to add to, by its start (unix seconds). Defaults to the current period. The previous period is accepted only while what you add is still counted there: a session that started in it is still running (for streaming_minutes), or a build created in it is still queued or running, its minutes still null (for build_minutes; a Mac build, for build_minutes_mac); see below. |
Send streaming_minutes, build_minutes, build_minutes_mac or more than one (none is
422 invalid_request). With more than one, all are added to the same period, or none is: a
refusal of one refuses the call.
An add is additive, so send an Idempotency-Key with each one: a retry with the same key
returns the first answer and adds nothing.
curl https://vibeview.io/api/v1/partners/$PTN/accounts/org_95aa9b33d49e3752/extra-minutes \
-H "Authorization: Bearer $VIBEVIEW_KEY" \
-H 'Idempotency-Key: slice-3cc37ff2-1' \
-H 'Content-Type: application/json' \
-d '{"streaming_minutes":30}'
The answer is the account (200), its extra being what is left in the period you added to:
{
"object": "account",
"id": "org_95aa9b33d49e3752",
"external_ref": "cust_1042",
"display_name": "Northwind Traders",
"status": "active",
"suspended_by": [],
"livemode": false,
"created": 1795269940,
"limits": {
"concurrent_sessions": 1,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 1,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 30, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": null
}
Refusals: 422 invalid_request (field: streaming_minutes or field: build_minutes for a
value outside the rules or a period total past 1,000,000, with the message “A period’s extra
build minutes are at most 1,000,000 in total.” for build minutes; field: period_start for a
period you may not add to; no field when neither member is sent),
409 extra_not_applicable (streaming minutes only), 409 partner_not_active,
404 account_not_found. Each add sends
account.updated, its extra being what is left in the period you added to (the previous
period’s, for an add that named it), as in the answer.
A session that crossed into a new period. A session counts in the period it started in
(see Periods), so a session still running after its period ended is measured
against that period’s minutes and extra minutes. Its session.cutoff_warning names that
period in cutoff.period: add to it with "period_start": <cutoff.period.start>. Once no
session that started in the previous period is running, an add naming it is refused.
A build that crossed into a new period. A build’s minutes count in the period it was
created in, so a build created just before the period ended is measured against that period’s
build minutes and extra build minutes. While it is still queued or running (its minutes
are still null), you can add build_minutes to that period with "period_start" set to its
start; once no build created in it is queued or running, an add naming it is refused.
Set what is left
PATCH /api/v1/partners/{ptn}/accounts/{org} with {"extra": {"streaming_minutes": N}},
{"extra": {"build_minutes": N}}, {"extra": {"build_minutes_mac": N}} or more than one
(each 0 to 100,000; an empty extra is
422 invalid_request with field: extra) sets what is left of the current period’s
extra minutes of that kind from now on. For build minutes it counts every build of the period
that has finished, including one that finishes while the set runs. It
replaces whatever was added before it, including an add a moment earlier: use the add while
sessions run, and the set to settle. It applies to the whole account for the period, not
to one session: while other sessions of the account are running, leave what they still hold
(set 0 only when none is running). The set works in whole minutes, so up to 59 seconds can
remain after it: a set to 0 can still let a new session start, which then ends within about
30 seconds. 409 extra_not_applicable for streaming minutes under an "unlimited" monthly
limit. A period’s extra build minutes are at most 1,000,000 in total: a set that would go past
it is 422 invalid_request (field: extra.build_minutes), and a set that lowers them is
always accepted.
Reserve in slices
To let your customers pay for streaming as they go, reserve minutes in slices, the way prepaid phone credit works:
- When a session starts, move a slice out of your customer’s balance (say 30 minutes) and add that many extra minutes.
- On
session.cutoff_warning, if your customer still has balance, add the next slice to theperiodthe warning names. Make the slice lift the time left past two minutes for each running session (for example, at least 3 minutes for each): a smaller slice extends the sessions without a new warning, so the nextsession.cutoff_warningyou get may be the one you already handled, and the sessions end when the slice runs out. - On
session.ended, read the session’sstreaming_seconds(the time it was metered) and settle with your customer. Then use the set call to keep what your customer’s other running sessions still hold, or0when none is running: the set applies to the whole account, so setting0while another session runs takes back the minutes it is using, and it ends withusage_limit_reached.
The account’s monthly minutes are used first; the slices only once they are used up.
Changing the monthly limit mid-period
Extra minutes count what is used past streaming_minutes_per_month, so changing that limit
in the middle of a period changes how much of the usage counts as extra. For example, with a
limit of 10 minutes, 10 extra minutes and 15 minutes used, 5 extra minutes are left. Raise
the limit to 20 and all 10 extra minutes are left (the 15 minutes are within it); lower it
to 5 and none are (10 minutes are past it).
When a running session ends
The account’s limit in a period is streaming_minutes_per_month plus that period’s extra
minutes. When the time left, shared by the account’s running sessions of that period, is two
minutes or less, each of them gets session.cutoff_warning (once), with cutoff.ends_at,
when the limit will be reached at the current rate. That is an estimate: another session
starting brings it forward. If you add minutes that lift the time left past two minutes, the
sessions run on, and a later approach to the new limit warns them again. Otherwise they end
with end_reason: "usage_limit_reached" once the limit is reached. The limit is checked
every 30 seconds, so the period’s usage can pass it by up to 30 seconds for each running
session. In rare cases, such as a restart on our side, a warning can be sent again.
The usage.threshold lines (80% and 100%) count streaming_minutes_per_month only, once per
period: extra minutes never send a line again. Likewise the build lines count
build_minutes_per_month only, and the Mac build lines build_minutes_mac_per_month only:
extra build minutes do not move them.
Suspend and resume
Suspend an account when your customer should lose access for a while (an unpaid invoice,
for example). reason is your own note, at most 200 characters; nobody outside your
partner sees it.
curl -X POST https://vibeview.io/api/v1/partners/$PTN/accounts/org_5c450c1030ce18e8/suspend \
-H "Authorization: Bearer $VIBEVIEW_KEY" \
-H 'Content-Type: application/json' \
-d '{"reason":"Invoice overdue"}'
{
"object": "account",
"id": "org_5c450c1030ce18e8",
"external_ref": "cust_1043",
"display_name": "Contoso",
"status": "suspended",
"suspended_by": ["partner"],
"livemode": false,
"created": 1795269954,
"limits": {
"concurrent_sessions": 1,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 1,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": "Invoice overdue"
}
What a suspension does:
-
From the moment the call answers, every request in the account is refused, with the account’s key header or its access tokens, reads included:
{ "detail": "You suspended this account; resume it to use it.", "error": { "code": "account_suspended_by_partner", "message": "You suspended this account; resume it to use it.", "request_id": "req_32d4899694076ed3f1e83ec0" } } -
You cannot mint access tokens for it. You can still read, update and delete it.
-
Its sessions end with
end_reason: "account_suspended"(stopped_by_platformwhen VibeView suspended it), and their guests are disconnected and told the session has ended. Your suspend call ends them where it can; whoever suspended the account, every session of it has normally ended within about 30 seconds. Until its session ends, a guest holding a valid link may still connect. -
You receive
account.suspended, andsession.endedfor each session it ended.
Resume it with POST /api/v1/partners/{ptn}/accounts/{org}/resume. Its status goes back
to active and you receive account.resumed. Sessions it ended stay ended.
suspended_by lists everything that suspends the account, in this order:
| Value | Meaning |
|---|---|
partner | You suspended it. Only you can resume it. |
vibeview | VibeView support suspended it (for example for abuse). Requests in it are refused with 403 organization_suspended. |
partner_status | Your partner itself is suspended or being closed, so none of your accounts can be used. |
home_org | Your own VibeView organization is suspended or deleted, so none of your accounts can be used. |
Resuming lifts only your own suspension: the account stays suspended while another value
holds. Treat status and suspended_by as open sets: new values may appear.
Delete an account
DELETE /api/v1/partners/{ptn}/accounts/{org}, scope accounts:write. Deleting is
irreversible.
curl -X DELETE https://vibeview.io/api/v1/partners/$PTN/accounts/org_489d46ec889eb90b \
-H "Authorization: Bearer $VIBEVIEW_KEY"
The answer is 202 Accepted:
{
"object": "account",
"id": "org_489d46ec889eb90b",
"external_ref": "cust_1044",
"display_name": "cust_1044",
"status": "deleting",
"suspended_by": [],
"livemode": false,
"created": 1795269954,
"limits": {
"concurrent_sessions": 1,
"max_session_minutes": 30,
"streaming_minutes_per_month": 600,
"build_minutes_per_month": 10,
"build_minutes_mac_per_month": 0,
"concurrent_builds": 1,
"storage_bytes": 1000000,
"collab_guests_per_session": 1,
"build_time_limit_s": 1800
},
"period_anchor_day": 21,
"period": {"start": 1795219200, "end": 1797811200},
"extra": {"streaming_minutes": 0, "build_minutes": 0, "build_minutes_mac": 0, "expires_at": 1797811200},
"suspended_reason": null,
"deletion": {"accepted": true, "scheduled": true}
}
An account that holds an Android keystore VibeView generated, that signed a build and that
nobody exported (see Signing) is not deleted: the answer is
409 signing_material_not_exported, and the error’s credentials names each such keystore
(id and name). Deleting the account would lose them for good, and Google Play accepts
updates of an app only from its upload key (replacing a lost one means asking Google Play
support to reset it). Export them first (a partner admin does it on the account’s page in the
dashboard: Partner, then Accounts, then the account), or send the DELETE
again with ?confirm_signing_material_loss=true to delete the account and lose them.
What happens next:
- From the moment the call answers: its access tokens stop working, and every request in
the account is refused with
403 account_deleting. Sending theDELETEagain answers the same202. - Its sessions end with
end_reason: "account_deleted"and their guests are disconnected: the call ends them where it can, and normally within about 30 seconds. Until then a guest holding a valid link may still connect. - Shortly after: the account is torn down and you receive
account.deleted(its object has"status": "deleted"). From then on the account is404 account_not_found, it is gone from your list, and itsexternal_refis free for a new account. Its usage records stay readable (see Usage).
Events about the account stay in your events feed for 30 days after they happened, and deliveries already scheduled are still sent.
Account events
| Event | When |
|---|---|
account.created | You created an account. |
account.updated | Its display_name or period_anchor_day changed, or suspended_by changed while it stays suspended. |
limits.changed | Its limits changed. Carries previous_limits. |
account.suspended | It went from active to suspended (by you or by VibeView). |
account.resumed | It went from suspended back to active. |
account.deleted | It was torn down after your DELETE. |
Each event’s data.object is the account as it was then, with these members only: object,
id, external_ref, status, suspended_by, limits, created, period_anchor_day,
period and extra (and previous_limits on limits.changed). It never carries display_name,
suspended_reason or livemode. See Events and webhooks.