API reference: Webhooks
The Webhooks endpoints (10 operations), generated from the OpenAPI document (https://faraatarjomeh.com/api/v1/openapi.json). For task-level walkthroughs use the guides; for error handling use /api/v1/docs/errors. The full reference: /api/v1/docs/reference.
At a glance#
- Auth on every call:
Authorization: Bearer $FARA_API_KEY scope:readfor GET/HEAD,writefor the rest- spends Fara: the call holds or charges Fara; get the price first and send
Idempotency-Key - Path parameters in the examples are shell variables (
$JOB_ID,$ID…) - Errors:
application/problem+jsonwith a stablecode(not repeated per endpoint below)
Index#
- Webhooks: GET /api/v1/webhook-endpoints/event-types, GET /api/v1/webhook-endpoints, POST /api/v1/webhook-endpoints, GET /api/v1/webhook-endpoints/{id}, PATCH /api/v1/webhook-endpoints/{id}, DELETE /api/v1/webhook-endpoints/{id}, POST /api/v1/webhook-endpoints/{id}/rotate-secret, POST /api/v1/webhook-endpoints/{id}/test, GET /api/v1/webhook-endpoints/{id}/deliveries, POST /api/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/retry
Webhooks#
Get told when a job changes status.
GET /api/v1/webhook-endpoints/event-types#
List webhook event types
- operationId
listWebhookEventTypes· scoperead· free
Response 200
Responses
200Event types. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/webhook-endpoints/event-types" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/webhook-endpoints#
List webhook endpoints
- operationId
listWebhookEndpoints· scoperead· free
All endpoints of the account (there are only a few, so no pagination).
Response 200
Responses
200Endpoints. (application/json)- Errors:
401,403,404,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $FARA_API_KEY"POST /api/v1/webhook-endpoints#
Add a webhook endpoint
- operationId
createWebhookEndpoint· scopewrite· free · sendIdempotency-Key
The answer contains the signing secret. It is shown only once.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Request body application/json (required)
Response 201
Responses
201Created. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"url":"string"}'GET /api/v1/webhook-endpoints/{id}#
Get a webhook endpoint
- operationId
getWebhookEndpoint· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
Response 200
Responses
200The endpoint. (application/json)- Errors:
401,403,404,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID" \
-H "Authorization: Bearer $FARA_API_KEY"PATCH /api/v1/webhook-endpoints/{id}#
Change a webhook endpoint
- operationId
updateWebhookEndpoint· scopewrite· free · sendIdempotency-Key
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Request body application/json (required)
Response 200
Responses
200Updated. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X PATCH "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'DELETE /api/v1/webhook-endpoints/{id}#
Delete a webhook endpoint
- operationId
deleteWebhookEndpoint· scopewrite· free · sendIdempotency-Key
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Responses
204Deleted.- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X DELETE "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"POST /api/v1/webhook-endpoints/{id}/rotate-secret#
Replace the signing secret
- operationId
rotateWebhookSecret· scopewrite· free · sendIdempotency-Key
The old secret stops working at once. The new one is shown only in this answer.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Response 200
Responses
200New secret. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID/rotate-secret" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"POST /api/v1/webhook-endpoints/{id}/test#
Send a test event
- operationId
sendWebhookTestEvent· scopewrite· free · sendIdempotency-Key
Sends one webhook.test event now and reports what your endpoint answered. Not retried.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Response 200
Responses
200Result. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID/test" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"GET /api/v1/webhook-endpoints/{id}/deliveries#
List deliveries to an endpoint
- operationId
listWebhookDeliveries· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
limit |
query | integer | no | Items per page (1-100). — default: 20; min 1; max 100 |
startingAfter |
query | string | no | Cursor: the nextCursor (or last id) of the previous page. |
Response 200
Responses
200One page. (application/json)- Errors:
400,401,403,404,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID/deliveries" \
-H "Authorization: Bearer $FARA_API_KEY"POST /api/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/retry#
Send a failed delivery again
- operationId
retryWebhookDelivery· scopewrite· free · sendIdempotency-Key
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Webhook endpoint id. |
deliveryId |
path | string | yes | Webhook delivery id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Response 202
Responses
202Queued again. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/webhook-endpoints/$ID/deliveries/$DELIVERY_ID/retry" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Schemas#
Named request and response objects used above. Nested objects are flattened as parent.child; arrays as parent[].child.
WebhookDelivery#
| Field | Type | Required | Notes |
|---|---|---|---|
id |
string | yes | Delivery id. Also the pagination cursor. |
eventId |
string | yes | Same as the webhook-id header. |
eventType |
string | yes | |
status |
string | yes | pending, succeeded, or failed. |
attempts |
integer | no | |
nextAttemptAt |
string | null | no | may be null |
lastAttemptAt |
string | null | no | may be null |
lastResponseStatus |
integer | null | no | may be null |
lastError |
string | null | no | may be null |
createdAt |
string | null | no | may be null |
WebhookDeliveryPage#
One page of deliveries, newest first. Kept for 30 days.
| Field | Type | Required | Notes |
|---|---|---|---|
data |
object[] | yes | |
data[].id |
string | yes | Delivery id. Also the pagination cursor. |
data[].eventId |
string | yes | Same as the webhook-id header. |
data[].eventType |
string | yes | |
data[].status |
string | yes | pending, succeeded, or failed. |
data[].attempts |
integer | no | |
data[].nextAttemptAt |
string | null | no | may be null |
data[].lastAttemptAt |
string | null | no | may be null |
data[].lastResponseStatus |
integer | null | no | may be null |
data[].lastError |
string | null | no | may be null |
data[].createdAt |
string | null | no | may be null |
hasMore |
boolean | yes | True when there are more items after this page. |
nextCursor |
string | null | yes | Pass as startingAfter to get the next page. Null on the last page. — may be null |
WebhookEndpoint#
| Field | Type | Required | Notes |
|---|---|---|---|
id |
string | yes | |
url |
string | yes | |
description |
string | no | |
events |
string[] | yes | Event types sent to this endpoint. ["*"] means all. |
enabled |
boolean | yes | |
disabledReason |
string | null | no | disabled_by_user, endpoint_gone (answered 410), or failing_for_days. — may be null |
createdAt |
string | null | no | may be null |
updatedAt |
string | null | no | may be null |
lastSuccessAt |
string | null | no | may be null |
lastFailureAt |
string | null | no | may be null |
WebhookEndpointCreateRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
url |
string | yes | Public https URL that will receive events. |
events |
string[] | no | Event types to send. Default ["*"] (all). |
description |
string | no | Up to 200 characters. |
WebhookEndpointList#
| Field | Type | Required | Notes |
|---|---|---|---|
data |
object[] | yes | |
data[].id |
string | yes | |
data[].url |
string | yes | |
data[].description |
string | no | |
data[].events |
string[] | yes | Event types sent to this endpoint. ["*"] means all. |
data[].enabled |
boolean | yes | |
data[].disabledReason |
string | null | no | disabled_by_user, endpoint_gone (answered 410), or failing_for_days. — may be null |
data[].createdAt |
string | null | no | may be null |
data[].updatedAt |
string | null | no | may be null |
data[].lastSuccessAt |
string | null | no | may be null |
data[].lastFailureAt |
string | null | no | may be null |
WebhookEndpointUpdateRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
url |
string | no | |
events |
string[] | no | |
description |
string | no | |
enabled |
boolean | no | Turn the endpoint off or back on. Turning it on clears the failure count. |
WebhookEndpointWithSecret#
| Field | Type | Required | Notes |
|---|---|---|---|
id |
string | yes | |
url |
string | yes | |
description |
string | no | |
events |
string[] | yes | Event types sent to this endpoint. ["*"] means all. |
enabled |
boolean | yes | |
disabledReason |
string | null | no | disabled_by_user, endpoint_gone (answered 410), or failing_for_days. — may be null |
createdAt |
string | null | no | may be null |
updatedAt |
string | null | no | may be null |
lastSuccessAt |
string | null | no | may be null |
lastFailureAt |
string | null | no | may be null |
secret |
string | yes | Signing secret, whsec_ + base64. Shown only in this response. Store it safely. |
WebhookEventTypes#
| Field | Type | Required | Notes |
|---|---|---|---|
data |
string[] | yes |
WebhookTestResult#
| Field | Type | Required | Notes |
|---|---|---|---|
deliveryId |
string | no | |
eventId |
string | no | |
delivered |
boolean | no | True when your endpoint answered 2xx. |
responseStatus |
integer | null | no | may be null |
error |
string | null | no | may be null |