/agents/save

Updates or creates a new agent. If an id is provided, the corresponding agent will be updated. Otherwise, a new agent will be created.

Body Params
string

If set, the agent with the corresponding id will be updated.

string | null

If set, the upserted agent will be linked to the specified organization.

string | null

If set, the upserted agent will be assigned to the specified script.

string | null

If set, the upserted agent will be assigned to the specified branch.

string | null
enum

If set, the upserted agent will be assigned to the specified environment.

Allowed:
string | null

Name of the agent.

number | null

When set, the execution time of the agent will be limited by the provided value. If this limit is exceeded, the agent will be stopped.

string | null
enum

Agent file management type. The type 'folders' means create new files. The type 'mix' means combine new and previous files. The type 'delete' means delete previous files.

Allowed:
number | null

Max amount of folders for file management.

number | null

Sets the maximum amount of concurrent executions of the agent.

number | null

Sets the maximum amount of retries the agent will do before aborting.

string
enum

Sets how the agent will be launched. Either "manually", "repeatedly", "once" or "after agent".

Allowed:
number | null

Must be set when launchType is set to "once". Sets the launch time of the agent.

string | null

Must be set when launchType is set to "after agent". Sets the id of the agent which will trigger the launch of this agent.

repeatedLaunchTimes
object | null

Must be set when launchType is set to "repeatedly". Schedules when the agent will be launched automatically.

notifications
object | null

Sets the notification settings of the agent.

string
enum

If set to "none", no proxy will be used. If set to "http" a single http proxy will be used. If set to "pool" the proxies from the pool will be used.

Allowed:
string | null

When "proxyType" is set to "http", this should be the http address of the proxy. When set to "pool" this should be the name of the proxy pool you wish to use.

string | null

Sets the username used to authenticate the proxy. Should be used when "proxyType" is set to "http".

string | null

Sets the password used to authenticate the proxy. Should be used when "proxyType" is set to "http".

Default argument used to launch the agent.

string | null

Sets the agent's object. Should be a JSON string.

string | null
enum

Automatically sets the agent's launch schedule according to a preset.

boolean

If true, the manifest's default settings will be applied to the agent.

number | null

Defines when the agent will launch once a slave agent finishes. When not set, the platform chooses a value between 10 and 15 minutes randomly.

masterAgentLaunchOnExitCodes

When set, the agent will be launched automatically if the finishing slave agent’s exit code is found in the array or if the value is set to "all".

squidLeaseIdentifier
object | null

Sets the agent's Squid lease configuration.

boolean

If true, the agent's setup is considered complete.

boolean

If true, the updated settings will be propagated to the workers regardless of the session type.

number | null

The date when the agent will be deleted.

string | null

Optional key for idempotent operations - only for creating an agent.

internalMetadata
object | null

Key-value pairs reserved for PhantomBuster internal use.

userCustomMetadata
object | null

User-defined key-value pairs for tagging and filtering agents.

Headers
string

ID of the org that is perfoming the operation (not necessary when using a third party key)

Responses

400

No such org, script, branch or environment or invalid parameters provided.

401

Script is not from your org and isn't public or is in staging.

402

Maximum amount of agents reached. Please upgrade your plan to unlock more slots for your agents.

412

Script does not exist in the specified branch.

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