browserlayer / docsPrivate alphaDashboard ↗

Start here

Websites → endpoints and syncsInstallRun your first endpointAtlas walkthrough

Build integrations

Project structureCapture a websiteBuild with your coding agentEndpointsSteps and connector flowsTyped referencesAuthenticationUser input and MFABrowser interactions and HTTPSync recordsCheckpoints and deletionsTest an integrationDebug in Studio

Use in your app

Connect accounts with hosted LinkCall an endpointConsume sync recordsReceive webhooks

Deploy

Deploy and verify

Reference

SDK referenceHTTP APICLI reference
Use in your appMarkdown

Call an endpoint

Your backend submits a run, then reads its status and output.

Start the operation

sh
curl "$BROWSERLAYER_API_URL/runs" \
  -H "Authorization: Bearer $BROWSERLAYER_API_KEY" \
  -H "Idempotency-Key: $OPERATION_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "integration":"atlas-demo",
    "flow":"cancel-booking",
    "connection":"connection-id",
    "input":{"bookingId":"<booking-id>"}
  }'

flow is the HTTP field for the public endpoint ID. Internal connector flows cannot be called through this endpoint.

Persist OPERATION_KEY in your application database before sending the request. Reuse it for retries of that same user intention, including after a timeout or page refresh.

Read the result

sh
curl "$BROWSERLAYER_API_URL/runs/$RUN_ID" \
  -H "Authorization: Bearer $BROWSERLAYER_API_KEY"
StatusWhat your app does
queued, runningKeep polling
awaiting_inputOpen hosted Link for this run
completedRead output
failedRead error; do not blindly repeat a mutation
cancelledShow cancellation

TypeScript

ts
const response = await fetch(`${process.env.BROWSERLAYER_API_URL}/runs`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BROWSERLAYER_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": operation.key,
  },
  body: JSON.stringify({
    integration: "atlas-demo",
    flow: "cancel-booking",
    connection: operation.connection,
    input: { bookingId: operation.booking },
  }),
});
if (!response.ok) throw new Error(`Admission failed: ${response.status}`);
const { id: runId } = await response.json();

Here operation is the persisted user operation in your backend. Authorize its connection against the signed-in user. Application keys are environment-scoped, not individual-user authorization.

← Connect accounts with hosted LinkConsume sync records →
On this pageStart the operationRead the resultTypeScript