POST /v1/webhooks
#POST /v1/webhookscreateWebhook
Add an endpoint; the signing secret is shown once
| Scope | webhooks:write |
|---|---|
| Lowest tier | developer |
| Weight (units) | 1 |
| SDK | Python client.webhooks.create ยท JavaScript cd.webhooks.create |
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Any unique string; a retried write with the same key acts once. |
Answer
data: { endpoint, secret }
Body (JSON)
{ url, events: [calendar.release | calendar.revised | alert.fired], description?, filter? }
Errors
400invalid_param, invalid_cursor401unauthorized: missing, unknown, revoked or expired key403insufficient_scope, tier_required404not_found, not_available, not_in_sandbox422window_too_large429rate_limited (per minute) or quota_exhausted (month; X-Quota-* headers, Retry-After = seconds to the next month); see Retry-After503api_disabled, overloaded
Example
curl -X POST "https://api.chartdeck.trade/v1/webhooks" \
-H "Authorization: Bearer $CHARTDECK_API_KEY"from chartdeck import Client
client = Client() # reads CHARTDECK_API_KEY
r = client.webhooks.create(body={...})
print(r.data, r.meta["attribution"])import { ChartDeck } from '@chartdeck/api';
const cd = new ChartDeck(); // reads CHARTDECK_API_KEY
const r = await cd.webhooks.create({ ... });
console.log(r.data, r.meta.attribution);