diff --git a/docs/sandbox/lifecycle-events-webhooks.mdx b/docs/sandbox/lifecycle-events-webhooks.mdx index a3ff0e58..d8326fca 100644 --- a/docs/sandbox/lifecycle-events-webhooks.mdx +++ b/docs/sandbox/lifecycle-events-webhooks.mdx @@ -53,7 +53,7 @@ resp = requests.post( json={ "name": "My Sandbox Webhook", "url": "https://your-webhook-endpoint.com/webhook", - "enabled": true, + "enabled": True, "events": ["sandbox.lifecycle.created", "sandbox.lifecycle.updated", "sandbox.lifecycle.killed"], "signatureSecret": "secret-for-event-signature-verification" } @@ -99,7 +99,7 @@ resp = requests.get( if resp.status_code == 200: print("Webhooks listed successfully") - print(response.json()) + print(resp.json()) ``` @@ -124,7 +124,7 @@ const webhookConfig = await resp.json() console.log(webhookConfig) // { // "id": "", -// "teamID": "", +// "teamId": "", // "name": "My Sandbox Webhook", // "createdAt": "2025-08-06T21:00:00Z", // "enabled": true, @@ -148,7 +148,7 @@ webhook_config = resp.json() print(webhook_config) # { # "id": "", -# "teamID": "", +# "teamId": "", # "name": "My Sandbox Webhook", # "createdAt": "2025-08-06T21:00:00Z", # "enabled": true, @@ -251,10 +251,13 @@ The payload structure matches the event format from the API: ```json { - "version": "v2", "id": "", + "version": "v2", "type": "", - "eventData": { + "timestamp": "2025-08-06T20:59:24Z", + "event_category": "lifecycle", + "event_label": "kill", + "event_data": { "sandbox_metadata": { "": "" }, @@ -262,19 +265,18 @@ The payload structure matches the event format from the API: "started_at": "2025-08-06T20:58:24Z", "vcpu_count": 2, "memory_mb": 512, - "execution_time": 1000, + "execution_time": 1000 } }, - "sandboxBuildId": "", - "sandboxExecutionId": "", - "sandboxId": "", - "sandboxTeamId": "", - "sandboxTemplateId": "", - "timestamp": "2025-08-06T20:59:24Z" + "sandbox_id": "", + "sandbox_execution_id": "", + "sandbox_template_id": "", + "sandbox_build_id": "", + "sandbox_team_id": "" } ``` -`eventData.execution` contains sandbox execution details and is included on `sandbox.lifecycle.killed` and `sandbox.lifecycle.paused` events: +`event_data.execution` contains sandbox execution details and is included on `sandbox.lifecycle.killed` and `sandbox.lifecycle.paused` events: - `started_at` - UTC RFC3339 timestamp when the current sandbox execution started - `vcpu_count` - Number of vCPUs assigned to the sandbox