Create an agent browser session for a project
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const project = await client.projects.createAgentSession({ projectId: '<projectId>', session_hours: 1,});console.log(project);curl -X POST 'https://app.flora.ai/api/v1/projects/<projectId>/agent-session' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "session_hours": 1}'Mints a one-shot sign-in link for an agent that has its own browser (for example Claude Code Desktop or Cowork with WebMCP). Opening the link signs the agent in as the credential’s user and lands on the project canvas with FLORA’s in-page WebMCP tools enabled, so the agent can drive the canvas directly. The link is consumed on first visit and the session it grants lasts session_hours (1–24, default 8) and acts as the user — treat it as a secret. The session acts as the whole user, so only OAuth credentials and API keys created before per-workspace permissions existed may create one; keys that carry a permission map are refused with 403 forbidden.
Error responses use the standard error body.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Project identifier
Project identifier
Request Body
Section titled “Request Body ”object
How long the browser session minted by the link lasts, in hours (1–24, default 8).
Example generated
{ "session_hours": 1}Responses
Section titled “ Responses ”Agent session link created.
object
Project identifier
Workspace identifier
One-shot sign-in link. Opening it in a browser signs the agent in as the credential’s user and lands on the project canvas with WebMCP enabled. It is consumed on first visit; navigate within the tab rather than reloading it.
Project canvas URL
When the browser session minted by the link expires
Session length the link grants
Example
{ "project_id": "prj_abc123", "workspace_id": "ws_abc123"}