---
title: "Execute code in an interact session"
method: POST
path: "/interact/{sessionId}/execute"
tags: ["Interact"]
---

# Execute code in an interact session

`POST /interact/{sessionId}/execute`

## Path parameters

- `sessionId` string, required

## Request body

- object
  - `code` string, required — Code to execute in the browser sandbox
  - `language` 'python' | 'node' | 'bash' — Language of the code to execute. Use `node` for JavaScript or `bash` for agent-browser CLI commands.
  - `timeout` integer — Execution timeout in seconds

## Response `200`

Code executed successfully

- object
  - `success` boolean
  - `stdout` string, nullable — Standard output from the code execution
  - `result` string, nullable — Standard output (alias for stdout)
  - `stderr` string, nullable — Standard error output from the code execution
  - `exitCode` integer, nullable — Exit code of the executed process
  - `killed` boolean — Whether the process was killed due to timeout
  - `error` string, nullable — Error message if the code raised an exception

## Other responses

- `402` — Payment required

---

[API](https://skmtc.dev/firecrawl/apis/firecrawl-api.md) · [All operations](https://skmtc.dev/firecrawl/apis/firecrawl-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/firecrawl/firecrawl-api/revisions/e350fafb5a2a/schema)
