Endpoint
Request
Headers
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Code to execute |
callback_url | string | Yes | URL to POST results to when complete |
language | string | No | Language (default: python) |
timeout | integer | No | Max execution time in seconds (default: 3600) |
working_dir | string | No | Working directory |
env | object | No | Environment variables |
callback_headers | object | No | Custom headers for callback request |
callback_signature_secret | string | No | Secret to sign callback payload (HMAC-SHA256) |
Example Request
Response
Success (200 OK)
Response Fields
| Field | Type | Description |
|---|---|---|
execution_id | string | Execution ID for tracking |
status | string | Initial status (queued) |
callback_url | string | Webhook URL that will receive results |
Callback Behavior
When execution completes, the API POSTs results to yourcallback_url:
Callback Request
Callback Payload
Callback Headers
| Header | Description |
|---|---|
X-HopX-Signature | HMAC-SHA256 signature of payload (if secret provided) |
X-HopX-Timestamp | Unix timestamp of callback |
| Custom headers | From callback_headers in request |
Status Codes
| Code | Description |
|---|---|
| 200 | Execution queued |
| 400 | Invalid request (missing callback_url, invalid URL) |
| 401 | Unauthorized |
| 500 | Failed to queue execution |
Verify Webhook Signature
To verify the webhook signature:Python
JavaScript
Use Cases
Long-Running Model Training
Batch Data Processing
Custom Callback Headers
Related
- Async Execution with Webhooks - Learn about async execution
- Background Execution - Shorter background tasks
- List Processes - Check process status
- SDK: sandbox.run_code_async() - Python SDK method
- CLI Code Execution - Execute code from CLI
Next Steps
- Background Execution - Shorter background tasks
- List Processes - Check process status
- Execute Code - Simple synchronous execution

