Skip to content

Commit 50633f8

Browse files
authored
Fix webhook payload to use snake_case and add missing fields (#197)
* Fix webhook payload to use snake_case and add missing fields * Fix teamID to teamId in webhook configuration response examples * Fix Python syntax errors in webhook documentation examples
1 parent 516c346 commit 50633f8

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

docs/sandbox/lifecycle-events-webhooks.mdx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resp = requests.post(
5353
json={
5454
"name": "My Sandbox Webhook",
5555
"url": "https://your-webhook-endpoint.com/webhook",
56-
"enabled": true,
56+
"enabled": True,
5757
"events": ["sandbox.lifecycle.created", "sandbox.lifecycle.updated", "sandbox.lifecycle.killed"],
5858
"signatureSecret": "secret-for-event-signature-verification"
5959
}
@@ -99,7 +99,7 @@ resp = requests.get(
9999

100100
if resp.status_code == 200:
101101
print("Webhooks listed successfully")
102-
print(response.json())
102+
print(resp.json())
103103
```
104104
</CodeGroup>
105105

@@ -124,7 +124,7 @@ const webhookConfig = await resp.json()
124124
console.log(webhookConfig)
125125
// {
126126
// "id": "<webhook-id>",
127-
// "teamID": "<your-team-id>",
127+
// "teamId": "<your-team-id>",
128128
// "name": "My Sandbox Webhook",
129129
// "createdAt": "2025-08-06T21:00:00Z",
130130
// "enabled": true,
@@ -148,7 +148,7 @@ webhook_config = resp.json()
148148
print(webhook_config)
149149
# {
150150
# "id": "<webhook-id>",
151-
# "teamID": "<your-team-id>",
151+
# "teamId": "<your-team-id>",
152152
# "name": "My Sandbox Webhook",
153153
# "createdAt": "2025-08-06T21:00:00Z",
154154
# "enabled": true,
@@ -251,30 +251,32 @@ The payload structure matches the event format from the API:
251251

252252
```json
253253
{
254-
"version": "v2",
255254
"id": "<event-id>",
255+
"version": "v2",
256256
"type": "<sandbox-event-type>",
257-
"eventData": {
257+
"timestamp": "2025-08-06T20:59:24Z",
258+
"event_category": "lifecycle",
259+
"event_label": "kill",
260+
"event_data": {
258261
"sandbox_metadata": {
259262
"<custom-key>": "<custom-value>"
260263
},
261264
"execution": {
262265
"started_at": "2025-08-06T20:58:24Z",
263266
"vcpu_count": 2,
264267
"memory_mb": 512,
265-
"execution_time": 1000,
268+
"execution_time": 1000
266269
}
267270
},
268-
"sandboxBuildId": "<template-build-id>",
269-
"sandboxExecutionId": "<sandbox-unique-execution-id>",
270-
"sandboxId": "<your-sandbox-id>",
271-
"sandboxTeamId": "<your-team-id>",
272-
"sandboxTemplateId": "<your-template-id>",
273-
"timestamp": "2025-08-06T20:59:24Z"
271+
"sandbox_id": "<your-sandbox-id>",
272+
"sandbox_execution_id": "<sandbox-unique-execution-id>",
273+
"sandbox_template_id": "<your-template-id>",
274+
"sandbox_build_id": "<template-build-id>",
275+
"sandbox_team_id": "<your-team-id>"
274276
}
275277
```
276278

277-
`eventData.execution` contains sandbox execution details and is included on `sandbox.lifecycle.killed` and `sandbox.lifecycle.paused` events:
279+
`event_data.execution` contains sandbox execution details and is included on `sandbox.lifecycle.killed` and `sandbox.lifecycle.paused` events:
278280

279281
- `started_at` - UTC RFC3339 timestamp when the current sandbox execution started
280282
- `vcpu_count` - Number of vCPUs assigned to the sandbox

0 commit comments

Comments
 (0)