/v1/sessions/{sessionId}/actionsExecutes a deterministic browser action against the session's active
page. If the request lands on a non-owner API instance, Capture routes
the action to the owning instance through Redis. Responses for existing
sessions include expiresInSeconds, the remaining lifetime at the time
the action response is sent.
Authorization
bearerAuth In: header
Path Parameters
Session id returned by POST /v1/sessions.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/sessions/sess_123e4567-e89b-12d3-a456-426614174000/actions" \ -H "Content-Type: application/json" \ -d '{ "type": "goto", "payload": { "url": "https://example.com" } }'{
"success": true,
"expiresInSeconds": 0,
"matched": true,
"visible": true,
"elementText": "string",
"tagName": "string",
"attributes": {
"property1": "string",
"property2": "string"
},
"boundingBox": {},
"clickedPoint": {},
"hoveredPoint": {},
"url": "string"
}{
"success": false,
"error": "string",
"expiresInSeconds": 0,
"session": {
"id": "string",
"status": "active",
"closeReason": "closed",
"createdAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"closedAt": "2019-08-24T14:15:22Z",
"durationSeconds": 0,
"billedCredits": 0,
"actionCount": 0,
"actionSuccessCount": 0,
"actionErrorCount": 0,
"actionBreakdown": {
"property1": {
"total": 0,
"success": 0,
"error": 0
},
"property2": {
"total": 0,
"success": 0,
"error": 0
}
},
"options": {
"maxTtlSeconds": 0,
"proxy": true,
"bypassBotDetection": true
}
}
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string",
"expiresInSeconds": 0,
"session": {
"id": "string",
"status": "active",
"closeReason": "closed",
"createdAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"closedAt": "2019-08-24T14:15:22Z",
"durationSeconds": 0,
"billedCredits": 0,
"actionCount": 0,
"actionSuccessCount": 0,
"actionErrorCount": 0,
"actionBreakdown": {
"property1": {
"total": 0,
"success": 0,
"error": 0
},
"property2": {
"total": 0,
"success": 0,
"error": 0
}
},
"options": {
"maxTtlSeconds": 0,
"proxy": true,
"bypassBotDetection": true
}
}
}{
"success": false,
"error": "string",
"expiresInSeconds": 0,
"session": {
"id": "string",
"status": "active",
"closeReason": "closed",
"createdAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"closedAt": "2019-08-24T14:15:22Z",
"durationSeconds": 0,
"billedCredits": 0,
"actionCount": 0,
"actionSuccessCount": 0,
"actionErrorCount": 0,
"actionBreakdown": {
"property1": {
"total": 0,
"success": 0,
"error": 0
},
"property2": {
"total": 0,
"success": 0,
"error": 0
}
},
"options": {
"maxTtlSeconds": 0,
"proxy": true,
"bypassBotDetection": true
}
}
}{
"success": false,
"error": "string",
"expiresInSeconds": 0,
"session": {
"id": "string",
"status": "active",
"closeReason": "closed",
"createdAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"closedAt": "2019-08-24T14:15:22Z",
"durationSeconds": 0,
"billedCredits": 0,
"actionCount": 0,
"actionSuccessCount": 0,
"actionErrorCount": 0,
"actionBreakdown": {
"property1": {
"total": 0,
"success": 0,
"error": 0
},
"property2": {
"total": 0,
"success": 0,
"error": 0
}
},
"options": {
"maxTtlSeconds": 0,
"proxy": true,
"bypassBotDetection": true
}
}
}Close a browser session DELETE
Closes an active session and charges duration credits once. Repeated close requests for an already-finalized session are idempotent.
SDK Overview
Official Capture API SDKs for Node.js, Python, Go, Rust, Ruby, and PHP. Integrate screenshot, PDF, and content capture capabilities with language-native tooling and comprehensive examples.