Yapper Docs
Api reference
POST
/webhooks

Sends workspace events to url as signed JSON POSTs: { id, type, createdAt, data }. Events: process.completed: A generation finished with outputs. process.failed: A generation failed. asset.created: A new image, video or audio asset appeared: a generation output, an upload or an import. asset.favorited: An asset was favorited. asset.unfavorited: An asset was unfavorited. asset.filed: An asset was put in a folder: a session workspace folder or a Library folder (data.folder gives its kind, id, name and path). credits.alert: A credit alert rule fired (GET /credit-alerts): the balance dropped below its level, or a member or API key reached its share of a credit limit or its spend this month. data.rule names it. Each request carries X-Yapper-Event-Id, X-Yapper-Event-Type, X-Yapper-Delivery-Id, X-Yapper-Timestamp and X-Yapper-Signature, which is one or more comma-separated v1= values, each the HMAC-SHA256 of <X-Yapper-Timestamp>.<raw body> with a signing secret: accept the request if any matches. Answer 2xx within 10 seconds. Anything else is retried after 1m, 5m, 30m, 2h, 6h, 12h, 24h, then given up (catch up with GET /events). Delivery is at least once and unordered: dedupe on the event id. An endpoint with no successful delivery for 3 days is disabled. It only receives events for assets and processes its creator can read. At most 10 endpoints per workspace.

Authorization

bearerAuth webhooks:write
AuthorizationBearer <token>

In: header

Scope: webhooks:write

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/webhooks" \  -H "Content-Type: application/json" \  -d '{    "url": "http://example.com",    "events": [      "process.completed"    ]  }'
{  "data": {    "id": "string",    "url": "http://example.com",    "description": "string",    "events": [      "process.completed"    ],    "enabled": true,    "disabledReason": "disabled_by_user",    "disabledAt": "2019-08-24T14:15:22Z",    "failingSince": "2019-08-24T14:15:22Z",    "lastSuccessAt": "2019-08-24T14:15:22Z",    "createdBy": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "links": {      "self": "string",      "deliveries": "string"    },    "secret": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}