Using Profiles
Profiles save browser identity (cookies, localStorage, user agent) as reusable snapshots. Load a profile into any session to restore login state without re-authenticating.
Create a profile
curl -X POST https://api.browsr.dev/profiles \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "logged-in-user",
"data": {
"cookies": [{"name": "session", "value": "abc", "domain": ".example.com"}],
"local_storage": [{"domain": "example.com", "items": [{"key": "token", "value": "xyz"}]}],
"user_agent": "Mozilla/5.0 ..."
}
}'
Use a profile in a session
Pass the profile ID when creating a session:
curl -X POST https://api.browsr.dev/sessions \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"profile_id": "PROFILE_UUID", "headless": true}'
The session starts with the saved cookies, localStorage, and user agent pre-loaded.
List profiles
curl https://api.browsr.dev/profiles \
-H "Authorization: Bearer $BROWSR_API_KEY"
Get a profile
curl https://api.browsr.dev/profiles/PROFILE_ID \
-H "Authorization: Bearer $BROWSR_API_KEY"
Update a profile
curl -X PUT https://api.browsr.dev/profiles/PROFILE_ID \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "updated-profile",
"data": {
"cookies": [{"name": "session", "value": "new-value", "domain": ".example.com"}]
}
}'
Delete a profile
curl -X DELETE https://api.browsr.dev/profiles/PROFILE_ID \
-H "Authorization: Bearer $BROWSR_API_KEY"