/agent/{id}/launch

Add an agent to the launch queue. The most important parameters is output, carefully choose yours when launching your agent with the API. For agents which take times to end, Phantombuster will send a space character every 10 seconds to prevent any timeout.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required

ID of the agent to launch.

Query Params
string
enum

This allows you to choose what type of response to receive.

  • json - Standard JSON output to get back a containerId in JSON. This ID can later be used to track this launch and get console output by calling /api/v1/agent/{agentId}/output.json?containerId={containerId}.
  • result-object - Result object output to get a blocking JSON response which will close when your agent finishes. The response will contain your agent’s exit code (Number) and its result object (PlainObject) if it was set (using setResultObject()). This endpoint is very useful for getting a response from your agents “synchronously” — just make a single HTTP request and wait for your result object/exit code.
  • first-result-object - Use first-result-object instead of result-object to have the request terminate immediately after the first call to setResultObject(). This is the fastest way to get a response from an agent using the API. However you will only get the result object and nothing else (no exit code or console output for example).
  • result-object-with-output - Use result-object-with-output instead of result-object to get the console output of your agent in addition to all the other fields.
  • event-stream - Event stream output to get a text/event-stream HTTP response. Each line of console output is sent as an event stream message starting with data:. When you receive the first message, you know the agent has started. When the agent has finished, the connection is closed. At regular intervals, event stream comments (starting with :) are sent to keep the connection alive. See a demo of this endpoint in action.
  • raw - Raw output to get an HTTP text/plain, chunked, streaming response of the raw console output of the agent. This is not recommended as almost all HTTP clients will timeout at one point or another, especially if your agent stays in queue for a few minutes (in which case the endpoint will send zero bytes for a few minutes, waiting for the agent to start — even cURL and Wget struggle to handle non-transmitting HTTP responses).
Allowed:
string

JSON argument as a String.The argument can be retrieved with buster.argument in the agent’s script.

boolean

If true, argument will be saved as the default launch options for the agent.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json