{"openapi":"3.1.0","info":{"title":"Hatched Send Email API","version":"1.1.0","description":"Transactional email for developers: send with CC/BCC, retry safely with Idempotency-Key, build against test keys (sk_test_) that never deliver, add sending domains and register signed webhooks. SDK: npm install @hatched-digital/send.","contact":{"name":"Hatched","url":"https://hatched.digital"},"license":{"name":"MIT"}},"servers":[{"url":"https://send.hatched.digital","description":"Production"}],"security":[{"BearerAuth":[]}],"paths":{"/api/v1/email":{"post":{"operationId":"sendEmail","summary":"Send a transactional email","description":"Send a single transactional email. Supports HTML, plain text, templates, and variable substitution.","tags":["Email"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Makes retries safe. A repeat with the same key and body within 24 hours returns the first 2xx response with the header Idempotent-Replayed: true and sends nothing. Same key with a different body: 422. While the first request is still running: 409. A failed request releases the key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequest"}}}},"responses":{"200":{"description":"Email queued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"idempotency_conflict: a request with this Idempotency-Key is still being processed"},"422":{"description":"idempotency_mismatch: this Idempotency-Key was used with a different body"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/v1/email/batch":{"post":{"operationId":"sendBatchEmail","summary":"Send a batch of emails","description":"Send up to 100 emails in a single request.","tags":["Email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSendRequest"}}}},"responses":{"200":{"description":"Batch processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSendResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/email/{messageId}/status":{"get":{"operationId":"getEmailStatus","summary":"Get email delivery status","description":"Retrieve the current status and event history of a sent email.","tags":["Email"],"parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"The email message ID returned from the send endpoint."}],"responses":{"200":{"description":"Email status and events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStatusResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/senders":{"get":{"operationId":"listSenders","summary":"List API senders","description":"Senders (sender_ref) with their counters and pause state. A sender pauses on its own after 3 or more hard bounces at 8% or more of its sends (once it has 20 sends), or 2 or more spam complaints at 0.5% or more. A sender.paused webhook fires when that happens.","tags":["Email"],"parameters":[{"name":"paused","in":"query","required":false,"schema":{"type":"boolean"},"description":"true lists paused senders only."}],"responses":{"200":{"description":"Senders","content":{"application/json":{"schema":{"type":"object","properties":{"senders":{"type":"array","items":{"$ref":"#/components/schemas/ApiSender"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/senders/resume":{"post":{"operationId":"resumeSender","summary":"Resume a paused sender","description":"Lifts the pause and restarts the sender's counters. Fix the cause first (bad addresses, unwanted mail) or it will pause again.","tags":["Email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sender_ref"],"properties":{"sender_ref":{"type":"string"}}}}}},"responses":{"200":{"description":"The sender after resuming","content":{"application/json":{"schema":{"type":"object","properties":{"sender":{"$ref":"#/components/schemas/ApiSender"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/widget/signup/{slug}":{"get":{"operationId":"getWidgetSignupConfig","summary":"Get public signup form config","description":"Returns styling and behaviour config for an embeddable signup form. No authentication required.","tags":["Widget"],"security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"Public form slug"}],"responses":{"200":{"description":"Form configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSignupConfig"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"operationId":"submitWidgetSignup","summary":"Submit signup from embed","description":"Public endpoint for external sites. Rate limited to 5 requests per IP per minute.","tags":["Widget"],"security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSignupRequest"}}}},"responses":{"200":{"description":"Signup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSignupResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/domains":{"get":{"operationId":"listDomains","summary":"List sending domains","tags":["Domains"],"description":"Needs a key with the domain:manage permission.","responses":{"200":{"description":"Domains","content":{"application/json":{"schema":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"operationId":"createDomain","summary":"Add a sending domain","tags":["Domains"],"description":"Adds the domain and returns the DNS records to publish. Plan limits apply (403 plan_domain_limit). Then call verify.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"conflict: the domain belongs to another account"}}}},"/api/v1/domains/{domain}":{"get":{"operationId":"getDomain","summary":"Get a sending domain","tags":["Domains"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"example":"example.com"}],"responses":{"200":{"description":"Domain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"not_found"}}}},"/api/v1/domains/{domain}/verify":{"post":{"operationId":"verifyDomain","summary":"Verify a sending domain","tags":["Domains"],"description":"Checks DNS now. status becomes \"verified\" once SPF and DKIM are published. Safe to call repeatedly.","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"},"example":"example.com"}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"not_found: add the domain first"}}}},"/api/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhook endpoints","tags":["Webhooks"],"description":"Needs a key with the webhook:manage permission. Secrets are never listed.","responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"operationId":"createWebhook","summary":"Register a webhook endpoint","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhook"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/webhooks/{id}":{"get":{"operationId":"getWebhook","summary":"Get a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"not_found"}}},"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"not_found"}}}},"/api/v1/audiences":{"get":{"summary":"List audiences","description":"Audiences with ids and subscriber counts. Needs contact:read.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Audiences","content":{"application/json":{"schema":{"type":"object","properties":{"audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subscriber_count":{"type":"integer"},"created_at":{"type":"string"}}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/api/v1/contacts":{"post":{"summary":"Add or update a contact","description":"Upsert by email into one audience. Safe to retry. 'New subscriber' automations start only when someone newly joins or rejoins. consent must be true. Needs contact:write. Rate limited to 120 requests a minute per key.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","audience_id","consent"],"properties":{"email":{"type":"string","format":"email"},"audience_id":{"type":"string","format":"uuid"},"consent":{"type":"boolean","enum":[true]},"first_name":{"type":"string","maxLength":100},"last_name":{"type":"string","maxLength":100},"tags":{"type":"array","maxItems":20,"items":{"type":"string","maxLength":50}},"custom_fields":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"consent_source":{"type":"string","maxLength":100}}}}}},"responses":{"200":{"description":"Already subscribed; details updated"},"201":{"description":"Joined the audience (created or resubscribed)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"result":{"type":"string","enum":["created","resubscribed","updated"]},"automations_started":{"type":"boolean"},"suppressed":{"type":"boolean"},"contact":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"audience_id":{"type":"string","format":"uuid"},"audience_name":{"type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed"]},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"subscribed_at":{"type":"string","nullable":true},"unsubscribed_at":{"type":"string","nullable":true}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"get":{"summary":"Look up a contact","description":"Audiences, status, tags and fields for one email. Needs contact:read.","security":[{"BearerAuth":[]}],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}},{"name":"audience_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"suppressed":{"type":"boolean"},"memberships":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"audience_id":{"type":"string","format":"uuid"},"audience_name":{"type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed"]},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"subscribed_at":{"type":"string","nullable":true},"unsubscribed_at":{"type":"string","nullable":true}}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/api/v1/contacts/unsubscribe":{"post":{"summary":"Unsubscribe a contact","description":"With audience_id, from that audience. Without, from every audience and onto the workspace suppression list. Idempotent. Needs contact:write.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"audience_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Unsubscribed","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"suppressed":{"type":"boolean"},"memberships":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"audience_id":{"type":"string","format":"uuid"},"audience_name":{"type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed"]},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"subscribed_at":{"type":"string","nullable":true},"unsubscribed_at":{"type":"string","nullable":true}}}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Your Hatched Send API key: `Authorization: Bearer sk_live_xxx`. Test keys (`sk_test_xxx`) work on the email endpoints: sends are validated and logged with status \"test\" but never delivered or billed."}},"schemas":{"SendEmailRequest":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string","format":"email","description":"Sender email address (must be from a verified domain)"},"to":{"oneOf":[{"type":"string","format":"email"},{"type":"array","items":{"type":"string","format":"email"},"minItems":1,"maxItems":50}],"description":"Recipient address, or a list of up to 50: a list sends a separate email to each address."},"subject":{"type":"string","minLength":1,"maxLength":998,"description":"Email subject line. Supports {{variable}} substitution."},"html":{"type":"string","description":"HTML body content. Supports {{variable}} substitution."},"text":{"type":"string","description":"Plain text fallback body."},"template_id":{"type":"string","format":"uuid","description":"Use a saved template instead of providing html/text."},"variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Key-value pairs for {{variable}} substitution in subject, html, and text."},"reply_to":{"type":"string","format":"email","description":"Reply-to email address."},"tags":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"Tags for categorizing and filtering emails."},"track_opens":{"type":"boolean","default":true,"description":"Track when the email is opened."},"track_clicks":{"type":"boolean","description":"false sends links untouched (no click tracking). Leave out for the account default."},"show_powered_by":{"type":"boolean","description":"Include the Powered by Hatched Send badge. Transactional emails never include it unless you set true. For marketing emails, omit to use the Email footer setting; Growth and Scale can set false, Free and Starter always include it."},"sender_ref":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$","description":"Your id for the business this email is sent for (platforms that send for many businesses). Each sender_ref has its own bounce and complaint counters and is paused on its own (403 sender_paused, see /api/v1/senders). Webhook events carry it back as data.sender_ref."},"cc":{"oneOf":[{"type":"string","format":"email"},{"type":"array","items":{"type":"string","format":"email"},"maxItems":20}],"description":"Visible copies on the same message (one address or up to 20). Needs a single `to` address. Suppressed addresses are left off and listed in suppressed_copies."},"bcc":{"oneOf":[{"type":"string","format":"email"},{"type":"array","items":{"type":"string","format":"email"},"maxItems":20}],"description":"Hidden copies on the same message (one address or up to 20). Needs a single `to` address."},"from_name":{"type":"string","maxLength":128,"description":"Display name for the From header, e.g. \"Acme via YourApp\"."},"category":{"type":"string","enum":["transactional","marketing"],"description":"transactional (default) or marketing (adds the unsubscribe footer and List-Unsubscribe header)."},"attachments":{"type":"array","maxItems":5,"items":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string"},"content":{"type":"string","description":"Base64, up to 10 MB decoded."},"content_type":{"type":"string"}}}}}},"SendEmailResponse":{"type":"object","description":"One `to` address: { id, status }. Several: { results } with one entry per address, in request order.","properties":{"id":{"type":"string","description":"The message id."},"status":{"type":"string","enum":["queued"]},"results":{"type":"array","items":{"$ref":"#/components/schemas/RecipientResult"}},"suppressed_copies":{"type":"array","items":{"type":"string"},"description":"cc/bcc addresses left off because they are suppressed. Only present when there are some."},"test":{"type":"boolean","enum":[true],"description":"Only present for test keys: nothing was delivered."}}},"BatchSendRequest":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/SendEmailRequest"},"minItems":1,"maxItems":100,"description":"Array of email messages to send."}}},"BatchSendResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/RecipientResult"}},"test":{"type":"boolean","enum":[true]}}},"EmailStatusResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sent","delivered","opened","clicked","bounced","failed","complained","unsubscribed"]},"to":{"type":"string"},"subject":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"sent_at":{"type":"string","format":"date-time","nullable":true},"delivered_at":{"type":"string","format":"date-time","nullable":true},"sender_ref":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string","enum":["sent","delivered","opened","clicked","bounced","unsubscribed","complained"]},"timestamp":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}}}}},"ApiSender":{"type":"object","properties":{"sender_ref":{"type":"string"},"sent_count":{"type":"integer"},"hard_bounce_count":{"type":"integer"},"complaint_count":{"type":"integer"},"paused":{"type":"boolean"},"paused_reason":{"type":"string","nullable":true},"paused_at":{"type":"string","format":"date-time","nullable":true},"last_sent_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["authentication_error","permission_error","validation_error","rate_limit_error","not_found_error","internal_error"]},"message":{"type":"string"}}}}},"WidgetSignupConfig":{"type":"object","properties":{"slug":{"type":"string"},"headline":{"type":"string"},"description":{"type":"string","nullable":true},"buttonText":{"type":"string"},"successMessage":{"type":"string"},"primaryColor":{"type":"string"},"backgroundColor":{"type":"string"},"buttonColor":{"type":"string"},"fontFamily":{"type":"string"},"layout":{"type":"string","enum":["inline","stacked","minimal"]},"borderRadius":{"type":"string"},"collectName":{"type":"boolean"},"embedMode":{"type":"string","enum":["inline","isolated","iframe"]},"requireConsent":{"type":"boolean"},"requireDoubleOptin":{"type":"boolean"}}},"WidgetSignupRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"consentGiven":{"type":"boolean"}}},"WidgetSignupResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string","enum":["subscribed","pending_confirmation","already_subscribed"]},"error":{"type":"string"}}},"RecipientResult":{"type":"object","properties":{"id":{"type":"string","description":"Message id, or \"\" when not sent."},"to":{"type":"string"},"status":{"type":"string","description":"\"queued\", or \"failed: …\" e.g. \"failed: recipient suppressed (unsubscribed/bounced)\"."},"reason":{"type":"string","enum":["suppressed"]},"suppressed_copies":{"type":"array","items":{"type":"string"}}}},"DnsRecord":{"type":"object","properties":{"purpose":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"host":{"type":"string","description":"What to type in the DNS provider's Host / Name field."},"value":{"type":"string"},"action":{"type":"string","description":"\"ok\" when published correctly; otherwise what to do (add, replace, …)."},"required":{"type":"boolean"},"note":{"type":"string"}}},"Domain":{"type":"object","properties":{"domain":{"type":"string"},"status":{"type":"string","enum":["verified","pending"]},"sendable":{"type":"boolean"},"spf":{"type":"boolean"},"dkim":{"type":"boolean"},"dmarc":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string"}},"health_score":{"type":["integer","null"]},"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"}},"next_step":{"type":"string"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["email.sent","email.delivered","email.opened","email.clicked","email.bounced","email.complained","email.unsubscribed","email.inbound","sender.paused","*"]}},"active":{"type":"boolean"},"description":{"type":["string","null"]},"failure_count":{"type":"integer"},"created_at":{"type":["string","null"],"format":"date-time"}}},"CreateWebhookRequest":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Public https:// URL."},"events":{"type":"array","items":{"type":"string","enum":["email.sent","email.delivered","email.opened","email.clicked","email.bounced","email.complained","email.unsubscribed","email.inbound","sender.paused","*"]},"description":"Leave out for every event."},"description":{"type":"string","maxLength":200}}},"CreatedWebhook":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string","description":"Signing secret, shown only once. Deliveries carry X-HatchedSend-Signature-V1: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\">."}}}]}},"responses":{"BadRequest":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Forbidden":{"description":"API key lacks required permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"RateLimited":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"InternalError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"tags":[{"name":"Email","description":"Send transactional emails, check status, and manage delivery."},{"name":"Widget","description":"Public signup form embed API — no authentication required."}]}