--- title: "Create Scheduled Task" api: "POST /api/v1/scheduled-task" description: "Create a new scheduled task to run at regular intervals or based on a cron expression" --- Creates a new scheduled task to run at regular intervals or based on a cron expression. This allows you to automate recurring browser automation tasks. This endpoint requires an active subscription. ## Request Body Instructions for what the agent should do Type of schedule: "interval" or "cron" Minutes between runs (required for interval schedule) Cron expression for scheduling (required for cron schedule) When to start the schedule (ISO 8601 format, defaults to now) When to end the schedule (ISO 8601 format, defaults to 1 year from now) Dictionary of secrets to be used by the agent (safely encrypted before storing) List of domains the agent is allowed to visit Whether to save browser cookies and data between runs JSON schema for structured output LLM model to use. Available options: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o4-mini, o3, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash-preview-04-17, gemini-2.5-flash, gemini-2.5-pro, claude-3-7-sonnet-20250219, claude-sonnet-4-20250514, llama-4-maverick-17b-128e-instruct Whether to use an adblocker Whether to use a proxy Country code for residential proxy. Must be one of: us, uk, fr, it, jp, au, de, fi, ca, in Whether to highlight elements on the page File names to include in the task Width of browser viewport in pixels Height of browser viewport in pixels Maximum number of agent steps (max: 200) Whether to enable public sharing of task executions *Either `interval_minutes` or `cron_expression` is required depending on the `schedule_type`. ## Response The unique identifier for the created scheduled task. ```python python import requests from datetime import datetime, timedelta API_KEY = 'your_api_key_here' BASE_URL = 'https://api.browser-use.com/api/v1' HEADERS = {'Authorization': f'Bearer {API_KEY}'} start_time = datetime.utcnow().isoformat() + 'Z' end_time = (datetime.utcnow() + timedelta(days=30)).isoformat() + 'Z' task_data = { "task": "Visit example.com and check if the site is up", "schedule_type": "interval", "interval_minutes": 60, "start_at": start_time, "end_at": end_time, "use_adblock": True } response = requests.post(f'{BASE_URL}/scheduled-task', headers=HEADERS, json=task_data) task_id = response.json()['id'] print(f"Scheduled task created with ID: {task_id}") ``` ```bash curl curl --request POST \ --url https://api.browser-use.com/api/v1/scheduled-task \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "task": "Visit example.com and check if the site is up", "schedule_type": "interval", "interval_minutes": 60, "use_adblock": true }' ``` ```json 200 { "id": "scheduled_task_1234567890abcdef" } ```