- Followed the Python SDK Setup guide for installation and initialization.
- Obtained your credentials as described in Managing API Keys.
- Successfully initialized the
agent
object as shown in the SDK Setup guide.
Starting an Automation Task
To initiate a browser automation task for one of your end-users, use thestart_task
method. You must provide the unique ID of the user within your system (developer_user_id
) so our backend knows which user’s extension to target.
start_task
method returns a dictionary containing the task_id
and the initial status (usually ‘queued’) if successful, or None
on error. It accepts the required developer_user_id
and instructions
.
It also accepts an optional target_url
parameter (string or list of strings) to specify an exact starting page(s). If target_url
is omitted, the agent will navigate based solely on the description provided in the instructions
.
For details on using target_url
(including multiple URLs) versus instruction-based navigation, see Advanced SDK Patterns: Using target_url.
Checking Task Status and Results (Polling)
You can periodically check the status of a task using itstask_id
with the get_task_status
method.
get_task_status
method returns a dictionary containing the task’s current status
, result
(if completed), and error
(if failed), or None
on error.
Handling Results via Webhooks (Recommended)
Polling can be inefficient. We recommend configuring a webhook endpoint in your dashboard settings. When a task completes or fails, our system will send aPOST
request to your webhook URL with the task details.
Use the verify_webhook
method in the SDK to securely verify that incoming webhook requests originated from our system before processing the payload.
Troubleshooting (Documentation Environment)
Note: This section pertains to issues encountered while setting up the local documentation preview environment using the Mintlify CLI, not the Python SDK itself.Error: Could not load the "sharp" module using the darwin-arm64 runtime
Error: Could not load the "sharp" module using the darwin-arm64 runtime
This may be due to an outdated version of node. Try the following:
- Remove the currently-installed version of mintlify:
npm remove -g mintlify
- Upgrade to Node v19 or higher.
- Reinstall mintlify:
npm install -g mintlify
Issue: Encountering an unknown error (Mintlify CLI)
Issue: Encountering an unknown error (Mintlify CLI)
Solution: Go to the root of your device and delete the ~/.mintlify folder. Afterwards, run
mintlify dev
again.