https://api.styne.ai. Every request carries Authorization: Bearer $STYNE_API_KEY.
Create, save and use a profile
profile field. Connect to its cdp_url as with any browser; the
page is signed in as it was left. Save again at any time to keep the newer state; the earlier one is replaced.
Saved when the session ends
A session started withprofile (and without fork) has persist: true by default: whenever it ends, its browser is
saved into the profile on the server, with no call from your code. That holds for every way a session ends:
DELETE /browsers/{id}from any process, the dashboard, or a drop-in route (Steel, Browserbase,DELETE /sandboxes/{id}). The delete answers204at once; the save runs after it and billing stops at the delete.- The session’s
timeout. The browser is paused at its timeout, saved, then stopped. - A stop of the machine it runs on. A browser whose machine was lost before it could be saved is reported on the profile.
"persist": false to keep
the explicit POST /profiles/{id}/save as the only way to write the profile. persist: true without profile, or with
fork: true (a copy that is not bound), is a 422.
A save is not lost when it fails: the browser is kept paused, the save is tried again (after 30 s, then a doubling wait up
to 15 minutes, for up to 24 hours), and the profile says so in last_save. A new session from a profile whose save is still
running waits for it (up to 60 s), so a delete followed at once by a create starts with the state the first session left.
GET /profiles/{id} answers the newest save:
Parallel runs
{"profile": "<id>", "fork": true} starts a copy of the saved browser that is not bound to the profile, so many runs can
use the same login at once and none of them changes it. POST /v1/profiles/{id}/fork makes a new profile that starts as a
copy of this one (for example for a second agent of the same person); it takes end_user and label and answers the new
profile.
Is the login still valid
POST /v1/profiles/{id}/check starts a copy of the saved browser, opens a page and tests what you expect to see when the
person is signed in:
url_matches (a regular expression on the final address), selector_exists, text_contains, js_expr
(a JavaScript expression that is truthy) and cookie (a cookie name that is present). All of them must hold within
timeout seconds (default 30, at most 45). The answer carries ok, the final url and the result of each expectation.
The newest outcome is also on the profile as check. When ok is false, send the person a new sign-in link.
Hosted sign-in links
When your end user has to sign in themselves, create a link and send it to them:url, the link’s address. Open it on a phone or a computer: the page shows a real browser on
start_url that the person controls with touch, mouse and keyboard (captchas and two-step codes work as they do in
any browser). The page can only visit the start address, the hosts it redirects to while it first loads, and
allow_hosts; it has no address bar and gives no access to the browser’s DevTools. The address works for one person on one device
and carries no API key.
The link completes when the person presses Done or when success_check holds (url_matches, selector_exists,
text_contains or cookie). The browser is then saved into the profile and stopped. Read GET /signin-links/{id}:
state is pending, opened, completed, expired or canceled, and check_passed tells whether the success check
held. Then start the person’s signed-in browser with POST /browsers {"profile": "<profile_id>"}.
Calls
Every path is also served under/v1 (for example /v1/profiles).
A profile of another account answers
404. A profile with no saved browser answers 409 (profile_empty) to fork and
check. A profile counts as one saved snapshot against the plan’s snapshot allowance.