Skip to main content
POST
POST /act is Membrane’s unified entry point for running an action through a connection. See the Actions guide for the conceptual walkthrough — this page is the endpoint reference.

Dispatch styles

Exactly one of id, key, api, or code per call. Sending more than one returns 400.

Resolving a connection

Every dispatch needs a connection. Membrane resolves one in this order:
  1. connectionId — direct.
  2. connectionKey — look up by key.
  3. integrationId or integrationKey — use that integration’s default connection.
  4. Workspace default connection.
Reusable-action dispatches that target a connection-scoped or integration-scoped action use the action’s own scope automatically — the body fields above only kick in when the action’s scope doesn’t already resolve a connection. For inline dispatches (api / code), the connection must resolve to something — otherwise the request returns 400.

Request body

Response

Every response — success or failure — carries an actionRunId. Pass it to GET /action-run-logs/{id} to inspect the resolved action, mapped input, raw HTTP exchange, and any errors. On failure the body still includes actionRunId alongside the error.

Replay from a run log

Every action run log carries an action field — the complete /act body that was used. Pass it back unchanged to re-run the same dispatch:
The snapshot is the source of truth for “what ran”. Top-level input and connectionId on the run log are deprecated — read them from action instead.

Legacy: POST /actions/{selector}/run

POST /actions/{selector}/run is the older endpoint for running a saved action. It still works for existing callers but is deprecated/act covers all the same cases plus inline api and code dispatch. Use /act for new code.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
id
string

ID of the action to run.

key
string

Key of the action to run. Pass connectionId or connectionKey to select a connection-specific variant.

api
object

Inline HTTP request through the selected connection's auth and base URL; pair with connectionId or connectionKey.

browser
object

Browser Session dispatch; pair with connectionId, and use the returned actionRunId as its session id.

code
string

Sandboxed JavaScript module exporting a function that receives { input, membrane, ... }; its return value is the action output.

connectionId
string

Connection ID for this run; a connection-level action variant is preferred over the universal variant.

connectionKey
string

Connection key for this run.

input
object

Input passed to the action, matching its input schema. Must be a JSON object.

meta
object

Arbitrary metadata stored on the action run log.

Response

200 - application/json

Run a saved action by id/key, or dispatch inline with api, code, or browser, through the connection selected by connectionId/connectionKey (browser requires connectionId). Returns { output, actionRunId }; for browser dispatch, actionRunId is the Browser Session id.

output
any
actionRunId
string