Skip to main content

Endpoints

EndpointMethodReturnsCancel support
https://agent.tinyfish.ai/v1/automation/runPOSTFinal run resultNo
https://agent.tinyfish.ai/v1/automation/run-asyncPOSTrun_id immediatelyYes
https://agent.tinyfish.ai/v1/automation/run-ssePOSTSSE event streamYes
All requests require the X-API-Key header. See Authentication.

Common Request Body

All three automation endpoints accept the same JSON body.
{
  "url": "https://example.com",
  "goal": "Find the pricing page and extract all plan details",
  "browser_profile": "lite",
  "proxy_config": {
    "enabled": true,
    "type": "tetra",
    "country_code": "US"
  }
}
FieldTypeRequiredNotes
urlstringYesTarget website URL to automate
goalstringYesNatural-language instruction for the automation
browser_profilelite | stealthNoDefaults to lite
proxy_config.enabledbooleanNoEnables proxying for the run
proxy_config.typetetra | customNotetra uses TinyFish proxy infrastructure; custom requires your own proxy URL
proxy_config.country_codeUS | GB | CA | DE | FR | JP | AUNoUsed with type: "tetra"
proxy_config.urlstringNoRequired when type: "custom"
proxy_config.usernamestringNoCustom proxy username
proxy_config.passwordstringNoCustom proxy password
See Browser Profiles and Proxies for operational guidance.

POST /v1/automation/run

Use this endpoint when you want the final result in one blocking response.
{
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "COMPLETED",
  "started_at": "2024-01-01T00:00:00Z",
  "finished_at": "2024-01-01T00:00:30Z",
  "num_of_steps": 5,
  "result": {
    "product": "iPhone 15",
    "price": "$799"
  },
  "error": null
}
FieldTypeNotes
run_idstring | nullUnique identifier for the run
statusCOMPLETED | FAILEDFinal run state
started_atstring | nullISO 8601 timestamp
finished_atstring | nullISO 8601 timestamp
num_of_stepsnumber | nullNumber of steps taken
resultobject | nullExtracted JSON result
errorobject | nullPresent only when the run failed
Runs created via /run cannot be cancelled.

POST /v1/automation/run-async

Use this endpoint when you want a run_id immediately and will fetch the full run later.
{
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "error": null
}
FieldTypeNotes
run_idstring | nullCreated run ID
errorobject | nullPresent only when run creation failed
Fetch the full run state later with GET /v1/runs/{id}.

POST /v1/automation/run-sse

Use this endpoint when you want a streaming event feed while the automation runs. Possible SSE event types:
Event typeFields
STARTEDtype, run_id, timestamp
STREAMING_URLtype, run_id, streaming_url, timestamp
PROGRESStype, run_id, purpose, timestamp
HEARTBEATtype, timestamp
COMPLETEtype, run_id, status, result?, error?, help_url?, help_message?, timestamp
Example stream:
data: {"type":"STARTED","run_id":"run_123","timestamp":"2025-01-01T00:00:00Z"}

data: {"type":"STREAMING_URL","run_id":"run_123","streaming_url":"https://...","timestamp":"..."}

data: {"type":"PROGRESS","run_id":"run_123","purpose":"Clicking submit button","timestamp":"..."}

data: {"type":"COMPLETE","run_id":"run_123","status":"COMPLETED","result":{...},"timestamp":"..."}

GET /v1/runs/{id}

Use this endpoint to retrieve the current or final state of an async or streaming run.
FieldTypeNotes
run_idstringUnique run identifier
statusPENDING | RUNNING | COMPLETED | FAILED | CANCELLEDCurrent run state
goalstringOriginal goal text
created_atstringISO 8601 timestamp
started_atstring | nullISO 8601 timestamp
finished_atstring | nullISO 8601 timestamp
num_of_stepsinteger | nullNumber of steps taken
resultobject | nullExtracted JSON result
errorobject | nullError details if failed
streaming_urlstring | nullLive browser stream URL while running
browser_configobject | nullProxy settings used for the run
video_urlstring | nullPresigned run recording URL, if available
stepsarrayRecorded step events for the run
error may include:
FieldTypeNotes
codestringMachine-readable error code
messagestringHuman-readable failure description
categorySYSTEM_FAILURE | AGENT_FAILURE | BILLING_FAILURE | UNKNOWNError class
retry_afternumber | nullSuggested retry delay in seconds
help_urlstringTroubleshooting link
help_messagestringHuman-readable guidance

POST /v1/runs/{id}/cancel

Only runs created via /run-async or /run-sse can be cancelled.
{
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "CANCELLED",
  "cancelled_at": "2026-01-14T10:30:55Z",
  "message": null
}
FieldTypeNotes
run_idstringRun identifier
statusCANCELLED | COMPLETED | FAILEDActual status after the cancel attempt
cancelled_atstring | nullISO 8601 timestamp
messagestring | nullIdempotency or terminal-state message

Error Codes

Common HTTP-level errors across automation endpoints:
StatusMeaning
400Invalid request body or missing required fields
401Missing or invalid API key
429Rate limit exceeded
500Internal server error
The COMPLETE SSE event or GET /v1/runs/{id} may also include run-level failures such as TASK_FAILED, SITE_BLOCKED, MAX_STEPS_EXCEEDED, TIMEOUT, or INSUFFICIENT_CREDITS.

Agent overview

First request, endpoint selection, and goal-writing basics

Runs

Statuses, polling, and lifecycle behavior

Goal prompting guide

Improve automation reliability

Authentication

API key setup and troubleshooting