Skip to main content

API: Executions

Endpoints for listing, triggering, and inspecting bot executions.

List Executions

GET /api/v1/bots/:botId/executions

Returns executions for a specific bot. Supports cursor-based pagination.

Query Parameters:

ParameterTypeDescription
limitnumberMaximum number of executions to return.
cursorstringPagination cursor from a previous response.

Trigger Execution

POST /api/v1/bots/:botId/executions

Starts a new execution for the bot. Requires Write or Admin permission. Returns the execution ID.

Request Body (action bots):

For action bots, include the parameters defined in the bot's manifest:

{
"params": {
"searchQuery": "laptop",
"maxResults": 10
}
}

The system validates parameter names against the bot's manifest. If a parameter name does not match any defined parameter, the response includes a suggestion based on Levenshtein distance matching (e.g., "Unknown parameter 'serchQuery'. Did you mean 'searchQuery'?").

Example:

curl -X POST \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"params": {"searchQuery": "laptop"}}' \
"https://<deployment>.convex.site/api/v1/bots/<botId>/executions"

Get Execution Details

GET /api/v1/executions/:executionId

Returns details for a specific execution.

Response Fields:

FieldTypeDescription
statusstringCurrent status (e.g., pending, running, completed, failed).
durationnumberExecution duration in milliseconds.
startedAtnumberStart timestamp (Unix ms).
completedAtnumberCompletion timestamp (Unix ms). Null if still running.

Get Step Outputs

GET /api/v1/executions/:executionId/steps

Returns all step outputs for the execution. Each step includes its index, status, and any data produced.


Get Specific Step Output

GET /api/v1/executions/:executionId/steps/:index

Returns the output of a specific step by its zero-based index.


Get Extracted Data

GET /api/v1/executions/:executionId/extract

Returns the extracted data from a successful execution. Returns a 404 if the execution did not produce extraction data or has not completed.


Get Failure Context

GET /api/v1/executions/:executionId/failure

Returns failure details for a failed execution.

Response Fields:

FieldTypeDescription
errorstringError message describing what went wrong.
screenshotUrlstringURL of the browser screenshot taken at the moment of failure.

Get Execution Logs

GET /api/v1/executions/:executionId/logs

Returns the log output from the execution. Includes runner logs, script output, and system messages.