POST /agents/launch-sync
Launches an agent and streams execution status in real-time using NDJSON format. The stream begins with a start message exposing the containerId (so clients can reconnect via /containers/attach on disconnect) and then includes heartbeat messages, execution summary, and error messages if any occur. Optionally includes log lines when the includeLogs body parameter is set to true.
Request
- Base URLhttps://api.phantombuster.com/api/v2
- AuthAPI key in header X-Phantombuster-Key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
ID of the org that is perfoming the operation (not necessary when using a third party key)
Request body
Response
Agent launched successfully. Response is a stream of NDJSON messages with types - start (sent first, with containerId and agentId), heartbeat (periodic keep-alive), logs (container output), summary (final execution result with containerId, executionTime, and optional exitCode), or error (if something goes wrong).
Changes
No recorded changes to this operation across all 1 revision of this API.