---
title: "Create a browser action"
method: POST
path: "/browser-actions"
tags: ["Others"]
---

# Create a browser action

`POST /browser-actions`

Creates a single-use link to one of the project's trusted origins that, when opened, makes the Hexclave SDK on that page perform an action in the browser: signing in as a given user (impersonation) or showing the clickmap overlay. Requires server or higher access.

## Request body

- object
  - `type` 'impersonation' | 'clickmap-overlay', required — The action the SDK performs after the link is opened. `impersonation` signs the browser in as `user_id`; `clickmap-overlay` mounts the clickmap overlay.
  - `origin` string, required — The project's trusted origin where the link opens. The action can only be consumed by a request whose Origin header matches this value.
  - `expires_in_millis` integer — How long the single-use link remains redeemable, in milliseconds.
  - `session_expires_in_millis` integer — Lifetime of the impersonation session, measured from link creation. Ignored for `clickmap-overlay` actions.
  - `user_id` string — ID of the user to impersonate. Required when `type` is `impersonation` and ignored for `clickmap-overlay`.

## Response `200`

Successful response

- object
  - `id` string, required — Opaque, single-use browser action ID.
  - `url` string, required — URL at the requested trusted origin containing the browser action ID. Open it in the target browser to perform the action.
  - `expires_at_millis` number, required — Unix timestamp in milliseconds after which the browser action can no longer be consumed.

---

[API](https://skmtc.net/hexclave/apis/hexclave-rest-api-3.md) · [All operations](https://skmtc.net/hexclave/apis/hexclave-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hexclave/hexclave-rest-api-3/revisions/9b9326fe08a5/schema)
