Request body
Opaque identifier for the user this task runs on behalf of. See End users. Must be ≤ 256 characters.
The natural-language prompt. Must be non-empty after trimming.
Pass a previous task’s sessionId to continue a conversation. Omit to start a new session (server mints one and returns it).
If you know the specific page to start from, pass the URL. Skips the agent’s URL-discovery step.
A JSON Schema describing the shape of structured data you want back. When set, the completed task’s structured_content field contains the conforming object.
Upper bound on agent steps before the task is forced to finalize. Server clamps to min(maxSteps, 25).
If true, the last page’s raw HTML is returned on the final task record as html_dump.
Response — 201 Created
Newly-created task identifier.
Either the session you passed in, or a newly-minted one if you omitted sessionId.
Always "pending" on submission. Poll GET /v1/tasks/{taskId} for terminal state.
Example
curl "$API_BASE/tasks" -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"endUserId": "alice",
"task": "What is the current top story on Hacker News?"
}'
{
"taskId": "7f2a...",
"sessionId": "a31d...",
"status": "pending",
"createdAt": "2026-04-21T04:55:34Z"
}
The Python and TypeScript SDKs also offer tasks.run(...) which submits + polls + returns the completed task in one call. Prefer it over submit + manual polling unless you’re building your own streaming UI.
Errors
| Code | Meaning |
|---|
400 | task missing or empty, endUserId missing or > 256 chars, invalid JSON body, sessionId owned by another business |
401 | Missing Authorization header |
403 | Revoked API key, or attempt to submit into another business’s sessionId |
429 | Rate limit or quota exceeded; see the response body for specifics |