{"openapi":"3.1.0","info":{"title":"Zaiped API","version":"1","description":"The official WhatsApp Cloud API of your connected numbers, as a REST API. Authenticate every request with `Authorization: Bearer <api key>`."},"servers":[{"url":"https://zaiped.com"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"account"},{"name":"numbers"},{"name":"messages"},{"name":"media"},{"name":"templates"},{"name":"flows"},{"name":"catalog"},{"name":"analytics"},{"name":"webhooks"}],"paths":{"/v1/me":{"get":{"operationId":"get_me","tags":["account"],"summary":"Get the calling account","description":"Returns the account behind the API key: whether it can call the API right now (an active subscription, or expired), the subscription mirror and how many numbers are active.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (users)"},"entitlement":{"enum":["active","expired"]},"subscription":{"anyOf":[{"type":"null"},{"type":"object","properties":{"status":{"type":"string"},"quantity":{"type":"number"},"currentPeriodEnd":{"type":"number"}},"required":["status"],"additionalProperties":false}]},"activeNumbers":{"type":"number"}},"required":["id","entitlement","subscription","activeNumbers"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers":{"get":{"operationId":"list_numbers","tags":["numbers"],"summary":"List connected numbers","description":"All WhatsApp numbers connected to the account, oldest first, with the status Meta reports for each one (quality rating, messaging limit, throughput, health). Numbers are connected in the developer console through Meta's Embedded Signup; there is no API to connect one.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (whatsappConnections)"},"status":{"enum":["active","incomplete","needs_reauth"]},"phoneNumberId":{"type":"string"},"wabaId":{"type":"string"},"displayPhoneNumber":{"type":"string"},"verifiedName":{"type":"string"},"qualityRating":{"type":"string"},"messagingLimit":{"type":"string"},"throughputLevel":{"type":"string"},"healthStatus":{"type":"string"},"nameStatus":{"type":"string"},"isOfficialAccount":{"type":"boolean"},"isOnBizApp":{"type":"boolean"},"lastNotice":{"type":"object","properties":{"code":{"enum":["name_rejected","access_lost","account_violation","account_restriction","account_disabled","setup_failed","reregister_failed","pin_changed","account_alert"]},"args":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code"],"additionalProperties":false},"lastSyncedAt":{"type":"number"}},"required":["id","status","phoneNumberId","wabaId"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}":{"get":{"operationId":"get_number","tags":["numbers"],"summary":"Get a connected number","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (whatsappConnections)"},"status":{"enum":["active","incomplete","needs_reauth"]},"phoneNumberId":{"type":"string"},"wabaId":{"type":"string"},"displayPhoneNumber":{"type":"string"},"verifiedName":{"type":"string"},"qualityRating":{"type":"string"},"messagingLimit":{"type":"string"},"throughputLevel":{"type":"string"},"healthStatus":{"type":"string"},"nameStatus":{"type":"string"},"isOfficialAccount":{"type":"boolean"},"isOnBizApp":{"type":"boolean"},"lastNotice":{"type":"object","properties":{"code":{"enum":["name_rejected","access_lost","account_violation","account_restriction","account_disabled","setup_failed","reregister_failed","pin_changed","account_alert"]},"args":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code"],"additionalProperties":false},"lastSyncedAt":{"type":"number"}},"required":["id","status","phoneNumberId","wabaId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}/profile":{"get":{"operationId":"get_number_profile","tags":["numbers"],"summary":"Get the business profile","description":"The WhatsApp Business profile of the number, read live from Meta.","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"about":{"type":"string"},"address":{"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"websites":{"type":"array","items":{"type":"string"}},"vertical":{"type":"string"},"pictureUrl":{"type":"string"}},"required":["about","address","description","email","websites","vertical"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_number_profile","tags":["numbers"],"summary":"Update the business profile","description":"Replaces the profile fields. Send every field: an empty string clears it (except `about`, which Meta keeps when empty). The picture is changed in the console.","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"about":{"type":"string"},"address":{"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"websites":{"type":"array","items":{"type":"string"}},"vertical":{"type":"string"}},"required":["about","address","description","email","websites","vertical"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}/automation":{"get":{"operationId":"get_number_automation","tags":["numbers"],"summary":"Get conversational components","description":"Welcome message, ice-breaker prompts and slash commands (Meta's conversational automation).","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"welcomeEnabled":{"type":"boolean"},"prompts":{"type":"array","items":{"type":"string"}},"commands":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"additionalProperties":false}}},"required":["welcomeEnabled","prompts","commands"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_number_automation","tags":["numbers"],"summary":"Update conversational components","description":"Replaces the whole configuration: Meta substitutes, it does not merge.","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"welcomeEnabled":{"type":"boolean"},"prompts":{"type":"array","items":{"type":"string"}},"commands":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"additionalProperties":false}}},"required":["welcomeEnabled","prompts","commands"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}/qr-codes":{"get":{"operationId":"list_qr_codes","tags":["numbers"],"summary":"List QR codes","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"deepLink":{"type":"string"},"imageUrl":{"type":"string"}},"required":["code","message","deepLink"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"create_qr_code","tags":["numbers"],"summary":"Create a QR code with a prefilled message","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"deepLink":{"type":"string"},"imageUrl":{"type":"string"}},"required":["code","message","deepLink"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}/qr-codes/{code}":{"delete":{"operationId":"delete_qr_code","tags":["numbers"],"summary":"Delete a QR code","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}},{"name":"code","in":"path","required":true,"description":"The QR code, as returned by list_qr_codes.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{numberId}/calling":{"get":{"operationId":"get_calling_settings","tags":["numbers"],"summary":"Get voice calling settings","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"iconVisible":{"type":"boolean"}},"required":["enabled","iconVisible"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_calling_settings","tags":["numbers"],"summary":"Enable or disable voice calling","description":"Turns the WhatsApp Calling API on or off for the number. Calls themselves are placed from a browser (WebRTC) and have no REST route.","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/messages":{"post":{"operationId":"send_message","tags":["messages"],"summary":"Send a message","description":"Sends any message type the Cloud API supports (text, media, location, contacts, reaction, interactive buttons and lists, CTA URL, carousel, flow, product, template). Free-form messages need an open 24-hour window with the recipient; templates do not. Media is referenced by the `mediaId` returned by upload_media (`media: { path }`) or by a public `link`.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numberId":{"type":"string","description":"Zaiped id (whatsappConnections)"},"to":{"type":"string"},"message":{"oneOf":[{"type":"object","properties":{"type":{"const":"text"},"text":{"type":"string"},"previewUrl":{"type":"boolean"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"enum":["image","video","audio","document","sticker"]},"media":{"type":"object","properties":{"path":{"type":"string"},"link":{"type":"string"}},"additionalProperties":false},"caption":{"type":"string"},"fileName":{"type":"string"}},"required":["type","media"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"location"},"latitude":{"type":"number"},"longitude":{"type":"number"},"name":{"type":"string"},"address":{"type":"string"}},"required":["type","latitude","longitude"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"contacts"},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}},"required":["name"],"additionalProperties":false}}},"required":["type","contacts"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"reaction"},"wamid":{"type":"string"},"emoji":{"type":"string"}},"required":["type","wamid","emoji"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"buttons"},"header":{"anyOf":[{"type":"object","properties":{"kind":{"const":"text"},"text":{"type":"string"}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"enum":["image","video","document"]},"media":{"type":"object","properties":{"path":{"type":"string"},"link":{"type":"string"}},"additionalProperties":false}},"required":["kind","media"],"additionalProperties":false}]},"body":{"type":"string"},"footer":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}}},"required":["type","body","buttons"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"list"},"header":{"type":"string"},"body":{"type":"string"},"footer":{"type":"string"},"button":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"}},"required":["id","title"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false}}},"required":["type","body","button","sections"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"cta_url"},"header":{"anyOf":[{"type":"object","properties":{"kind":{"const":"text"},"text":{"type":"string"}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"enum":["image","video","document"]},"media":{"type":"object","properties":{"path":{"type":"string"},"link":{"type":"string"}},"additionalProperties":false}},"required":["kind","media"],"additionalProperties":false}]},"body":{"type":"string"},"footer":{"type":"string"},"buttonText":{"type":"string"},"url":{"type":"string"}},"required":["type","body","buttonText","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"carousel"},"body":{"type":"string"},"mediaKind":{"enum":["image","video"]},"cardButton":{"enum":["url","reply"]},"cards":{"type":"array","items":{"type":"object","properties":{"media":{"type":"object","properties":{"path":{"type":"string"},"link":{"type":"string"}},"additionalProperties":false},"body":{"type":"string"},"buttonText":{"type":"string"},"url":{"type":"string"},"buttons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}}},"required":["media"],"additionalProperties":false}}},"required":["type","body","mediaKind","cardButton","cards"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"location_request"},"body":{"type":"string"}},"required":["type","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"flow"},"flowId":{"type":"string","description":"Zaiped id (flows)"},"header":{"anyOf":[{"type":"object","properties":{"kind":{"const":"text"},"text":{"type":"string"}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"enum":["image","video","document"]},"media":{"type":"object","properties":{"path":{"type":"string"},"link":{"type":"string"}},"additionalProperties":false}},"required":["kind","media"],"additionalProperties":false}]},"body":{"type":"string"},"footer":{"type":"string"},"cta":{"type":"string"}},"required":["type","flowId","body","cta"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"product"},"body":{"type":"string"},"footer":{"type":"string"},"retailerId":{"type":"string"}},"required":["type","retailerId"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"product_list"},"header":{"type":"string"},"body":{"type":"string"},"footer":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"retailerIds":{"type":"array","items":{"type":"string"}}},"required":["title","retailerIds"],"additionalProperties":false}}},"required":["type","header","body","sections"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"catalog_message"},"body":{"type":"string"},"footer":{"type":"string"},"thumbnailRetailerId":{"type":"string"}},"required":["type","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"call_permission"},"body":{"type":"string"}},"required":["type","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"template"},"templateId":{"type":"string","description":"Zaiped id (templates)"},"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","templateId","values"],"additionalProperties":false}]},"contextWamid":{"type":"string"}},"required":["numberId","to","message"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"wamid":{"type":"string"},"to":{"type":"string"},"status":{"enum":["accepted","held_for_quality_assessment"]}},"required":["wamid","to","status"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/messages/{wamid}/read":{"post":{"operationId":"mark_read","tags":["messages"],"summary":"Mark a received message as read","description":"Optionally shows the typing indicator for up to 25 seconds.","parameters":[{"name":"wamid","in":"path","required":true,"description":"The WhatsApp message id (`wamid`) of the received message.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numberId":{"type":"string","description":"Zaiped id (whatsappConnections)"},"typing":{"type":"boolean"}},"required":["numberId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/blocked":{"post":{"operationId":"block_user","tags":["messages"],"summary":"Block a phone number","description":"Meta only allows blocking users who messaged the number in the last 24 hours.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numberId":{"type":"string","description":"Zaiped id (whatsappConnections)"},"phone":{"type":"string"}},"required":["numberId","phone"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/blocked/{numberId}/{phone}":{"delete":{"operationId":"unblock_user","tags":["messages"],"summary":"Unblock a phone number","parameters":[{"name":"numberId","in":"path","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}},{"name":"phone","in":"path","required":true,"description":"The phone in E.164 (`5511999999999`).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/media":{"post":{"operationId":"upload_media","tags":["media"],"summary":"Upload media to send","description":"Raw bytes in the request body with the `Content-Type` of the file (image, video, audio, document). Returns a `mediaId` to use as `media: { path }` in send_message. Not available as an MCP tool.","parameters":[{"name":"numberId","in":"query","required":true,"description":"The number id, as returned by list_numbers.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mediaId":{"type":"string"}},"required":["mediaId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/media/{messageId}":{"get":{"operationId":"get_media","tags":["media"],"summary":"Get a download URL for received media","description":"The `messageId` comes in the `message.received` webhook event. The URL is signed and short-lived.","parameters":[{"name":"messageId","in":"path","required":true,"description":"The Zaiped message id from the webhook event.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"number"},"mimeType":{"type":"string"},"fileName":{"type":"string"}},"required":["url","expiresAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/templates":{"get":{"operationId":"list_templates","tags":["templates"],"summary":"List message templates","description":"Local drafts and the mirror of the WABA's templates, with the status Meta gave each one.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (templates)"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"metaTemplateId":{"type":"string"},"components":{"type":"array","items":{}},"parameterFormat":{"type":"string"},"ttlSeconds":{"type":"number"},"variables":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"rejectedReason":{"type":"string"},"qualityScore":{"type":"string"}},"required":["id","name","language","category","components","variables","body"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"create_template","tags":["templates"],"summary":"Create a template","description":"Creates the template with Meta's `components` format and, by default, submits it for review right away. Header media is added in the console.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"language":{"type":"string"},"category":{"enum":["UTILITY","MARKETING","AUTHENTICATION"]},"components":{"type":"array","items":{}},"ttlSeconds":{"type":"number"},"submit":{"type":"boolean"}},"required":["name","language","category","components"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (templates)"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"metaTemplateId":{"type":"string"},"components":{"type":"array","items":{}},"parameterFormat":{"type":"string"},"ttlSeconds":{"type":"number"},"variables":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"rejectedReason":{"type":"string"},"qualityScore":{"type":"string"}},"required":["id","name","language","category","components","variables","body"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/templates/{templateId}":{"get":{"operationId":"get_template","tags":["templates"],"summary":"Get a template","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template id, as returned by list_templates.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (templates)"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"metaTemplateId":{"type":"string"},"components":{"type":"array","items":{}},"parameterFormat":{"type":"string"},"ttlSeconds":{"type":"number"},"variables":{"type":"array","items":{"type":"string"}},"body":{"type":"string"},"rejectedReason":{"type":"string"},"qualityScore":{"type":"string"}},"required":["id","name","language","category","components","variables","body"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_template","tags":["templates"],"summary":"Edit a submitted template","description":"Meta accepts edits on APPROVED, REJECTED and PAUSED templates and reviews again.","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"enum":["UTILITY","MARKETING","AUTHENTICATION"]},"components":{"type":"array","items":{}},"ttlSeconds":{"type":"number"}},"required":["category","components"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"delete_template","tags":["templates"],"summary":"Delete a template","description":"Deletes it locally and, if submitted, in the WABA. Meta blocks the name for 30 days after deleting an approved template.","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/templates/{templateId}/unpause":{"post":{"operationId":"unpause_template","tags":["templates"],"summary":"Unpause a template paused for quality","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"reason":{"type":"string"}},"required":["success"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/templates/sync":{"post":{"operationId":"sync_templates","tags":["templates"],"summary":"Sync templates from the WABA","description":"Re-reads every template from Meta, including ones created in WhatsApp Manager.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/flows":{"get":{"operationId":"list_flows","tags":["flows"],"summary":"List WhatsApp Flows","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (flows)"},"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"status":{"enum":["local","draft","published","deprecated","blocked","throttled"]},"metaFlowId":{"type":"string"},"flowJson":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}},"previewUrl":{"type":"string"},"responseCount":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","categories","status","flowJson","responseCount","updatedAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"create_flow","tags":["flows"],"summary":"Create a Flow","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"flowJson":{"type":"string"},"library":{"type":"string"},"lang":{"enum":["pt-BR","en-US"]},"push":{"type":"boolean"}},"required":["name","categories"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (flows)"},"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"status":{"enum":["local","draft","published","deprecated","blocked","throttled"]},"metaFlowId":{"type":"string"},"flowJson":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}},"previewUrl":{"type":"string"},"responseCount":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","categories","status","flowJson","responseCount","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/flows/{flowId}":{"get":{"operationId":"get_flow","tags":["flows"],"summary":"Get a Flow","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id, as returned by list_flows.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (flows)"},"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"status":{"enum":["local","draft","published","deprecated","blocked","throttled"]},"metaFlowId":{"type":"string"},"flowJson":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}},"previewUrl":{"type":"string"},"responseCount":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","categories","status","flowJson","responseCount","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_flow","tags":["flows"],"summary":"Update a Flow","description":"The JSON of a published flow is immutable at Meta; name and categories still change.","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"flowJson":{"type":"string"},"push":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (flows)"},"name":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"status":{"enum":["local","draft","published","deprecated","blocked","throttled"]},"metaFlowId":{"type":"string"},"flowJson":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}},"previewUrl":{"type":"string"},"responseCount":{"type":"number"},"updatedAt":{"type":"number"}},"required":["id","name","categories","status","flowJson","responseCount","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"delete_flow","tags":["flows"],"summary":"Delete a Flow","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/flows/{flowId}/publish":{"post":{"operationId":"publish_flow","tags":["flows"],"summary":"Publish a Flow","description":"Pushes the current JSON, requires zero validation errors and publishes.","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/flows/{flowId}/deprecate":{"post":{"operationId":"deprecate_flow","tags":["flows"],"summary":"Deprecate a published Flow","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/flows/{flowId}/responses":{"get":{"operationId":"list_flow_responses","tags":["flows"],"summary":"List responses to a Flow","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (flowResponses)"},"phoneNumber":{"type":"string"},"answers":{"type":"object","additionalProperties":{}},"receivedAt":{"type":"number"}},"required":["id","phoneNumber","answers","receivedAt"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["rows","truncated"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog":{"get":{"operationId":"get_catalog","tags":["catalog"],"summary":"Get the linked Meta catalog","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"null"},{"type":"object","properties":{"catalogId":{"type":"string"},"catalogName":{"type":"string"},"catalogVisible":{"type":"boolean"},"cartEnabled":{"type":"boolean"},"syncedAt":{"type":"number"},"itemCount":{"type":"number"},"errorCount":{"type":"number"}},"required":["catalogId","itemCount","errorCount"],"additionalProperties":false}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/connect":{"post":{"operationId":"connect_catalog","tags":["catalog"],"summary":"Link the WABA's catalog","description":"Finds the catalog attached to the WABA in Commerce Manager and links it to the account.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numberId":{"type":"string","description":"Zaiped id (whatsappConnections)"}},"required":["numberId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"catalogId":{"type":"string"},"catalogName":{"type":"string"},"catalogVisible":{"type":"boolean"},"cartEnabled":{"type":"boolean"},"syncedAt":{"type":"number"},"itemCount":{"type":"number"},"errorCount":{"type":"number"}},"required":["catalogId","itemCount","errorCount"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/settings":{"put":{"operationId":"update_catalog_settings","tags":["catalog"],"summary":"Show the catalog and enable the cart","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numberId":{"type":"string","description":"Zaiped id (whatsappConnections)"},"catalogVisible":{"type":"boolean"},"cartEnabled":{"type":"boolean"}},"required":["numberId","catalogVisible","cartEnabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/analytics":{"get":{"operationId":"get_analytics","tags":["analytics"],"summary":"Message analytics for a period","description":"Sent, delivered, read, failed and received counts, billing category mix, top errors and a daily series, from the account's message mirror.","parameters":[{"name":"from","in":"query","required":false,"description":"Start of the window, ISO 8601 date or epoch milliseconds. Default: seven days ago.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"End of the window, ISO 8601 date or epoch milliseconds. Default: now.","schema":{"type":"string"}},{"name":"numberId","in":"query","required":false,"description":"Restrict to one number.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"read":{"type":"number"},"failed":{"type":"number"},"received":{"type":"number"},"billable":{"type":"number"},"byCategory":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"number"}},"required":["category","count"],"additionalProperties":false}},"bySource":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"count":{"type":"number"}},"required":["source","count"],"additionalProperties":false}},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"title":{"type":"string"},"details":{"type":"string"},"count":{"type":"number"}},"required":["title","count"],"additionalProperties":false}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"outbound":{"type":"number"},"inbound":{"type":"number"},"delivered":{"type":"number"},"failed":{"type":"number"}},"required":["day","outbound","inbound","delivered","failed"],"additionalProperties":false}},"timeZone":{"type":"string"},"truncated":{"type":"boolean"}},"required":["from","to","sent","delivered","read","failed","received","billable","byCategory","bySource","errors","daily","timeZone","truncated"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/analytics/refresh":{"post":{"operationId":"refresh_analytics","tags":["analytics"],"summary":"Re-read Meta's billing analytics now","description":"Runs the daily collection of Meta's cost and template analytics for the account. Limited to a few calls per hour.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhooks":{"get":{"operationId":"list_webhooks","tags":["webhooks"],"summary":"List webhook endpoints","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (developerWebhooks)"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":"number"},"lastDeliveryAt":{"type":"number"},"lastFailureAt":{"type":"number"}},"required":["id","url","events","enabled","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"create_webhook","tags":["webhooks"],"summary":"Create a webhook endpoint","description":"Registers an HTTPS URL for the given events (`message.received`, `message.status`, `template.status`, `number.update`, `account.notice`, `call.event`). The signing secret is returned once: verify `X-Zaiped-Signature` (`t=TIMESTAMP,v1=HEX`, where HEX is the HMAC-SHA256 of `TIMESTAMP.BODY`) with it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}}},"required":["url","events"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (developerWebhooks)"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"}},"required":["id","url","events","secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhooks/{webhookId}":{"get":{"operationId":"get_webhook","tags":["webhooks"],"summary":"Get a webhook endpoint","parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook id, as returned by list_webhooks.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (developerWebhooks)"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":"number"},"lastDeliveryAt":{"type":"number"},"lastFailureAt":{"type":"number"}},"required":["id","url","events","enabled","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"update_webhook","tags":["webhooks"],"summary":"Update a webhook endpoint","parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (developerWebhooks)"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":"number"},"lastDeliveryAt":{"type":"number"},"lastFailureAt":{"type":"number"}},"required":["id","url","events","enabled","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"delete_webhook","tags":["webhooks"],"summary":"Delete a webhook endpoint","parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhooks/{webhookId}/test":{"post":{"operationId":"test_webhook","tags":["webhooks"],"summary":"Send a test event","description":"Queues a `test` event to this endpoint, signed like any other.","parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deliveryId":{"type":"string","description":"Zaiped id (developerWebhookDeliveries)"}},"required":["deliveryId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhooks/{webhookId}/deliveries":{"get":{"operationId":"list_webhook_deliveries","tags":["webhooks"],"summary":"List recent deliveries","description":"The last deliveries to this endpoint, newest first, with the attempt count and the last HTTP status.","parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook id.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Zaiped id (developerWebhookDeliveries)"},"event":{"type":"string"},"status":{"enum":["pending","delivered","failed"]},"attempts":{"type":"number"},"lastStatusCode":{"type":"number"},"lastError":{"type":"string"},"nextAttemptAt":{"type":"number"},"createdAt":{"type":"number"}},"required":["id","event","status","attempts","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}}}