Webhooks
Send a test event
Delivers a signed webhook.ping event to the endpoint, with the usual retries; its outcome shows in the deliveries.
POST
/v1/webhook-endpoints/{id}/pingTL;DR
| Question | Answer |
|---|---|
| What does it do? | Send a test event. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | id in the path. |
| What does it return? | Status 202 with a body of type PingSent. |
| In the SDK? | flung.webhookEndpoints.ping() |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 404 No such endpoint in this workspace; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape. |
Example
bash
curl -X POST 'https://api.flung.dev/v1/webhook-endpoints/whe_aaaaaaaaaaaaaaaaaaaaaaaa/ping' \ --header "Authorization: Bearer $FLUNG_API_KEY"ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.webhookEndpoints.ping({ id: 'whe_aaaaaaaaaaaaaaaaaaaaaaaa',})js
const response = await fetch('https://api.flung.dev/v1/webhook-endpoints/whe_aaaaaaaaaaaaaaaaaaaaaaaa/ping', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, },})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()A successful answer looks like this:
json
{ "eventId": "string"}Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes |
Responses
| Status | Meaning | Body |
|---|---|---|
| 202 | The test event is on its way. | PingSent |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 404 | No such endpoint in this workspace. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 202 answer has the type PingSent.
| Field | Type | Required | Description |
|---|---|---|---|
eventId | string | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |