A session is one live device in one of your accounts. Your server creates it, starts it,
keeps it alive, drives it, shows it in a browser, and ends it. Every request on this page
acts in one account: send an access token of that account, or your partner key with a
VibeView-Account header (see Acting in an account).
The examples use an access token:
export TOKEN='vvat_…'
The lifecycle
status | Meaning |
|---|---|
pending | Created, not started yet; or started and waiting for a device (queue is set). |
starting | A device is being prepared. |
active | The device is up. You can drive it and show it. |
stopping | It is ending. |
stopped | It ended normally (you ended it, or a limit or timeout did). |
failed | It ended without ever becoming usable (for example, no device became free). |
Once stopped or failed, end_reason says why (see End reasons).
status and end_reason are open sets: handle values you do not know.
streaming_seconds is the session’s metered streaming time, in whole seconds rounded down:
what the account’s usage counts for it, from the moment a device was given to it (0 until
then) to its end, or to now while it runs. It is final once the session has ended, so you can
settle with your customer from session.ended alone. While a session is stopping (for the
few seconds between the stop and its end) it reads 0, as the usage record counts it then;
once it has ended it reads its whole time. A day’s usage record counts the day’s sessions
together and rounds once, so the sessions of a day can add up to up to one second per
session less than the record.
Device offerings
GET /api/v1/devices/pools, scope sessions:read. The kinds of device you can start, one
per type, category, model and OS version:
curl https://vibeview.io/api/v1/devices/pools \
-H "Authorization: Bearer $TOKEN"
{
"object": "list",
"data": [
{"object": "device", "type": "android", "category": "phone", "model": "Pixel 7 Pro", "os_version": "Android 15 (API 35)", "available": true},
{"object": "device", "type": "ios", "category": "phone", "model": "iPhone 17", "os_version": "iOS 26.4", "available": true},
{"object": "device", "type": "ios", "category": "tv", "model": "Apple TV 4K", "os_version": "tvOS 26.4", "available": true}
],
"has_more": false
}
typeisios(iPhone, iPad and Apple TV) orandroid(phones, tablets and Android TV);categoryisphone,tabletortv.modelandos_versionare labels. Send them back exactly as listed; do not build them yourself.availablesays whether a device of this kind can start now. When it isfalse, a session you start waits for one.- A kind whose devices are all out of service (being updated, for example) is not listed for that time.
Create a session
POST /api/v1/sessions/, scope sessions:write.
| Field | Rules |
|---|---|
device_type, device_category, model, os_version | Required. One offering, exactly as GET /api/v1/devices/pools lists it. |
app | Required. An app the account can use, by its id as GET /api/v1/apps/ lists it: one your organization shares with your partner, or one of the account’s own apps (see Apps in accounts). The session installs and opens it, and stays in it (see The session stays in its app). |
build | Optional, only with app. One build of the app to install, by its build id (see Pin a build). Without it, the session installs the app’s newest build. |
launch_params | Optional, only with app. A flat JSON object handed to the app when it opens. |
labels | Optional. Up to 10 labels of your own, as a JSON object: keys and values are 1 to 64 characters of letters, digits and . _ : -; a key given twice keeps its last value. Returned on the session and in its events. Not for personal data. See Labels and reuse. |
reuse | Optional, true or false (the default). With true, the account’s live session with the same labels, app, build, confined and offering is returned instead of a new one. Needs at least one label. |
confined | Optional, true (the default) or false. With true the session stays in its app (see The session stays in its app). false asks for a session that can leave its app (see Sessions that can leave their app), only when your contract includes it. |
Any other field is refused with 422 invalid_request naming it.
curl https://vibeview.io/api/v1/sessions/ \
-H "Authorization: Bearer $TOKEN" \
-H 'Idempotency-Key: sess-cust_1042-0001' \
-H 'Content-Type: application/json' \
-d '{"device_type":"ios","device_category":"phone","model":"iPhone 17","os_version":"iOS 26.4","app":"Xk3pQ9vB2m"}'
{
"object": "session",
"id": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc",
"account": "org_95aa9b33d49e3752",
"status": "pending",
"device": {"type": "ios", "category": "phone", "model": "iPhone 17", "os_version": "iOS 26.4"},
"app": "Xk3pQ9vB2m",
"build": null,
"installed_build": null,
"queue": null,
"created": 1795269982,
"started": null,
"ended": null,
"end_reason": null,
"streaming_seconds": 0,
"warnings": [],
"livemode": false,
"labels": {},
"confined": true,
"reused": false
}
The answer is 201. With the same Idempotency-Key and body, a retry returns this same
session (Idempotent-Replayed: true) instead of creating another.
| Refusal | When |
|---|---|
422 invalid_request | No app was sent (field: app): "app: a session needs an app; name one the account can use (GET /apps)." |
403 unconfined_sessions_not_allowed | confined is false, and your contract does not include sessions that can leave their app. Nothing is created. |
422 invalid_request | The four fields are not an offering. field names the first one that matches none: "model: not a device offering; send the four fields exactly as GET /devices/pools lists them." |
409 device_unavailable | The offering exists, but none of its devices is in service right now. Try again later. |
403 concurrent_sessions_limit | The account already has as many sessions as its concurrent_sessions limit. |
403 partner_concurrent_sessions_limit | Your accounts together use as many sessions as your contract allows. |
403 streaming_minutes_exhausted | The account has no streaming minutes left this period. |
422 invalid_request | labels has more than 10 pairs, or a key or value outside the rules (field starting with labels, for example labels.project), or reuse is true without a label (field: reuse). |
409 session_create_in_progress | Another request with the same labels and reuse is creating the account’s session. Retry after Retry-After. |
422 invalid_request | build is refused (field: build); see Pin a build. |
Pin a build
By default a session installs the app’s newest build. To start a session on one specific
build, send its build id as build with the app. For one of the account’s own apps, the
build ids are the app builds’ ids (see List an app’s builds).
For an app your organization shares with your partner, your organization reads a build’s id as
the build’s public id in its own VibeView API: in the app’s list of builds, on one build, and
in the answer when it uploads a build to an app (see the Apps API);
an account does not list them.
curl https://vibeview.io/api/v1/sessions/ \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"device_type":"ios","device_category":"phone","model":"iPhone 17","os_version":"iOS 26.4","app":"Xk3pQ9vB2m","build":"k3x9q2abm7tw"}'
The session object says which build it is pinned to: build is the pinned build’s id; it is
null when the session follows the app’s newest build, or when the pinned build has since been
deleted. Check it in the answer to confirm the pin.
installed_build says which build the session’s device runs: the build it installs when it
starts (the pinned build, or the app’s newest when it has no pin), then the last build you
installed into it (see Install a newer build). It is null until the
session has a device, and once that build is deleted.
Refusal (422 invalid_request, field: build) | When |
|---|---|
"build: not a build of this app; name a build id of the session's app." | No build of the session’s app has this id. The same answer whatever the id is, so it never says whether a build exists somewhere else. |
"build: this build's file has expired; upload it again or name another build." | The build’s file is no longer kept. |
"build: this build does not run on this device offering." | The build cannot run on the session’s device, for example a build made for physical Apple TV devices. |
build without app is refused like any create without an app (field: app). The app’s
rules judge the pinned build itself. Whether the build suits the device’s OS version is judged
when the session starts, as for the newest build.
A build that a running session uses is kept. If the pinned build’s file is no longer kept
when the session starts (for example after a long wait for a device), the session ends with
end_reason: "app_unavailable": it never installs another build instead. A pinned build that
is deleted ends the session with end_reason: "app_unavailable".
With reuse: true, the build is part of the match: a create with a build is given only a
live session pinned to that same build whose installed_build is that build too (or that has
none yet), and a create without one only a session that is not pinned.
Labels and reuse
labels tag a session with your own names for it, such as the project and purpose it is
for. They come back on the session (labels, an empty object when it has none), in the list
and in every session event.
With reuse: true, the create first looks for a live session of the account (pending,
starting or active) that was created with this route with exactly the same labels, the
same app, the same build, the same confined and the same offering. When there is one, it is the answer: 200 with
reused: true, and nothing new is created, even when the account is at its limit of
sessions or out of streaming minutes. Otherwise the session is created as usual (201,
reused: false). Every request with the same labels is answered with the same session:
the first creates it and the others are given it. A request that waits more than 2 seconds
for the one creating it, or that arrives while many with the same labels are waiting, is
told to retry instead (409 session_create_in_progress or 503 busy, both with
Retry-After; the SDK retries both), and its retry is given that session. A pending
session that was never started is reused only within the few minutes before it would end
unstarted; one waiting for a device is reused while it waits.
curl https://vibeview.io/api/v1/sessions/ \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"device_type":"ios","device_category":"phone","model":"iPhone 17","os_version":"iOS 26.4","app":"Xk3pQ9vB2m","labels":{"project":"p-42","purpose":"preview"},"reuse":true}'
{
"object": "session",
"id": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc",
"account": "org_95aa9b33d49e3752",
"status": "active",
"device": {"type": "ios", "category": "phone", "model": "iPhone 17", "os_version": "iOS 26.4"},
"app": "Xk3pQ9vB2m",
"build": null,
"installed_build": "k3x9q2abm7tw",
"queue": null,
"created": 1795269982,
"started": 1795269990,
"ended": null,
"end_reason": null,
"streaming_seconds": 8,
"warnings": [],
"livemode": false,
"labels": {"project": "p-42", "purpose": "preview"},
"confined": true,
"reused": true
}
- A reused session keeps the
launch_paramsit was created with: those of the later call are not applied (a short-lived value in them may have expired; open the app again withlaunch-appwhen you need new ones). - Starting a reused session that is already starting or active returns it as it is, so
every caller that got it can call
POST /api/v1/sessions/{session_id}/start. - Being handed a session is neither use nor a hold: it does not keep the session from ending for inactivity, and it does not renew its presence. After a reuse, call presence like any holder of the session, and send input as usual.
- A reused session can end at any moment, like any session: it may already be ending when
it is handed to you, or its device may have been lost (it then ends with its reason within
a few minutes, and the
session.endedevent says why). If it does not become usable, end it withDELETE /api/v1/sessions/{session_id}and create again: once the old session has ended, the next create with the same labels makes a new one. - Only sessions this route created for the account are reused: never another account’s, and never an embed or test-run session.
- While another request with the same labels is creating the account’s session, the create
answers
409 session_create_in_progresswithRetry-After. Retry: it then returns that session.
A session you create and never start ends after a few minutes, with
end_reason: "start_timeout". So does a session that stays in its app whose app could not be
opened on its device in time (retrying may work). A session that stays in its app whose app has
no build that can be installed ends with end_reason: "app_unavailable" (retrying does not help
until the app has one). A session that can leave its app starts without the app instead (see
Sessions that can leave their app).
The session stays in its app
A session runs only its own app, for your server and for a guest alike (unless it was created
with confined: false, see Sessions that can leave their app):
- Until the session has opened its app, and while another app is seen in front, the device
takes no input and gives no screen read:
control,launch-appand every agent tool (reads included) answer409 session_not_ready. Retry in a few seconds. Reading the session itself (GET /api/v1/sessions/{session_id}) always works. A guest’s input is ignored meanwhile, and the guest page shows its waiting state (waiting). - The device’s Home, app switcher, Lock and Siri buttons are not available.
controlwith one of them (HOME,APP_SWITCH,RECENTS,LOCK,SIDE_BUTTON,SIRI,APPLE_PAY) is409 app_not_in_session, and thepress_buttonagent tool answersok: falsewithreason: "app_not_in_session". Back stays available: Back on your app’s first screen (Menu on Apple TV) can leave the app, which is then brought back. launch-appopens only the session’s own app: any other app is409 app_not_in_session.- Links open only in the session’s app (Android); on iOS,
open_urlanswersok: falsewithreason: "app_not_in_session". - If your app itself opens another app (a link to the browser, a sign-in sheet of another
app), VibeView brings your app back. It sees the switch as the device starts it, usually
within half a second of the tap (on iPhone, iPad and Apple TV, before the other app is on
screen; measured on our own test devices), and it also checks which app is in front after
every input and every two seconds. From then until your app is back, the device shows no
picture and takes no input (
409 session_not_ready), and the guest page shows its waiting state. Input sent right after Back (Menu on Apple TV) waits until VibeView has checked that your app is still in front: usually under half a second, up to two seconds on Apple TV when that check takes longer. If your app keeps leaving or cannot be opened, VibeView tries again after about a minute; if it still cannot bring your app back, the session ends withend_reason: "app_lost". relaunch_appandset_app_languagestay available.
Sessions that can leave their app
When your contract includes it, a session created with confined: false is not held in its
app. Its confined is false on the session, in the list and in every session event. The
app is still required: the session installs and opens it. If the app cannot be installed (it
has no build that can run on the device, its build has expired, or the install failed), the
session still starts, without the app, on the device’s Home screen: it does not end, and its
warnings say why (app_build_missing, app_build_expired or app_install_failed). Read the
session’s warnings once it is active. Then:
- Home, the app switcher and the device’s other buttons work, for your server (
control, thepress_buttonagent tool), for a guest and on the device itself. - Nothing brings the app back when another app is in front, and the session never ends with
end_reason: "app_lost". Open the app again withlaunch-appwhen you need it in front. - There is no waiting state: the session takes input and screen reads as soon as it is
active, sosession_not_readyis never answered. launch-appopens any app on the device.open_urlon iOS opens the link on the device as given: a web link in the device’s browser, another link in the app that handles it. On Android it sends the link to the app the session last opened withlaunch-app, normally the session’s app: the link opens there, or the tool fails.
Your users can then reach whatever the device offers: its Home screen, its other apps including the browser, and Settings. Use it where your users need that, for example to see your app’s picture-in-picture after leaving it.
To have it in your contract, contact support@vibeview.io; your contract’s capabilities
(GET /api/v1/partners/{ptn}/contract) then include unconfined_sessions. Without it, confined: false is
403 unconfined_sessions_not_allowed and nothing is created. A session keeps what it was
created with, even if your contract changes later. Sessions your embed keys start for
visitors always stay in their app.
Start a session
POST /api/v1/sessions/{session_id}/start, scope sessions:write. No body.
curl -X POST https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/start \
-H "Authorization: Bearer $TOKEN"
The answer is 200 with the session as it is now: starting when a device was free. Read
the session (or wait for the session.started event) until it is active. Starting a
session that is already starting, active or waiting returns it as it is, so a retry is
safe. Starting an ended session is 409 session_ended.
When no device is free
The session waits. It stays pending with queue set:
{
"object": "session",
"id": "0c66e922-bcd1-4647-83e6-6e6c57a7f7e2",
"account": "org_95aa9b33d49e3752",
"status": "pending",
"device": {"type": "android", "category": "phone", "model": "Pixel 7 Pro", "os_version": "Android 15 (API 35)"},
"app": "Xk3pQ9vB2m",
"build": null,
"installed_build": null,
"queue": {"position": 1, "reason": "devices_busy"},
"created": 1795270109,
"started": null,
"ended": null,
"end_reason": null,
"streaming_seconds": 0,
"warnings": [],
"livemode": false,
"labels": {},
"confined": true
}
position counts from 1 among the sessions waiting for the same kind of device. reason
says why it waits (an open set; null when unknown):
reason | Meaning |
|---|---|
devices_busy | Every device of this kind is in use. |
devices_updating | The devices of this kind are being updated, or a free one is being prepared. |
account_limit | The account’s own sessions use its concurrent_sessions limit. |
partner_limit | Your accounts together use every session your contract allows at once. |
link_limit | A session one of your embed keys started: the key’s devices at once in this account are all in use. |
When a device frees, the session starts by itself and you receive session.started. A
session that gets no device within 30 minutes of its start call ends: failed, with
end_reason: "queue_timeout". To give up earlier, end it with DELETE.
An account may have as many sessions waiting as its concurrent_sessions limit. One more
start is refused, with a Retry-After header:
{
"detail": "As many of the account's sessions wait for a device as it may run at once; retry after Retry-After.",
"error": {
"code": "queue_full",
"message": "As many of the account's sessions wait for a device as it may run at once; retry after Retry-After.",
"request_id": "req_a3a3f716a98df28e748b6c90"
}
}
Read and list sessions
GET /api/v1/sessions/{session_id} and GET /api/v1/sessions/, scope sessions:read.
Reading a session does not keep it alive.
curl "https://vibeview.io/api/v1/sessions/?limit=2" \
-H "Authorization: Bearer $TOKEN"
The list is newest first and takes limit (1 to 100, default 10), starting_after (a
session id from the previous page) and status (only sessions in that status; repeat it
for several). A session of another account is 404 session_not_found.
Keep a session alive
A session driven from a server has no viewer, so VibeView cannot tell that you still need it. Hold it with presence calls while you use it:
curl -X POST https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/presence \
-H "Authorization: Bearer $TOKEN"
{
"object": "session_presence",
"session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc",
"expires_at": 1795270051,
"idle_ends_at": 1795270889
}
- Each call holds the session for 60 seconds (
expires_at). Call it every 15 seconds. - An active session that nobody holds ends with
end_reason: "no_client"about two minutes after it became active, or soon after your hold lapses. - A browser connected with a collab credential also holds the session: while one is watching, presence calls are not needed.
- Holding is not using. A session with no input ends for inactivity
(
end_reason: "inactivity_timeout"), not beforeidle_ends_at. Input, launch-app and the agent tools that act on the device count as use; presence, reads and the reading agent tools do not.idle_ends_atisnulluntil the session is active. - You may hold a pending or starting session. Presence does not extend a waiting session’s 30 minutes.
Drive the device
The three routes below need an active session. A session that is not active yet (or is
stopping) is 409 session_not_active; an ended one is 409 session_ended.
Device inputs are not idempotent. A repeated tap is a second tap, so these routes take
no Idempotency-Key. If a call fails with 503 device_unreachable, the input may or may
not have reached the device: read the session (and the screen) before you retry.
{
"detail": "The session's device gave no answer in time, or could not be reached: the input may or may not have acted. Read the session before you retry, after Retry-After.",
"error": {
"code": "device_unreachable",
"message": "The session's device gave no answer in time, or could not be reached: the input may or may not have acted. Read the session before you retry, after Retry-After.",
"request_id": "req_4a1912f4c62e6dddf0296b6a"
}
}
Send input
POST /api/v1/sessions/{session_id}/control, scope sessions:write. One input, as a
person’s touch or key press.
| Field | Meaning |
|---|---|
action | tap, swipe, rotate, shake, button, key, touch_start, touch_move or touch_end. |
x, y | The point, in the device’s screen pixels as its screenshots show them. |
x2, y2 | A swipe’s end. |
duration | Milliseconds, 0 to 60000. |
rotation | Degrees: 0, 90, 180 or 270. |
button | BACK, MENU and so on. On a session that stays in its app, a button that leaves the app is refused (see below). |
keycode | Android: BACK, MENU, DPAD_UP and so on. |
curl https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/control \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"action":"tap","x":195,"y":420}'
{"object": "session_control", "session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc", "action": "tap"}
The answer means the input was sent to the device. To see its effect, take a screenshot or
read the screen with an agent tool. On a session that stays in its app (confined: true), a
button or key that would leave the app (HOME, APP_SWITCH, RECENTS, LOCK,
SIDE_BUTTON, SIRI, APPLE_PAY) is 409 app_not_in_session and is not sent.
Open an app
POST /api/v1/sessions/{session_id}/launch-app, scope sessions:write. Opens the session’s
app again, by its bundle id or package name, optionally with activity_name (Android) and
launch_params (a flat JSON object).
curl https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/launch-app \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"package_name":"com.example.shop","launch_params":{"screen":"cart"}}'
{"object": "app_launch", "session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc", "package_name": "com.example.shop"}
On a session that stays in its app (confined: true), any other app is refused before
anything reaches the device:
{
"detail": "The session runs only its own app: this would open another app or leave it (Home, the app switcher, Lock).",
"error": {
"code": "app_not_in_session",
"message": "The session runs only its own app: this would open another app or leave it (Home, the app switcher, Lock).",
"request_id": "req_0c5be1a8f2d94e7a61b3c0d9"
}
}
Install a newer build
POST /api/v1/sessions/{session_id}/install, scope sessions:write. Installs a build of the
session’s app into an active session and opens it: the app restarts on the new build, with
launch_params if you send them. The answer is the session, and its installed_build is the
build installed last. The call waits for the install: usually seconds, at most about five and a
half minutes.
curl https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/install \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"build":"m4t8w2kq9dxa","launch_params":{"screen":"cart"}}'
- Only a build of the session’s own app, the same builds
buildtakes on create. A build of another app is refused, also on a session created withconfined: false. - One install at a time per session: a second install while one runs answers
409 session_not_ready, withRetry-After. Retry once the first has answered. Rarely, an install itself answers409 session_not_ready: its outcome is still being settled, or the device no longer runs the session, and the session may end. Read the session afterRetry-After. - A session that stays in its app (
confined: true) takes no input while the install runs (409 session_not_ready). - It is not idempotent. Before you retry, read the session:
installed_buildsays which build it runs.
If the install fails, the session keeps its previous build when the device can still show it.
Otherwise the session ends: also when the new build installed but its app could not be shown in
front, which answers install_failed with the session ended (end_reason: "start_timeout").
Read the session after an install_failed. If the install could not reach the device, the
session keeps its previous build. A build deleted while it installs ends the session with
end_reason: "app_unavailable".
If an install does not finish in time, the request answers install_timeout and the session
ends (end_reason: "infrastructure_error"). Start a new session with the build.
After an unexpected error (500 internal_error), read the session: it may end within a few
minutes (end_reason: "infrastructure_error").
| Message | What to do |
|---|---|
409 app_not_in_session | The build is not one of the session’s app. Name a build of its app. |
404 app_build_not_found | No build the session can install has this id. |
422 invalid_request (field: build) | The build’s file has expired, or it cannot run on the device. Upload it again or name another. |
409 session_not_ready | The app is not in front, or another install runs, or (rarely) this install’s outcome is still being settled, or the device no longer runs the session, and the session may end. Read the session after Retry-After. |
422 install_failed | The device could not install the build. Read the session. |
503 device_unreachable | The install could not reach the device; the session keeps its build. Retry after Retry-After. |
504 install_timeout | The install did not finish in time and the session ended. Start a new session with the build. |
409 session_ended | The session ended (for example, it could not show its app after the install). |
Agent tools
POST /api/v1/sessions/{session_id}/agent/tools, scope sessions:write. Reads or drives
the device one tool at a time, the way an AI agent does: find elements on screen, tap them
by reference, type, scroll, and check the result.
curl https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/agent/tools \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"tool":"ui_tree"}'
{
"object": "tool_result",
"tool": "ui_tree",
"ok": true,
"result": null,
"observation": {
"kind": "full",
"text": "@e9 button \"Health\" (360,1120,192,264)\n@e10 button \"Wallet\" (632,1120,192,264)\n@e11 button \"Settings\" (896,1120,208,264)\n@e12 slider \"Search\" value=\"Page 1 of 2\" (472,2080,232,88)\n@e13 button \"Safari\" (360,2280,192,192)"
},
"idle_warning": null,
"reason": null
}
(A home screen, shortened.) Each element gets a reference (@e11) that the other tools take:
curl https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/agent/tools \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"tool":"tap","args":{"ref":"@e11"}}'
{
"object": "tool_result",
"tool": "tap",
"ok": true,
"result": {
"status": "ok",
"action": "tapped",
"ref": "@e11",
"x": 997,
"y": 1246
},
"observation": {
"kind": "diff",
"text": "UI Tree changed (+15 added, -14 removed, ~0 changed; 0 of 15 unchanged):\n+ @e15 [Application] \"Settings\"\n+ @e16 [Heading] \"Settings\"\n+ @e17 [TextField] \"Search\"\n…"
},
"idle_warning": null,
"reason": null
}
(Other members of result omitted, and the observation text shortened; see The result.)
The tools:
| Tool | Does |
|---|---|
ui_tree | The screen’s elements as text, each one you can act on with a reference (@e1). |
screenshot | The screen as an inline PNG data URL (args.preview: true adds a smaller copy). |
logs | The app’s recent log lines (args.since, args.tail). |
find_element | Find an element by its text or id. |
wait | Wait up to 30 seconds (args.seconds). |
tap | Tap an element by reference. |
tap_coordinates | Tap at screen coordinates. |
long_press | Press and hold an element or a point. |
swipe | Swipe in a direction or between two points. |
scroll_until_visible | Scroll until a text or id is on screen (at most 50 scrolls). |
gesture_preset | One of a fixed set of gestures. |
drag | Drag from one point to another. |
alert | Answer a system alert with one of its buttons. |
type_text | Type text into the focused field (at most 10,000 characters). |
clear_text | Clear the focused field. |
press_button | Press a device button (back, the TV remote’s keys). On a session that stays in its app, home, recents, lock and siri leave the app: ok: false, reason: "app_not_in_session". |
open_url | Open a link. On a session that stays in its app: on Android, a view intent to the session’s app only; on iOS, ok: false with reason: "app_not_in_session". On a session that can leave its app: on iOS, the device opens the link as given (a web link in its browser); on Android, a view intent to the app the session last opened, normally the session’s app (it opens there or the tool fails). |
set_posture | Fold or unfold a foldable device. |
rotate | Rotate the device. |
shake | Shake the device. |
set_location | Set the device’s simulated location. |
set_status_bar | Show a clean status bar or the device’s real one. |
set_app_language | Run the app in another language (the app restarts). |
relaunch_app | Close the app and start it again. |
tap_focused_tv | Select the focused element (TV). |
focus_element_tv | Move the focus to an element (TV). |
ui_tree, screenshot, logs, find_element and wait are reads: they keep the session
held but are not use. Every other tool is use.
The result
Every tool that reached the device answers 200 with the same object:
| Member | Meaning |
|---|---|
ok | true when the tool did what it was asked. |
result | The tool’s own answer: a data URL string for screenshot (or, with args.preview: true, an object with image and preview), null for ui_tree, an object for the others. See below. |
observation | The screen after the tool: kind (full, diff, unchanged or unavailable) and text. null for screenshot and logs. |
idle_warning | Set on a reading tool when the session is close to ending for inactivity: reason and seconds_remaining. |
reason | When ok is false because the device refused the action: element_not_visible, gesture_failed, alert_failed, no_app_launched, link_not_opened, app_not_in_session (the tool would open another app or leave the session’s app) or action_failed. Otherwise null. An open set: new values may appear, so handle one you do not know as action_failed. |
In the result object, rely only on these members:
| Member | Meaning |
|---|---|
status | ok; error when the tool refused (the reason in message or warning); warning when it ran but missed, for example a tap that did not land or a scroll that never found its text (the reason in warning). |
action | What the tool did, or why it stopped (tapped, tap_failed, …). |
ref | The element reference the tool acted on. |
x, y | The point it acted on, in the screen’s coordinates. |
message, warning | A sentence saying why ok is false (or, for a warning, what to check). |
verified | type_text and clear_text: false when the field does not hold the text afterwards (with a warning); null when it could not be checked (still ok). |
found | find_element: false when nothing matched (still ok, with a message). |
result can carry other members. They are informational, written for an AI agent that drives
the device, and may change or disappear without notice: do not build on them.
A tool the device refused:
{
"object": "tool_result",
"tool": "relaunch_app",
"ok": false,
"result": {"status": "error", "action": "relaunch_failed", "message": "relaunch_app failed: No app is in the foreground. Launch an app first."},
"observation": {"kind": "unchanged", "text": "screen unchanged"},
"idle_warning": null,
"reason": "no_app_launched"
}
Other answers:
| Answer | When |
|---|---|
422 tool_refused | The tool is not in the list above (field: tool). |
422 invalid_request | Its args are not valid (field: args), or the body is larger than 64 KB (the same limit holds for control, launch-app and presence). |
409 tool_refused | This session’s device cannot run agent tools. |
429 rate_limited | One tool runs on a session at a time; when 4 more already wait, another call is refused at once ("limit": "session_tools", with Retry-After). |
503 device_unreachable | The device gave no answer. The tool may or may not have acted: read the session before you retry. |
Show a session in a browser
A browser never gets your key or a token. It gets a collab credential for one session: a link to a guest page that shows the device, and lets the person use it if you allow it.
PUT /api/v1/sessions/{session_id}/collab, scope sessions:write.
| Field | Meaning |
|---|---|
enabled | true mints a credential. false revokes every credential of the session and disconnects every guest. |
role | view (watch) or control (watch and use the device: touch, keys, text, rotation and device settings). Default view. |
ttl_seconds | How long a browser can connect with it: 60 to 3600 seconds, 3600 by default. A value above 3600, up to 86400, is shortened to 3600; above 86400 it is 422 invalid_request. expires_at gives the real time. |
regenerate | true revokes the session’s earlier credentials and disconnects their guests before minting the new one. |
curl -X PUT https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc/collab \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"enabled":true,"role":"control","ttl_seconds":600}'
{
"object": "collab_credential",
"session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc",
"token": "eyJ…",
"url": "https://vibeview.io/s/eyJ…",
"expires_at": 1795270629,
"role": "control"
}
Give the url to one browser. The answer is shown once (Cache-Control: no-store).
-
expires_atlimits connecting, not watching. After it, a browser cannot connect or reconnect with this credential. A guest who is already connected stays until the session ends or you replace or turn off the credential; if its video drops afterexpires_at, the video may not come back. -
Minting again gives another credential; the earlier ones still work until their
expires_at, unless you sendregenerate: true. -
Turning it off with
{"enabled": false}disconnects every guest at once:{"object": "collab_credential", "session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc", "token": null, "url": null, "expires_at": null, "role": null} -
Guests count against the account’s
collab_guests_per_session: a browser over it is refused. -
A
controlguest uses your app as a person would, and on a session that stays in its app stays in it: the guest page shows no Home button, and Home, the app switcher, Lock and Siri (as buttons or as keys, Apple TV’s remote included) do nothing (see The session stays in its app). On a session created withconfined: falsethe guest page shows Home and the guest can leave the app (see Sessions that can leave their app). A guest cannot use VibeView’s open-link or deep-link commands. -
A repeat of a mint with the same
Idempotency-Keyis409 already_creatednaming the session: the credential cannot be shown again. A repeat of{"enabled": false}returns the same answer again. An ended session is409 session_ended.
Check who is watching with GET /api/v1/sessions/{session_id}/collab (scope
sessions:read); it never returns a credential:
{"object": "collab_status", "session": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc", "enabled": true, "guest_count": 0, "max_guests": 2}
The guest page
The guest page shows no VibeView name or logo: not in the page, not in the browser tab’s title or icon, and not in a link preview in chat or email. Opened on its own, it shows the device and short, neutral messages (“This session has ended.”, “This link has expired.”). Its tab title is the app’s name, or “Device session”.
When you put the page in an <iframe> in your own product, it shows only the device (a
blank surface when there is nothing to show) and tells your page its state, so you write
the words. Listen for messages from the frame:
window.addEventListener("message", (event) => {
if (event.origin !== "https://vibeview.io") return;
const m = event.data;
if (m && m.source === "vibeview" && m.type === "session_state") {
showDeviceState(m.code); // your own UI
}
});
Each message is exactly {"source": "vibeview", "type": "session_state", "code": …}, sent
once per change. A session that starts and plays sends connecting, waiting, then
playing; ending it sends session_ended.
code | The page |
|---|---|
connecting | Is connecting to the session. |
waiting | Is waiting for the device or the app to be ready, or for your app to come back to the front. |
playing | Shows the device. |
reconnecting | Lost the connection and is getting it back. |
credential_invalid | Was given a link that does not work. |
credential_expired | Was given a link past its expires_at. |
credential_replaced | Its link was replaced or turned off. |
session_full | Cannot join: the session has as many guests as it may. |
session_ended | The session ended. |
connection_lost | Lost the connection for good; a reload may help. |
browser_unsupported | Is in a browser too old to play the device. |
unavailable | Cannot show the session for another reason. |
The set is closed: these are all the codes the page sends.
If you build your own page with the VibeView browser SDK instead, open the session with the
credential’s token (see The browser SDK for partners). The SDK’s session object identifies it by sessionId (your session id);
its numeric id and deviceId are not set for your sessions.
The page is served from vibeview.io. A credential URL minted before this page moved
(https://vibeview.io/collab/…) still works: it opens the same page.
End a session
DELETE /api/v1/sessions/{session_id}, scope sessions:write. Ends the session, or takes
a waiting one out of the queue, and returns it ended:
curl -X DELETE https://vibeview.io/api/v1/sessions/ea2d0d1a-a6ee-498f-ba17-26dd51469efc \
-H "Authorization: Bearer $TOKEN"
{
"object": "session",
"id": "ea2d0d1a-a6ee-498f-ba17-26dd51469efc",
"account": "org_95aa9b33d49e3752",
"status": "stopped",
"device": {"type": "ios", "category": "phone", "model": "iPhone 17", "os_version": "iOS 26.4"},
"app": "Xk3pQ9vB2m",
"build": null,
"installed_build": "k3x9q2abm7tw",
"queue": null,
"created": 1795269982,
"started": 1795269989,
"ended": 1795270082,
"end_reason": "stopped",
"streaming_seconds": 99,
"warnings": [],
"livemode": false,
"labels": {},
"confined": true
}
Ending a session that already ended returns it unchanged, so a retry is safe. Its guests see that the session has ended.
End reasons
end_reason | Why the session ended |
|---|---|
stopped | You ended it. |
no_client | Nobody held it: no presence calls and no browser. |
inactivity_timeout | It was held but had no input until idle_ends_at. |
session_length_limit | It reached the account’s max_session_minutes. |
usage_limit_reached | The account’s streaming minutes for the period ran out, extra minutes included (for a session that started in an earlier period, that period’s). |
queue_timeout | It waited 30 minutes and no device became free. |
start_timeout | It was never started, or its device did not come up in time, or its app could not be shown in front after an install. |
account_suspended | You suspended the account, or your partner or your own organization cannot be used. |
account_deleted | The account was deleted. |
stopped_by_platform | VibeView support ended it, or suspended its account. |
device_storage_limit | The app filled the device’s storage. |
app_unavailable | The app it was started on is no longer shared with the account, or has no build that can be installed. |
app_not_allowed | Its app is one VibeView does not allow to run. |
app_lost | The session’s app kept closing or leaving the screen and could not be brought back. A new session may work; if it keeps happening, check the app. |
link_revoked | The embed key that started it was revoked, or could no longer serve sessions. |
link_session_limit | It reached its embed key’s longest session. |
device_crashed, device_restarted, video_lost | The device or its video failed. |
infrastructure_error | A failure on our side. Start a new session. |
unknown | No reason was recorded. |
New reasons may be added: treat an unknown one like unknown.
Before a session ends because it reached max_session_minutes (up to a minute before), or
because the account’s streaming minutes are running out (up to two minutes before), you
receive session.cutoff_warning, with when it will end, why, and the account period it is
measured against:
{
"object": "event",
"id": "evt_428e37ff70ba9de8d32b314f",
"type": "session.cutoff_warning",
"created": 1795270496,
"api_version": "2026-11-09",
"partner": "ptn_34e771b2c0472a4d",
"account": {"id": "org_5c450c1030ce18e8", "external_ref": "cust_1043"},
"data": {
"object": {
"object": "session",
"id": "3cc37ff2-1050-47a6-9338-3628809e4e9e",
"account": "org_5c450c1030ce18e8",
"status": "active",
"device": {"type": "ios", "category": "phone", "model": "iPhone 17", "os_version": "iOS 26.4"},
"app": "Xk3pQ9vB2m",
"build": null,
"installed_build": "k3x9q2abm7tw",
"queue": null,
"created": 1795270469,
"started": 1795270470,
"ended": null,
"end_reason": null,
"streaming_seconds": 26,
"warnings": [],
"livemode": false,
"labels": {},
"confined": true
},
"cutoff": {
"reason": "session_length_limit",
"ends_at": 1795270529,
"period": {"start": 1795219200, "end": 1797811200}
}
},
"livemode": false
}
The session ends at about ends_at, with cutoff.reason as its end_reason. For the
streaming minutes (usage_limit_reached), ends_at is an estimate at the current rate,
and you can keep the session going by giving the account
extra minutes for cutoff.period (its start is the
period_start to send). A session that started in the previous period names that period.
Warnings
warnings lists things about a session you may want to act on, each a code (an open set)
and a fixed message. It is empty for most sessions.
Session events
| Event | When |
|---|---|
session.created | A session was created. |
session.started | It became active. |
session.cutoff_warning | It will end soon because of a limit (data.cutoff). |
session.ended | It ended, for any reason (see end_reason). |
Each event’s data.object is the session as it was then. See
Events and webhooks.