Skip to main content
POST
Run Execution
Use this API to start an asynchronous agent execution. The engine creates an execution document in Firestore and dispatches a Cloud Task for processing. The response returns immediately with the executionId. Poll Get Execution to track progress and fetch findings. To run several agents in one request, send agentIds instead of agentId, on one page or on several. Each agent gets its own execution, and the response lists one executionId per agent. See Several agents on one page and Several agents on several pages. The apiKey is injected from request headers. organizationId and documentId are required and identify the document the execution runs against: the document must already exist, and findings are persisted to it as comment annotations. Cross-page execution is controlled via the crossPageExecute boolean; there is no separate endpoint. To review an exact set of pages instead of crawling, send them in urls. The schema uses .passthrough() so any additional fields are forwarded.

Endpoint

POST https://api.velt.dev/v2/agents/execution/run

Headers

string
required
Your API key.
string
required

Body

Params

object
required

Example Requests

1. Single page execution

2. Cross-page execution with user context (mobile)

3. Workflow-triggered execution

4. Execution with public annotations

5. Pinning a provider and model for one run

6. Per-provider model policy across mixed agents

7. A list of pages, no crawl

Use this for sites whose pages differ only by a query string, such as a Salesforce help site, where a crawl cannot find them. Relative entries resolve against url.
The execution then reports config.pageSource: "list", config.seedUrl set to the first page in the list, and crawlerResults.status: "skipped". See Get Execution.

8. Minimal request

9. Several agents on one page

The response lists one executionId per agent. Poll each one with Get Execution. See Success Response (several agents). This suite runs the Link Checker and the Image Inspector on the same page, so the Image Inspector leaves the Link Checker the broken images it reports, and each one is reported once. You do not set anything for this. See Per-run options.

10. Recheck some issue types

Rechecks only blurry and stretched images on two pages, and links each finding to the comment that asked for the recheck. The earlier pending blurry and stretched image suggestions on those pages are replaced; other image suggestions stay.

11. Several agents on several pages

Runs three agents on ten pages of one site. Each agent gets one execution that covers all ten pages, and each page is reviewed by the three agents together.
The response has the same shape as for one page: one executionId per agent. Each execution reports config.crossPageExecute: true, config.maxUrlsToProcess: 10, config.pageSource: "list", and, when it completes, resultsSummary.urlsProcessed: 10. To crawl instead of listing pages, send crossPageExecute: true and maxUrlsToProcess without urls. On several pages, the Image Inspector does not leave broken images to the Link Checker by itself. Add "linkCheckerOnSamePages": true to userContext to report each broken image once. The Proofreader still leaves lorem ipsum to lorem-ipsum when both run. See Per-run options.

12. Turn on an optional model check

Runs the Image Inspector with its bad-crop check, which sends screenshots of the page’s photos to an AI model. The check is off unless a run turns it on.
Sending "userContext": { "cropCheck": true } instead turns on the same check. cropCheck: false keeps it off even when modelChecks lists image-crop.

Response

Success Response

Success Response (several agents)

With agentIds, the response lists the executions that started and the agents that could not start. One agent failing to start does not stop the others.
The request fails only when no agent could start. It then returns the first agent’s error, and error.details.failed lists every agent’s failure in the same shape as data.failed:

Failure Response

Errors:
  • INVALID_ARGUMENT: invalid URL; neither agentId nor agentIds (agentId or agentIds is required); missing organizationId or documentId; or an invalid trigger, deviceType, or annotationVisibility.
  • INVALID_ARGUMENT: an agentIds list, sent without agentId, that names no agent or more than 10 distinct agents (An agent suite needs between 1 and 10 distinct agentIds.), or that holds an entry that is not a non-empty string.
  • INVALID_ARGUMENT: a urls list with more than 500 entries, a list where no entry survives normalization (every entry blank, on another host, or not a URL or path), or a url that is not a usable http(s) URL to resolve the list against.
  • INVALID_ARGUMENT: an aiConfig that is empty, carries an unknown key, names a provider outside gemini / claude / openai, names a model outside the allowlist, supplies an empty defaultModels, sets maxToolTurns outside 1..16, or sends a modelChecks list that is empty, repeats an entry, or names an unknown check.
  • INVALID_ARGUMENT: a malformed run-scope key in userContext. The message names the key and its rule, for example userContext.sourcePageUrl must be a non-blank string of at most 4096 characters, and error.details.issues lists every malformed key.
  • INVALID_ARGUMENT: a userContext the agent’s input.userContextFields refuse: a missing required field (Validation failed: Missing required userContext field: <id>) or a value of another type (Validation failed: userContext field '<id>' expected type '<type>', got '<actual>').
  • INVALID_ARGUMENT: a migration-parity run without a usable userContext.liveSiteUrl (Migration Parity needs the live site to compare against: send userContext.liveSiteUrl (a full address or a bare domain)), or whose live site is the run’s own site (Migration Parity needs a live site other than the project site: userContext.liveSiteUrl names the same site as the run's url).
  • NOT_FOUND: store database not found, or the target document does not exist.
  • ALREADY_EXISTS: an execution is already running for this agent and document combination. The error message includes the running execution’s ID. An execution that stopped making progress does not count: the new run ends it with error.code STALE_RUN and starts.
  • RESOURCE_EXHAUSTED: the workspace’s AI credits are exhausted.
  • INTERNAL: the run could not be started after its execution was created (Failed to dispatch agent execution task.). Every execution the request created ends with status error and error.code TASK_DISPATCH_FAILED. Send the request again.
With agentIds, an error that concerns one agent, such as NOT_FOUND, ALREADY_EXISTS, RESOURCE_EXHAUSTED, or a userContext that agent refuses, appears in data.failed and the other agents still start. The request fails with it only when no agent could start. Every other INVALID_ARGUMENT, and INTERNAL, rejects the whole request.