{"openapi":"3.1.0","info":{"title":"Ternwire Public API","version":"1.0.0","description":"Send transactional and newsletter email, receive email at your domains, and manage the domains, templates, webhooks, audiences, broadcasts and automations behind them.\n\nAuthenticate with an API key in the Authorization header: `Authorization: Bearer em_live_...`. A test key (`em_test_...`) runs the whole pipeline with simulated outcomes and sends no real email. Each operation names the key scope it needs; call getCurrentAccount to see the key's scopes, plan and remaining quota.\n\nEvery request that sends something takes an Idempotency-Key header. Reuse the key when you retry a request whose outcome you don't know, and the API returns the first result instead of acting twice.\n\nEvery error has a JSON body with a code in `code` (also in `status`), a readable `message`, per-field `fields` on validation errors, and a `requestId`. Branch on the code, not the message. A 429 carries Retry-After.\n\nLists return `data` and `nextCursor`. Pass `nextCursor` back as `cursor` until it is null.\n\nDocumentation: https://ternwire.com/docs. All of it as one Markdown file: https://ternwire.com/llms-full.txt.","contact":{"name":"Ternwire support","url":"https://ternwire.com/contact"}},"servers":[{"url":"https://ternwire.com/v1","description":"Production"}],"tags":[{"name":"Account","description":"The workspace, plan and quota the API key acts for."},{"name":"API keys","description":"Create, list and revoke API keys."},{"name":"Emails","description":"Send email and read what happened to it."},{"name":"Templates","description":"Saved Handlebars and React Email templates."},{"name":"Attachments","description":"Upload files before sending them, and read their virus scan status."},{"name":"Domains","description":"Sending domains and the DNS records that verify them."},{"name":"Receiving","description":"Addresses at your domains that receive email, and the email they received."},{"name":"Webhooks","description":"Endpoints that receive signed events, and the delivery attempts made to them."},{"name":"Suppressions","description":"Addresses Ternwire will not email."},{"name":"Audiences","description":"Newsletter lists and the subscriptions to them."},{"name":"Contacts","description":"The people in your audiences."},{"name":"Contact imports","description":"Import contacts from CSV files and other newsletter platforms."},{"name":"Broadcasts","description":"Newsletter emails sent to an audience."},{"name":"Automations","description":"Email sequences that run per contact, and their events."},{"name":"Settings","description":"Open and click tracking."},{"name":"Metrics","description":"Counts of email accepted, delivered, bounced and so on."}],"externalDocs":{"description":"Ternwire documentation","url":"https://ternwire.com/docs"},"paths":{"/emails":{"post":{"operationId":"submitEmail","description":"Accepts an email for delivery and returns its message ID at once. Delivery happens in the background: read it with getMessage or receive webhook events. Every request needs an Idempotency-Key header: reuse the key when retrying a request whose outcome you don't know, and the API returns the first result instead of sending again. Send either subject with html and/or text, or a saved templateId with values.\n\nA body with purpose \"marketing\" sends one email to a confirmed subscriber and needs the marketing:send scope and a live key. Its single to address must be the contact's own, and cc, bcc and listManagement must be empty because Ternwire adds the unsubscribe headers and footer.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EmailRequest"},{"$ref":"#/components/schemas/MarketingEmailSubmission"}]},"examples":{"html":{"summary":"An email with HTML and text","value":{"from":"Acme <receipts@mail.acme.com>","to":["ada@example.com"],"subject":"Your receipt for order 1042","html":"<p>Thanks for your order, Ada.</p>","text":"Thanks for your order, Ada.","tags":{"order":"1042"}}},"template":{"summary":"An email from a saved template","value":{"from":"Acme <receipts@mail.acme.com>","to":["ada@example.com"],"templateId":"template_8f3c2a1b9d0e","values":{"first_name":"Ada","order_number":"1042"}}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedMessage"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"RateLimit-Limit":{"description":"How many emails the workspace can send at once when the limit is full: 100, or 50 for newsletter emails.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"How many more emails can be sent right now.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the limit is full again.","schema":{"type":"integer"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Send an email","tags":["Emails"],"x-ternwire-scope":"send"},"get":{"operationId":"listMessages","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["accepted","queued","held","submitting","submitted","submission_unknown","failed"]},"description":"Only items in this state."},{"name":"subject","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"Only emails whose subject contains this text."},{"name":"recipient","in":"query","required":false,"schema":{"description":"A complete address matches recipients with exactly that address, in any case. Part of an address matches recipients whose address contains it, which is slower.","type":"string","maxLength":320},"description":"Only emails with this recipient address."},{"name":"acceptedFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Only emails accepted at or after this time, in ISO 8601."},{"name":"acceptedTo","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Only emails accepted before this time, in ISO 8601."}],"responses":{"200":{"description":"Messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List sent emails","tags":["Emails"],"description":"Lists emails accepted for this workspace, newest first, one page at a time, with each one's overall state. Pass nextCursor back as cursor for the next page.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/emails/{messageId}":{"get":{"operationId":"getMessage","parameters":[{"name":"messageId","in":"path","required":true,"description":"The email's message ID, as returned by submitEmail.","schema":{"type":"string"}}],"responses":{"200":{"description":"Message status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get an email","tags":["Emails"],"description":"Returns one email with the delivery state of each recipient, and opens and clicks when tracking was on.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/templates":{"post":{"operationId":"createEmailTemplate","description":"Stores a template, up to 500 per organization and 100 MB of html, text and editorContent across all templates. Returns 409 template_limit_reached or template_storage_limit_reached when full. An optional Idempotency-Key header makes a retry with the same body return the first template, and the same key with a different body returns 409 idempotency_conflict.\n\nNeeds an API key with the `send` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateCreate"},"examples":{"handlebars":{"summary":"A Handlebars template","value":{"name":"Order receipt","subject":"Your receipt for order {{order_number}}","html":"<p>Hi {{first_name}}, thanks for order {{order_number}}.</p>","text":"Hi {{first_name}}, thanks for order {{order_number}}."}}}}}},"responses":{"201":{"description":"Created email template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Create a template","tags":["Templates"],"x-ternwire-scope":"send"},"get":{"operationId":"listEmailTemplates","description":"Lists template summaries one page at a time. Fetch a template by id to read its content.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Email templates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List templates","tags":["Templates"],"x-ternwire-scope":"send"}},"/templates/{templateId}":{"get":{"operationId":"getEmailTemplate","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Email template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a template","tags":["Templates"],"description":"Returns one template with its subject, html, text and editor content.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"},"put":{"operationId":"replaceEmailTemplate","description":"Replaces a template. Returns 409 template_storage_limit_reached when the larger content would take the organization past 100 MB. Send If-Match with the updatedAt you last read to replace only that version: a template saved since returns 409 template_changed. Without If-Match the template is replaced whatever its version.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template's ID.","schema":{"type":"string"}},{"name":"If-Match","in":"header","required":false,"description":"Optional. The template's updatedAt as you last read it, bare or in double quotes.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateCreate"}}}},"responses":{"200":{"description":"Updated email template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Replace a template","tags":["Templates"],"x-ternwire-scope":"send"},"delete":{"operationId":"deleteEmailTemplate","description":"Deletes the template. Returns 409 template_in_use while a scheduled or sending broadcast, or an active or paused automation, uses it.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"templateId","in":"path","required":true,"description":"The template's ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Email template deleted","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Delete a template","tags":["Templates"],"x-ternwire-scope":"send"}},"/attachments":{"post":{"operationId":"createAttachmentUploadSlot","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadSlotRequest"}}}},"responses":{"201":{"description":"Upload slot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadSlot"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Start an attachment upload","tags":["Attachments"],"description":"Returns a presigned URL. PUT the raw file bytes to it with the returned headers, then call completeAttachmentUpload. The file is scanned for viruses before an email can use it.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/attachments/{attachmentId}":{"get":{"operationId":"getAttachment","parameters":[{"name":"attachmentId","in":"path","required":true,"description":"The attachment's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Scan status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get an attachment","tags":["Attachments"],"description":"Returns the attachment's scan status. Use the attachment in an email once its status is clean.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/attachments/{attachmentId}/complete":{"post":{"operationId":"completeAttachmentUpload","parameters":[{"name":"attachmentId","in":"path","required":true,"description":"The attachment's ID.","schema":{"type":"string"}}],"responses":{"202":{"description":"Scan queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Finish an attachment upload","tags":["Attachments"],"description":"Tells Ternwire the upload is complete and queues the virus scan. Read the attachment until its status is clean.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/domains":{"get":{"operationId":"listSendingDomains","responses":{"200":{"description":"Sending domains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List sending domains","tags":["Domains"],"description":"Lists the workspace's sending domains with their verification state and the DNS records each one needs.\n\nNeeds an API key with the `send` scope. Test keys are refused.","x-ternwire-scope":"send","x-ternwire-live-key-only":true},"post":{"operationId":"createSendingDomain","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainCreate"},"examples":{"domain":{"summary":"A sending domain","value":{"domain":"mail.acme.com"}}}}}},"responses":{"201":{"description":"Sending domain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Add a sending domain","tags":["Domains"],"description":"Adds a domain to send from and returns the DNS records to publish at the domain's DNS provider. Email can be sent from the domain once it is verified.\n\nNeeds an API key with the `send` scope. Test keys are refused.","x-ternwire-scope":"send","x-ternwire-live-key-only":true}},"/domains/{domainId}":{"get":{"operationId":"getSendingDomain","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"DNS status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a sending domain","tags":["Domains"],"description":"Refreshes the domain's verification state from the email provider and returns it with the DNS records still to publish.\n\nNeeds an API key with the `send` scope. Test keys are refused.","x-ternwire-scope":"send","x-ternwire-live-key-only":true},"delete":{"operationId":"deleteSendingDomain","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}}],"responses":{"202":{"description":"Deletion converging","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingDomainDeletionStatus"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Delete a sending domain","tags":["Domains"],"description":"Removes the domain. The removal finishes in the background: the response says how far it got. Email can no longer be sent from the domain.\n\nNeeds an API key with the `send` scope. Test keys are refused.","x-ternwire-scope":"send","x-ternwire-live-key-only":true}},"/domains/{domainId}/receiving-addresses":{"get":{"operationId":"listReceivingAddresses","description":"The addresses on this domain that receive email, with the MX record that sends the domain's mail to Ternwire, and how many addresses the plan allows.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Receiving addresses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddressList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List receiving addresses","tags":["Receiving"],"x-ternwire-scope":"send"},"post":{"operationId":"createReceivingAddress","description":"Adds an address this domain receives email at. The Free plan has one address per domain and paid plans have more. Needs a live key with the send scope. Returns 409 receiving_address_limit_reached when the domain has as many as the plan allows, and 200 with the existing address when the domain already has this local part. Every received email counts against the plan's email quota like a sent one, and email beyond the quota is dropped. With forwardTo, email that passes the spam check is also sent on to that address, which counts as one more email. Mail arrives once the domain is verified and its MX record points to the host in mxRecord.","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddressCreate"},"examples":{"support":{"summary":"A support address that forwards to a teammate","value":{"localPart":"support","forwardTo":"ada@acme.com"}}}}}},"responses":{"200":{"description":"Already there","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddress"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"201":{"description":"Receiving address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddress"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Add a receiving address","tags":["Receiving"],"x-ternwire-scope":"send","x-ternwire-live-key-only":true}},"/domains/{domainId}/receiving-addresses/check":{"post":{"operationId":"checkReceivingAddresses","description":"Looks up the domain's MX records now and returns its addresses.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Receiving addresses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddressList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Check the MX record","tags":["Receiving"],"x-ternwire-scope":"send"}},"/domains/{domainId}/receiving-addresses/{addressId}":{"patch":{"operationId":"updateReceivingAddress","description":"Changes where the address forwards its email. forwardTo must be the verified email address of a member of the organization, or null to stop forwarding. Returns 422 forward_address_not_member otherwise.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}},{"name":"addressId","in":"path","required":true,"description":"The receiving address's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddressUpdate"}}}},"responses":{"200":{"description":"Receiving address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivingAddress"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Change forwarding of an address","tags":["Receiving"],"x-ternwire-scope":"send"},"delete":{"operationId":"deleteReceivingAddress","description":"Stops receiving at this address. Email already received stays listable.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"domainId","in":"path","required":true,"description":"The sending domain's ID.","schema":{"type":"string"}},{"name":"addressId","in":"path","required":true,"description":"The receiving address's ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Receiving stopped","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Remove a receiving address","tags":["Receiving"],"x-ternwire-scope":"send"}},"/inbound-emails":{"get":{"operationId":"listInboundEmails","description":"Lists email received at your receiving addresses, newest first. Needs the inbound:read scope. Received email is kept for 30 days. forward says whether an email was forwarded, and why not.","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"domainId","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Only email received at this domain."}],"responses":{"200":{"description":"Received email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEmailList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List received email","tags":["Receiving"],"x-ternwire-scope":"inbound:read"}},"/inbound-emails/{inboundEmailId}":{"get":{"operationId":"getInboundEmail","description":"One received email with its text, HTML and attachment list. The HTML is the sender's and is not sanitized. Needs the inbound:read scope.","parameters":[{"name":"inboundEmailId","in":"path","required":true,"description":"The received email's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Received email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEmail"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a received email","tags":["Receiving"],"x-ternwire-scope":"inbound:read"}},"/inbound-emails/{inboundEmailId}/raw":{"get":{"operationId":"getInboundEmailRaw","description":"The received message exactly as it arrived, as message/rfc822, including attachments. Returns 410 inbound_email_content_unavailable after retention removed it. Needs the inbound:read scope.","parameters":[{"name":"inboundEmailId","in":"path","required":true,"description":"The received email's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Raw message","content":{"message/rfc822":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Download a received email","tags":["Receiving"],"x-ternwire-scope":"inbound:read"}},"/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","responses":{"200":{"description":"Webhook endpoints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List webhook endpoints","tags":["Webhooks"],"description":"Lists the workspace's webhook endpoints and the events each one receives.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"},"post":{"operationId":"createWebhookEndpoint","description":"Registers an endpoint, up to 10 per organization including disabled endpoints. Returns 409 webhook_endpoint_limit_reached when full. An optional Idempotency-Key header makes a retry with the same body return the same endpoint and signing secret, and the same key with a different body returns 409 idempotency_conflict. If that endpoint was deleted since, the retry returns 409 idempotency_record_deleted.\n\nNeeds an API key with the `send` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"},"examples":{"endpoint":{"summary":"An endpoint for delivery events","value":{"url":"https://acme.com/webhooks/ternwire","eventTypes":["email.delivered","email.bounced","email.complained"]}}}}}},"responses":{"201":{"description":"Webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Add a webhook endpoint","tags":["Webhooks"],"x-ternwire-scope":"send"}},"/webhook-endpoints/{endpointId}":{"patch":{"operationId":"updateWebhookEndpoint","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The webhook endpoint's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update a webhook endpoint","tags":["Webhooks"],"description":"Changes the endpoint's URL or events, or disables or enables it. A disabled endpoint receives no new events: events that occur while it is disabled are dropped, and its pending retries wait until it is enabled again.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"},"delete":{"operationId":"deleteWebhookEndpoint","description":"Destroys the endpoint signing secret, and no new delivery is claimed after it returns. An already-claimed delivery may still be sent. The delivery attempt history stays listable until retention removes it.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The webhook endpoint's ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Webhook endpoint deleted","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Delete a webhook endpoint","tags":["Webhooks"],"x-ternwire-scope":"send"}},"/webhook-endpoints/{endpointId}/rotate-signing-secret":{"post":{"operationId":"rotateWebhookEndpointSigningSecret","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The webhook endpoint's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Rotated signing secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSigningSecretRotated"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Rotate a signing secret","tags":["Webhooks"],"description":"Creates a new signing secret and returns it once. New events are signed with it at once, while retries of earlier events keep the old secret, so accept both until those finish.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/webhook-attempts":{"get":{"operationId":"listWebhookAttempts","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"endpointId","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Only attempts to this endpoint."},{"name":"messageId","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Only attempts for this email."}],"responses":{"200":{"description":"Webhook attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAttemptList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List webhook attempts","tags":["Webhooks"],"description":"Lists delivery attempts to your webhook endpoints, newest first, with the response each one got. Filter by endpoint or state.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/webhook-attempts/{attemptId}":{"get":{"operationId":"getWebhookAttempt","parameters":[{"name":"attemptId","in":"path","required":true,"description":"The webhook attempt's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook attempt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAttempt"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a webhook attempt","tags":["Webhooks"],"description":"Returns one delivery attempt with the history of every try.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/webhook-attempts/{attemptId}/replay":{"post":{"operationId":"replayWebhookAttempt","parameters":[{"name":"attemptId","in":"path","required":true,"description":"The webhook attempt's ID.","schema":{"type":"string"}}],"responses":{"202":{"description":"Replay queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAttempt"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Replay a webhook attempt","tags":["Webhooks"],"description":"Sends the same event to the endpoint again, with the same event id, so your handler can check that it deduplicates.\n\nNeeds an API key with the `send` scope.","x-ternwire-scope":"send"}},"/suppressions":{"get":{"operationId":"listSuppressions","description":"Lists the blocked addresses Ternwire won't email, newest first: bounces, spam complaints and the ones you added.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"search","in":"query","required":false,"schema":{"description":"Matches part of the address","type":"string","minLength":1,"maxLength":320},"description":"Only items whose address contains this text."}],"responses":{"200":{"description":"Blocked addresses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List blocked addresses","tags":["Suppressions"],"x-ternwire-scope":"send"},"post":{"operationId":"createSuppression","description":"Blocks an address, for example after someone unsubscribes in your app. Returns 201 when it is added and 200 when you already blocked it.\n\nNeeds an API key with the `send` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionCreate"},"examples":{"address":{"summary":"Block an address","value":{"address":"ada@example.com"}}}}}},"responses":{"200":{"description":"Already blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"201":{"description":"Blocked address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Block an address","tags":["Suppressions"],"x-ternwire-scope":"send"}},"/suppressions/{suppressionId}":{"delete":{"operationId":"deleteSuppression","description":"Unblocks the address, clearing its bounce and manual blocks. Returns 409 suppression_not_removable for an address that reported spam.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"suppressionId","in":"path","required":true,"description":"The blocked address's ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Unblocked","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Unblock an address","tags":["Suppressions"],"x-ternwire-scope":"send"}},"/audiences":{"post":{"operationId":"createAudience","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceCreate"}}}},"responses":{"201":{"description":"Audience","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audience"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Create an audience","tags":["Audiences"],"description":"Creates a newsletter list. Contacts join it through a double opt-in subscription or an import.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true},"get":{"operationId":"listAudiences","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Audiences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List audiences","tags":["Audiences"],"description":"Lists the workspace's audiences with their member counts.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"}},"/audiences/{audienceId}":{"get":{"operationId":"getAudience","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Audience","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audience"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get an audience","tags":["Audiences"],"description":"Returns one audience with its member counts by subscription state.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"},"patch":{"operationId":"updateAudience","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceUpdate"}}}},"responses":{"200":{"description":"Audience","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audience"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update an audience","tags":["Audiences"],"description":"Changes the audience's name, sender, default locale or the text of its confirmation email.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/audiences/{audienceId}/archive":{"post":{"operationId":"archiveAudience","description":"Stops new subscriptions and broadcasts. Existing contacts and history stay.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Audience","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audience"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Archive an audience","tags":["Audiences"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/audiences/{audienceId}/export":{"get":{"operationId":"exportAudience","description":"Streams every member as CSV with the columns email, state, updated_at and attributes. Cells that start with a formula character are prefixed with an apostrophe.\n\nNeeds an API key with the `contacts:read` scope.","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Audience members","content":{"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Export an audience","tags":["Audiences"],"x-ternwire-scope":"contacts:read"}},"/audiences/{audienceId}/subscriptions":{"post":{"operationId":"requestSubscription","description":"Records the customer's consent attestation and emails a confirmation link. The contact stays pending until the recipient confirms, so a request never subscribes anyone by itself. Until marketing sending is turned on for your organization, or while its daily warm-up allowance is used up, the confirmation email waits (status held) and goes out then.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRequest"}}}},"responses":{"202":{"description":"Subscription requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResult"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Subscribe a contact (double opt-in)","tags":["Audiences"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/audiences/{audienceId}/subscriptions/{contactId}":{"delete":{"operationId":"unsubscribeContact","parameters":[{"name":"audienceId","in":"path","required":true,"description":"The audience's ID.","schema":{"type":"string"}},{"name":"contactId","in":"path","required":true,"description":"The contact's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Subscription state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOptOut"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Unsubscribe a contact","tags":["Audiences"],"description":"Unsubscribes the contact from the audience. An unsubscribed contact is never emailed again from this audience and cannot be resubscribed through the API.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/contacts":{"post":{"operationId":"upsertContact","description":"Creates a contact or updates the attributes of the contact with the same address. It changes no subscription.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpsert"}}}},"responses":{"200":{"description":"Updated contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"201":{"description":"Created contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Create or update a contact","tags":["Contacts"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true},"get":{"operationId":"listContacts","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"audienceId","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Only members of this audience."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["pending","confirmed","unsubscribed"]},"description":"Only items in this state."},{"name":"email","in":"query","required":false,"schema":{"description":"Only contacts whose email address contains this text, ignoring case.","type":"string","minLength":1,"maxLength":320},"description":"Only the contact with this address."}],"responses":{"200":{"description":"Contacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List contacts","tags":["Contacts"],"description":"Lists contacts one page at a time, optionally only the members of one audience or one subscription state.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"}},"/contacts/{contactId}":{"get":{"operationId":"getContact","parameters":[{"name":"contactId","in":"path","required":true,"description":"The contact's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a contact","tags":["Contacts"],"description":"Returns one contact with its attributes and its subscription to each audience.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"},"delete":{"operationId":"deleteContact","description":"Erases the contact's address and attributes. A minimal opt-out marker stays so a later import cannot resubscribe the address without new consent.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"contactId","in":"path","required":true,"description":"The contact's ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Contact deleted","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Delete a contact","tags":["Contacts"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/contact-import-sources":{"get":{"operationId":"listContactImportSources","description":"Lists the platforms whose export files an import reads directly, with how to export from each one.\n\nNeeds an API key with the `contacts:read` scope.","responses":{"200":{"description":"Contact import sources","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportSourceList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List import sources","tags":["Contact imports"],"x-ternwire-scope":"contacts:read"}},"/contact-imports":{"post":{"operationId":"createContactImport","description":"Validates a CSV upload, reading the columns of a known platform's export. Rows the platform marks as unsubscribed, bounced or complained become opt-outs when applied. A pending import asks every other row to confirm; a confirmed import needs per-row consent evidence and waits for operator review before it can be applied. One request holds at most 10,000 rows, so send a larger file as a batch of parts.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportCreate"}}}},"responses":{"201":{"description":"Contact import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Upload a contact import","tags":["Contact imports"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true},"get":{"operationId":"listContactImports","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Contact imports","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List contact imports","tags":["Contact imports"],"description":"Lists contact imports, newest first, with their state and row counts.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"}},"/contact-imports/{importId}":{"get":{"operationId":"getContactImport","parameters":[{"name":"importId","in":"path","required":true,"description":"The contact import's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Contact import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a contact import","tags":["Contact imports"],"description":"Returns one import with its state, row counts and the first row errors. Check it before applying.\n\nNeeds an API key with the `contacts:read` scope.","x-ternwire-scope":"contacts:read"}},"/contact-imports/{importId}/apply":{"post":{"operationId":"applyContactImport","description":"Applies a ready import. The state is applied when it finishes in time, or applying while the worker finishes it. A part of a batch is applied through its batch.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"importId","in":"path","required":true,"description":"The contact import's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Applied import","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImport"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Apply a contact import","tags":["Contact imports"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/contact-import-batches/{batchId}":{"get":{"operationId":"getContactImportBatch","description":"Reads every part of one file as a single import, with totals and the first errors.\n\nNeeds an API key with the `contacts:read` scope.","parameters":[{"name":"batchId","in":"path","required":true,"description":"The import batch's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Contact import batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportBatch"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get an import batch","tags":["Contact imports"],"x-ternwire-scope":"contacts:read"}},"/contact-import-batches/{batchId}/apply":{"post":{"operationId":"applyContactImportBatch","description":"Applies every part of a file once all of them have arrived. The worker finishes a large batch in the background, so read the batch until its state is applied.\n\nNeeds an API key with the `contacts:write` scope. Test keys are refused.","parameters":[{"name":"batchId","in":"path","required":true,"description":"The import batch's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Contact import batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportBatch"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Apply an import batch","tags":["Contact imports"],"x-ternwire-scope":"contacts:write","x-ternwire-live-key-only":true}},"/broadcasts":{"post":{"operationId":"createBroadcast","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastCreate"}}}},"responses":{"201":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Create a broadcast","tags":["Broadcasts"],"description":"Creates a draft newsletter email to an audience from a saved template, optionally narrowed by a segment, with a template per locale or an A/B test. A draft sends nothing: preview it, send a test copy, then call sendBroadcast.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true},"get":{"operationId":"listBroadcasts","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Broadcasts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List broadcasts","tags":["Broadcasts"],"description":"Lists broadcasts, newest first, with their state and progress.\n\nNeeds an API key with the `broadcasts:read` scope.","x-ternwire-scope":"broadcasts:read"}},"/broadcasts/{broadcastId}":{"get":{"operationId":"getBroadcast","description":"Progress counts each accepted copy once by its current outcome. Submitted means the provider took the copy, not that it was delivered.\n\nNeeds an API key with the `broadcasts:read` scope.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get a broadcast","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:read"},"patch":{"operationId":"updateBroadcast","description":"Only a draft can change.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastUpdate"}}}},"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update a draft broadcast","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/send":{"post":{"operationId":"sendBroadcast","description":"Freezes the template and schedules the broadcast, or starts it now without scheduledAt. A schedule needs an explicit offset and a time from now to at most 30 days ahead. A time more than a minute in the past returns schedule_out_of_range.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastSend"}}}},"responses":{"202":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Send or schedule a broadcast","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/preview":{"post":{"operationId":"previewBroadcast","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastPreviewRequest"}}}},"responses":{"200":{"description":"Rendered preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastPreview"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Preview a broadcast","tags":["Broadcasts"],"description":"Renders the broadcast for a sample contact without sending anything, and estimates how many contacts it would reach. Check that estimatedRecipients is within recipientLimit before sending.\n\nNeeds an API key with the `broadcasts:read` scope.","x-ternwire-scope":"broadcasts:read"}},"/broadcasts/{broadcastId}/test":{"post":{"operationId":"sendBroadcastTest","description":"Sends a real, billed copy to each address. Every address must belong to a verified member of the organization.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastTestRequest"}}}},"responses":{"202":{"description":"Accepted test copies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastTestResult"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Send a test copy of a broadcast","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/unschedule":{"post":{"operationId":"unscheduleBroadcast","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Unschedule a broadcast","tags":["Broadcasts"],"description":"Turns a scheduled broadcast back into a draft before it starts.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/pause":{"post":{"operationId":"pauseBroadcast","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Pause a broadcast","tags":["Broadcasts"],"description":"Stops sending further copies of a running broadcast. Copies already accepted are still delivered. Resume it later or cancel it.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/resume":{"post":{"operationId":"resumeBroadcast","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Resume a broadcast","tags":["Broadcasts"],"description":"Continues sending a paused broadcast to the contacts it has not reached yet.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/cancel":{"post":{"operationId":"cancelBroadcast","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Cancel a broadcast","tags":["Broadcasts"],"description":"Ends a scheduled, running or paused broadcast for good. Copies already accepted are still delivered.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/broadcasts/{broadcastId}/recipients":{"get":{"operationId":"listBroadcastRecipients","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Broadcast recipients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastRecipientList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List broadcast recipients","tags":["Broadcasts"],"description":"Lists the contacts a broadcast was sent to, with each copy's delivery state, one page at a time.\n\nNeeds an API key with the `broadcasts:read` scope.","x-ternwire-scope":"broadcasts:read"}},"/broadcasts/{broadcastId}/engagement":{"get":{"operationId":"getBroadcastEngagement","description":"Opens and clicks for a broadcast sent with tracking on. Unique counts are recipients and totals are raw events. Opens are an estimate: Apple Mail Privacy Protection and security scanners load the image or follow links without a person, and clients that block images never report an open.\n\nNeeds an API key with the `broadcasts:read` scope.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcast engagement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastEngagement"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get broadcast opens and clicks","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:read"}},"/broadcasts/{broadcastId}/ab-test":{"get":{"operationId":"getBroadcastAbTest","description":"Per-variant results of an A/B test's test group and the winner once chosen. A rate is unique opens or clicks divided by accepted test copies. Opens are inflated by mail privacy proxies, so clicks are the default winner metric.\n\nNeeds an API key with the `broadcasts:read` scope.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"A/B test results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastAbTestResults"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get A/B test results","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:read"}},"/broadcasts/{broadcastId}/ab-test/winner":{"post":{"operationId":"pickBroadcastAbTestWinner","description":"Chooses the winner while the test is running and sends it to the remainder. Name a variant to pick it, or omit variant to apply the winner metric to the results so far. Repeating the same choice returns the broadcast; a different variant after a winner is chosen is a conflict.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","parameters":[{"name":"broadcastId","in":"path","required":true,"description":"The broadcast's ID.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastAbTestWinner"}}}},"responses":{"200":{"description":"Broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Broadcast"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Pick an A/B test winner","tags":["Broadcasts"],"x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/automations":{"post":{"operationId":"createAutomation","description":"Creates a draft automation: a trigger, an optional entry segment and 1 to 20 steps run in order. It enrolls nobody until activated.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationCreate"}}}},"responses":{"201":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Create an automation","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true},"get":{"operationId":"listAutomations","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"Automations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List automations","tags":["Automations"],"description":"Lists automations, newest first, with their state and trigger.\n\nNeeds an API key with the `automations:read` scope.","x-ternwire-scope":"automations:read"}},"/automations/{automationId}":{"get":{"operationId":"getAutomation","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get an automation","tags":["Automations"],"description":"Returns one automation with its trigger, entry segment and steps.\n\nNeeds an API key with the `automations:read` scope.","x-ternwire-scope":"automations:read"},"patch":{"operationId":"updateAutomation","description":"Edits a draft or paused automation. The audience can change only while it is a draft. Running enrollments keep the version they entered with.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationUpdate"}}}},"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update an automation","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true}},"/automations/{automationId}/activate":{"post":{"operationId":"activateAutomation","description":"Freezes the steps as a new version when they changed and starts enrolling contacts. Activating an active automation returns it unchanged.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Activate an automation","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true}},"/automations/{automationId}/pause":{"post":{"operationId":"pauseAutomation","description":"Stops enrolling contacts and holds every active enrollment at its current step until the automation is activated again.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Pause an automation","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true}},"/automations/{automationId}/archive":{"post":{"operationId":"archiveAutomation","description":"Ends the automation for good. Every active enrollment exits with reason archived. Copies already accepted are still delivered.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Automation"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Archive an automation","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true}},"/automations/{automationId}/stats":{"get":{"operationId":"getAutomationStats","description":"Enrollment counts by state and exit reason, and sends, unique opens and unique clicks for each step of the current version. Opens are an estimate because privacy proxies load images.\n\nNeeds an API key with the `automations:read` scope.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Automation stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationStats"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get automation stats","tags":["Automations"],"x-ternwire-scope":"automations:read"}},"/automations/{automationId}/enrollments":{"get":{"operationId":"listAutomationEnrollments","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["active","completed","exited","failed"]},"description":"Only items in this state."},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Only this contact."}],"responses":{"200":{"description":"Automation enrollments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationEnrollmentList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"List automation enrollments","tags":["Automations"],"description":"Lists the contacts enrolled in the automation, with the step each one is at or why it exited, one page at a time.\n\nNeeds an API key with the `automations:read` scope.","x-ternwire-scope":"automations:read"}},"/automations/{automationId}/test":{"post":{"operationId":"sendAutomationTest","description":"Sends one send_email step as a test copy to up to 5 verified members of the organization. The copy renders with the recipient address as `contact.email` and the sample `event` properties from the request, and enrolls nobody.\n\nNeeds an API key with the `automations:write` scope. Test keys are refused.","parameters":[{"name":"automationId","in":"path","required":true,"description":"The automation's ID.","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationTestRequest"}}}},"responses":{"202":{"description":"Accepted test copies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastTestResult"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Send a test copy of an automation step","tags":["Automations"],"x-ternwire-scope":"automations:write","x-ternwire-live-key-only":true}},"/events":{"post":{"operationId":"createContactEvent","description":"Records a named event for a contact, by id or email, and enrolls the contact in every active automation triggered by that name where the contact is a confirmed member. The Idempotency-Key is required: repeating it with the same body returns the first result and enrolls nobody again, and reusing it with a different body is a conflict. Use one key per real occurrence, such as the order id.\n\nNeeds an API key with the `events:write` scope. Test keys are refused.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose, unique to this action, such as an order ID. Retrying with the same key and body returns the first result without acting again; the same key with a different body returns 409 idempotency_conflict.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEventCreate"}}}},"responses":{"201":{"description":"Recorded event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEventResult"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Record a contact event","tags":["Automations"],"x-ternwire-scope":"events:write","x-ternwire-live-key-only":true}},"/marketing-settings":{"get":{"operationId":"getMarketingSettings","responses":{"200":{"description":"Marketing settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingSettings"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get newsletter settings","tags":["Settings"],"description":"Whether broadcasts and automations record opens and clicks.\n\nNeeds an API key with the `broadcasts:read` scope.","x-ternwire-scope":"broadcasts:read"},"patch":{"operationId":"updateMarketingSettings","description":"Turns open and click tracking on or off for broadcasts sent from now on. Both are off until changed. A broadcast keeps the settings it was sent with. In the EU, tracking may need each recipient's consent.\n\nNeeds an API key with the `broadcasts:write` scope. Test keys are refused.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingSettingsUpdate"}}}},"responses":{"200":{"description":"Marketing settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingSettings"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update newsletter settings","tags":["Settings"],"x-ternwire-scope":"broadcasts:write","x-ternwire-live-key-only":true}},"/tracking-settings":{"get":{"operationId":"getTrackingSettings","description":"Whether transactional email records opens and clicks. Needs the send scope. Broadcasts and automations use the marketing settings instead.","responses":{"200":{"description":"Tracking settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTrackingSettings"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get tracking settings","tags":["Settings"],"x-ternwire-scope":"send"},"patch":{"operationId":"updateTrackingSettings","description":"Turns open and click tracking on or off for transactional email accepted from now on, through the API or SMTP. Both are off until changed. A send can override them with its tracking field. In the EU, tracking may need each recipient's consent.\n\nNeeds an API key with the `send` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTrackingSettingsUpdate"}}}},"responses":{"200":{"description":"Tracking settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTrackingSettings"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Update tracking settings","tags":["Settings"],"x-ternwire-scope":"send"}},"/metrics":{"get":{"operationId":"getDeliveryMetrics","description":"Counts messages and recipients accepted in a window of at most 90 days, with the current queue and billing period usage.\n\nNeeds an API key with the `send` scope.","parameters":[{"name":"from","in":"query","required":false,"schema":{"description":"Window start, defaults to 7 days before `to`","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"The start of the window, in ISO 8601. Defaults to 7 days before to."},{"name":"to","in":"query","required":false,"schema":{"description":"Window end, defaults to now","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"The end of the window, in ISO 8601. Defaults to now."}],"responses":{"200":{"description":"Delivery metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryMetrics"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"summary":"Get delivery metrics","tags":["Metrics"],"x-ternwire-scope":"send"}},"/me":{"get":{"operationId":"getCurrentAccount","tags":["Account"],"summary":"Get the account and the calling key","description":"Returns what a caller needs to know before it acts: the organization, the calling credential (its scopes, mode, domain limit and expiry), the plan, whether live sending is allowed and why not, the recipient quota for the billing period and, on the free plan, for today, whether marketing is on, and the AI template credits. Any valid key can call it, whatever its scopes and mode.","responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentAccount"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":null}},"/api-keys":{"get":{"operationId":"listApiKeys","tags":["API keys"],"summary":"List API keys","description":"Lists the organization's API keys, revoked ones too, newest first, one page at a time. Secrets are never returned. Needs the api_keys:write scope.","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1},"description":"The nextCursor of the previous page. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"description":"How many items a page holds."}],"responses":{"200":{"description":"API keys","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"api_keys:write"},"post":{"operationId":"createApiKey","tags":["API keys"],"summary":"Create an API key","description":"Creates an API key and returns its secret in key, once. Needs the api_keys:write scope. The new key can have no more access than the calling key: only scopes the caller has, test mode if the caller is a test key, only the caller's sending domains if the caller is limited to some, and an expiry no later than the caller's if it expires. Otherwise 403 api_key_privilege_exceeded names the field. A key limited to some domains can't have broadcasts:write or automations:write, and every domain in allowedDomains must already be added.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. A retry with the same key and body answers 409 api_key_secret_unavailable instead of creating a second key, because the secret is shown only once.","schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"201":{"description":"Created API key, with its secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"api_keys:write"}},"/api-keys/{apiKeyId}":{"delete":{"operationId":"revokeApiKey","tags":["API keys"],"summary":"Revoke an API key","description":"Revokes the key at once: requests with it are refused from now on. Needs the api_keys:write scope. A key can revoke itself, and any key with no more access than its own; otherwise 403 api_key_privilege_exceeded. Revoking a revoked key returns it unchanged.","parameters":[{"name":"apiKeyId","in":"path","required":true,"schema":{"type":"string"},"description":"The API key's ID."}],"responses":{"200":{"description":"The revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"api_keys:write"}},"/templates/render":{"post":{"operationId":"renderUnsavedTemplate","tags":["Templates"],"summary":"Render a template that is not saved","description":"Renders a template body, the same fields as createEmailTemplate takes, with values, the way a send would, and returns the subject, html and text. Nothing is saved or sent and no usage is counted. The template is checked as a save checks it (400 invalid_template), and missing values answer 422 template_render_failed with the missing names. Needs the send scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsavedTemplateRenderRequest"}}}},"responses":{"200":{"description":"Rendered template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderedTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"send"}},"/templates/{templateId}/render":{"post":{"operationId":"renderEmailTemplate","tags":["Templates"],"summary":"Render a saved template","description":"Renders a saved template with values, the way a send with templateId would, and returns the subject, html and text. Nothing is sent and no usage is counted. Missing values answer 422 template_render_failed with the missing names. Needs the send scope.","parameters":[{"name":"templateId","in":"path","required":true,"schema":{"type":"string"},"description":"The template's ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateRenderRequest"}}}},"responses":{"200":{"description":"Rendered template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderedTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"send"}},"/templates/generate":{"post":{"operationId":"generateEmailTemplate","tags":["Templates"],"summary":"Write a template with AI","description":"Writes a template draft from an instruction of up to 4000 characters, or changes the draft you send, and returns it with the AI credits charged and remaining. The draft is not saved: create it with createEmailTemplate. Needs a live key with the templates:generate scope and a paid plan (402 paid_plan_required), uses the organization's AI credits (402 ai_credits_exhausted), and is limited to 10 generations a minute (429 rate_limited). A generation can take a minute or more, so allow a long timeout. A failed generation answers ai_refused, ai_output_truncated or ai_invalid_output with settlement, the credits it still used. Use format handlebars for a draft you can save through the API as it is; a react-email draft has only editorContent and needs its html and text before it can be saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiTemplateRequest"}}}},"responses":{"200":{"description":"Generated template draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedTemplate"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"templates:generate","x-ternwire-live-key-only":true}},"/templates/generation-credits":{"get":{"operationId":"getTemplateGenerationCredits","tags":["Templates"],"summary":"Get the AI template credits","description":"Returns the AI credits of the current billing period: included, used, the hard cap and what remains. access is ready when generation can run, upgrade_required on the free plan, billing_inactive when billing needs attention, and unavailable when AI generation is off. Needs the templates:generate or send scope.\n\nNeeds an API key with the `templates:generate` scope.","responses":{"200":{"description":"AI credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiCreditBalance"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"templates:generate"}},"/domains/{domainId}/check":{"post":{"operationId":"checkDomain","tags":["Domains"],"summary":"Check a domain's DNS now","description":"Asks the email provider for the domain's status and looks up its DNS records now, then returns each record with whether it was found and, for one that does not match yet, the value DNS answered. readyToSend is true once the domain can send. Needs a live key with the send scope that is not limited to some domains.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string"},"description":"The sending domain's ID."}],"responses":{"200":{"description":"Domain check","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCheck"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"send","x-ternwire-live-key-only":true}},"/domains/{domainId}/dns-setup":{"get":{"operationId":"getDomainDnsSetup","tags":["Domains"],"summary":"Get one-click DNS setup","description":"Finds the domain's DNS provider and whether it supports one-click setup (Domain Connect). With status ready, actionUrl is the page where a person signs in to the provider and approves the records; give it to the domain's owner. Otherwise add dnsRecords at the provider by hand. Then call checkDomain. Needs a live key with the send scope that is not limited to some domains.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string"},"description":"The sending domain's ID."}],"responses":{"200":{"description":"DNS setup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDnsSetup"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}}}},"default":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}},"headers":{"X-Request-Id":{"description":"Identifies the request. Every error body repeats it as requestId. Quote it when you contact support.","schema":{"type":"string"}},"Retry-After":{"description":"On 429 rate_limited and some 503 answers: the seconds to wait before sending the same request again, with the same idempotency key.","schema":{"type":"integer"}}}}},"x-ternwire-scope":"send","x-ternwire-live-key-only":true}}},"webhooks":{"email.delivered":{"post":{"operationId":"webhook_email_delivered","summary":"email.delivered","description":"The recipient's mail server accepted the email. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.delivered"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.delivered"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.bounced":{"post":{"operationId":"webhook_email_bounced","summary":"email.bounced","description":"The recipient's mail server refused the email. A permanent bounce also blocks the address. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.bounced"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.bounced"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.complained":{"post":{"operationId":"webhook_email_complained","summary":"email.complained","description":"The recipient marked the email as spam. The address is blocked. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.complained"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.complained"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.delayed":{"post":{"operationId":"webhook_email_delayed","summary":"email.delayed","description":"The recipient's mail server asked to try again later. Ternwire keeps trying. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.delayed"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.delayed"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.rejected":{"post":{"operationId":"webhook_email_rejected","summary":"email.rejected","description":"The sending provider refused to send it, usually because of a virus or a blocked kind of attachment. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.rejected"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.rejected"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.submitted":{"post":{"operationId":"webhook_email_submitted","summary":"email.submitted","description":"Ternwire handed the email to the sending provider. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.submitted"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.submitted"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.submission_unknown":{"post":{"operationId":"webhook_email_submission_unknown","summary":"email.submission_unknown","description":"Ternwire couldn't tell whether the provider accepted the email. It may still arrive. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.submission_unknown"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.submission_unknown"},"messageId":{"type":"string","description":"The email's message ID, as returned when it was sent."},"recipientId":{"type":"string","description":"The recipient this event is about."},"address":{"type":"string","description":"The recipient's email address."},"providerTime":{"type":"string","description":"When the email provider reported the event."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"mode":{"description":"Only on events from a test key. Check it before acting on live business data.","type":"string","const":"test"},"purpose":{"description":"Only on newsletter emails.","type":"string","const":"marketing"},"broadcastId":{"description":"On newsletter emails: the broadcast, or null for an automation email.","type":["string","null"]}},"required":["version","type","messageId","recipientId","address","providerTime","possibleDuplicate"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.received":{"post":{"operationId":"webhook_email_received","summary":"email.received","description":"An email arrived at one of your receiving addresses. Fetch its content with getInboundEmail. Its content comes from an outside sender. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.received"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.received"},"inboundEmailId":{"type":"string","description":"Read the email with getInboundEmail."},"receivingAddressId":{"type":"string","description":"The receiving address it arrived at."},"to":{"type":"string","description":"The address it was sent to."},"from":{"type":"string","description":"The sender, as in the From header."},"subject":{"type":"string","description":"The subject line."},"messageId":{"description":"The Message-ID header.","type":["string","null"]},"receivedAt":{"type":"string","description":"When Ternwire received it."},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The size of the raw message."},"verdicts":{"type":"object","properties":{"spam":{"type":"string","enum":["PASS","FAIL","GRAY","NOT_CHECKED"]},"virus":{"type":"string","enum":["PASS","FAIL","GRAY","NOT_CHECKED"]},"spf":{"type":"string","enum":["PASS","FAIL","GRAY","NOT_CHECKED"]},"dkim":{"type":"string","enum":["PASS","FAIL","GRAY","NOT_CHECKED"]},"dmarc":{"type":"string","enum":["PASS","FAIL","GRAY","NOT_CHECKED"]}},"required":["spam","virus","spf","dkim","dmarc"],"additionalProperties":false,"description":"Each check's result. For spam and virus, FAIL means one was found. GRAY is not conclusive."}},"required":["version","type","inboundEmailId","receivingAddressId","to","from","subject","messageId","receivedAt","sizeBytes","verdicts"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.opened":{"post":{"operationId":"webhook_email_opened","summary":"email.opened","description":"The email was opened for the first time. Privacy proxies and security scanners can cause opens without a person. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.opened"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.opened"},"messageId":{"type":"string","description":"The email's message ID."},"occurredAt":{"type":"string","description":"When the open or click happened."}},"required":["version","type","messageId","occurredAt"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"email.clicked":{"post":{"operationId":"webhook_email_clicked","summary":"email.clicked","description":"A link in the email was clicked for the first time. Each link sends its own event. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"email.clicked"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"email.clicked"},"messageId":{"type":"string","description":"The email's message ID."},"occurredAt":{"type":"string","description":"When the open or click happened."},"url":{"type":"string","description":"The link that was clicked."}},"required":["version","type","messageId","occurredAt","url"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"contact.subscription_confirmed":{"post":{"operationId":"webhook_contact_subscription_confirmed","summary":"contact.subscription_confirmed","description":"A contact confirmed their subscription to an audience. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"contact.subscription_confirmed"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"contact.subscription_confirmed"},"contactId":{"type":"string","description":"The contact whose subscription changed."},"audienceId":{"type":"string","description":"The audience the subscription belongs to."},"source":{"type":"string","description":"What caused the change, such as confirmation, unsubscribe_link, list_unsubscribe or api."}},"required":["version","type","contactId","audienceId","source"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"contact.unsubscribed":{"post":{"operationId":"webhook_contact_unsubscribed","summary":"contact.unsubscribed","description":"A contact unsubscribed from an audience. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"contact.unsubscribed"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"contact.unsubscribed"},"contactId":{"type":"string","description":"The contact whose subscription changed."},"audienceId":{"type":"string","description":"The audience the subscription belongs to."},"source":{"type":"string","description":"What caused the change, such as confirmation, unsubscribe_link, list_unsubscribe or api."}},"required":["version","type","contactId","audienceId","source"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"broadcast.started":{"post":{"operationId":"webhook_broadcast_started","summary":"broadcast.started","description":"A broadcast started sending. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"broadcast.started"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"broadcast.started"},"broadcastId":{"type":"string","description":"The broadcast."},"audienceId":{"type":"string","description":"The audience the broadcast is sent to."},"reason":{"description":"Why the broadcast changed state, when there is a reason.","type":["string","null"]}},"required":["version","type","broadcastId","audienceId","reason"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"broadcast.paused":{"post":{"operationId":"webhook_broadcast_paused","summary":"broadcast.paused","description":"A broadcast was paused. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"broadcast.paused"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"broadcast.paused"},"broadcastId":{"type":"string","description":"The broadcast."},"audienceId":{"type":"string","description":"The audience the broadcast is sent to."},"reason":{"description":"Why the broadcast changed state, when there is a reason.","type":["string","null"]}},"required":["version","type","broadcastId","audienceId","reason"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"broadcast.completed":{"post":{"operationId":"webhook_broadcast_completed","summary":"broadcast.completed","description":"A broadcast finished sending. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"broadcast.completed"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"broadcast.completed"},"broadcastId":{"type":"string","description":"The broadcast."},"audienceId":{"type":"string","description":"The audience the broadcast is sent to."},"reason":{"description":"Why the broadcast changed state, when there is a reason.","type":["string","null"]}},"required":["version","type","broadcastId","audienceId","reason"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"broadcast.canceled":{"post":{"operationId":"webhook_broadcast_canceled","summary":"broadcast.canceled","description":"A broadcast was canceled. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"broadcast.canceled"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"broadcast.canceled"},"broadcastId":{"type":"string","description":"The broadcast."},"audienceId":{"type":"string","description":"The audience the broadcast is sent to."},"reason":{"description":"Why the broadcast changed state, when there is a reason.","type":["string","null"]}},"required":["version","type","broadcastId","audienceId","reason"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}},"broadcast.failed":{"post":{"operationId":"webhook_broadcast_failed","summary":"broadcast.failed","description":"A broadcast stopped because of an error. The request carries a ternwire-signature header: verify it against the raw body before parsing (see https://ternwire.com/docs/webhooks). Answer with a 2xx status within 10 seconds, or Ternwire retries.","tags":["Webhooks"],"parameters":[{"name":"ternwire-signature","in":"header","required":true,"description":"t=TIMESTAMP,v1=HEX_DIGEST: HMAC-SHA256 with the endpoint's signing secret over the timestamp, a period and the raw body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"The event's ID. The same event can arrive more than once, so record it under this ID and skip one you already handled."},"type":{"type":"string","const":"broadcast.failed"},"createdAt":{"type":"string","description":"When Ternwire created the event."},"data":{"type":"object","properties":{"version":{"type":"number","const":1,"description":"The payload version."},"type":{"type":"string","const":"broadcast.failed"},"broadcastId":{"type":"string","description":"The broadcast."},"audienceId":{"type":"string","description":"The audience the broadcast is sent to."},"reason":{"description":"Why the broadcast changed state, when there is a reason.","type":["string","null"]}},"required":["version","type","broadcastId","audienceId","reason"],"additionalProperties":{}}},"required":["id","type","createdAt","data"],"additionalProperties":{}}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event."}}}}},"components":{"schemas":{"CursorPage":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false},"CursorQuery":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"cursor":{"type":"string","minLength":1,"description":"The nextCursor of the previous page. Leave it out for the first page."},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100,"description":"How many items a page holds."}},"required":["limit"],"additionalProperties":false},"EmailSubmission":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","subject"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","templateId","values"],"additionalProperties":false}]},"EmailRequest":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."},"tracking":{"type":"object","properties":{"opens":{"description":"Record opens of this email. Left out, the organization's setting applies.","type":"boolean"},"clicks":{"description":"Record clicks on this email's links. Left out, the organization's setting applies.","type":"boolean"}},"additionalProperties":false,"description":"Turns open or click tracking on or off for this email only. Tracking changes only the HTML part."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","subject"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"tracking":{"type":"object","properties":{"opens":{"description":"Record opens of this email. Left out, the organization's setting applies.","type":"boolean"},"clicks":{"description":"Record clicks on this email's links. Left out, the organization's setting applies.","type":"boolean"}},"additionalProperties":false,"description":"Turns open or click tracking on or off for this email only. Tracking changes only the HTML part."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","templateId","values"],"additionalProperties":false}]},"EmailTrackingOverride":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"opens":{"description":"Record opens of this email. Left out, the organization's setting applies.","type":"boolean"},"clicks":{"description":"Record clicks on this email's links. Left out, the organization's setting applies.","type":"boolean"}},"additionalProperties":false,"description":"Turns open or click tracking on or off for this email only. Tracking changes only the HTML part."},"ResolvedEmailSubmission":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","subject"],"additionalProperties":false},"EmailTemplateValues":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{}},"EmailTemplateCreate":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"format":{"type":"string","const":"handlebars","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["name","subject"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","const":"react-email","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"editorContent":{"type":"string","minLength":1,"maxLength":5000000,"description":"The dashboard editor's document. Leave it out unless you edit in the editor."},"html":{"type":"string","minLength":1,"maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["format","name","subject","editorContent","html","text"],"additionalProperties":false}]},"EmailTemplate":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"format":{"type":"string","const":"handlebars","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."},"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it last changed, in ISO 8601."}},"required":["format","name","subject","id","createdAt","updatedAt"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","const":"react-email","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"editorContent":{"type":"string","minLength":1,"maxLength":5000000,"description":"The dashboard editor's document. Leave it out unless you edit in the editor."},"html":{"type":"string","minLength":1,"maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."},"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it last changed, in ISO 8601."}},"required":["format","name","subject","editorContent","html","text","id","createdAt","updatedAt"],"additionalProperties":false}]},"EmailTemplateSummary":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"format":{"type":"string","enum":["handlebars","react-email"],"description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it last changed, in ISO 8601."}},"required":["format","name","subject","id","createdAt","updatedAt"],"additionalProperties":false},"EmailTemplateList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string","enum":["handlebars","react-email"],"description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it last changed, in ISO 8601."}},"required":["format","name","subject","id","createdAt","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"MessageRecipient":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"address":{"type":["string","null"],"description":"Email address."},"kind":{"type":"string","enum":["to","cc","bcc"],"description":"Whether the recipient was in to, cc or bcc."},"state":{"type":"string","enum":["queued","submitted","delayed","delivered","bounced","complained","rejected","suppressed"],"description":"The recipient's delivery state."},"lastEventAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the latest delivery event for this recipient was recorded"},"reason":{"description":"Why the recipient did not get the email, when known: the reason of its email.rejected event, or the bounce type and subtype, such as Permanent/NoEmail","type":["string","null"]},"bounce":{"anyOf":[{"type":"object","properties":{"type":{"type":["string","null"],"description":"Permanent or Transient, as the mail server reported it."},"subtype":{"type":["string","null"],"description":"The bounce subtype, such as NoEmail."},"smtpStatus":{"type":["string","null"],"description":"The SMTP status code, such as 5.1.1."},"diagnostic":{"type":["string","null"],"description":"The mail server's own message."}},"required":["type","subtype","smtpStatus","diagnostic"],"additionalProperties":false},{"type":"null"}],"description":"The bounce the recipient's mail server reported, or null."}},"required":["id","address","kind","state","lastEventAt","reason","bounce"],"additionalProperties":false},"MessageTracking":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"opens":{"type":"boolean","description":"Whether opens are tracked."},"clicks":{"type":"boolean","description":"Whether clicks are tracked."}},"required":["opens","clicks"],"additionalProperties":false,"description":"Whether this email records opens and clicks. Both are false for an email without an HTML part."},"MessageEngagement":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"opens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Times the email was opened, at most 100."},"clicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Clicks on the email's links, at most 100."},"firstOpenedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email was first opened, or null."},"lastOpenedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email was last opened, or null."},"lastClickedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When a link was last clicked, or null."},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"A URL."},"clicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Whether clicks are tracked."}},"required":["url","clicks"],"additionalProperties":false},"description":"Each clicked link with its clicks, most clicked first."}},"required":["opens","clicks","firstOpenedAt","lastOpenedAt","lastClickedAt","links"],"additionalProperties":false,"description":"Opens and clicks are counted for the whole email, because all its recipients get the same copy. Treat them as estimates: privacy features and security scanners load images and follow links without a person."},"MessageStatus":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"state":{"type":"string","enum":["accepted","queued","held","submitting","submitted","submission_unknown","failed"],"description":"The email's overall state, from its recipients' states."},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire accepted the email, in ISO 8601."},"recipients":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are waiting to be sent."},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many were delivered."},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many failed."}},"required":["queued","delivered","failed"],"additionalProperties":false,"description":"How many recipients are queued, delivered and failed."},"recipientDetails":{"default":[],"description":"Each recipient with its own delivery state, to first, then cc and bcc","maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"address":{"type":["string","null"],"description":"Email address."},"kind":{"type":"string","enum":["to","cc","bcc"],"description":"Which kind it is."},"state":{"type":"string","enum":["queued","submitted","delayed","delivered","bounced","complained","rejected","suppressed"],"description":"The email's overall state, from its recipients' states."},"lastEventAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the latest delivery event for this recipient was recorded"},"reason":{"description":"Why the recipient did not get the email, when known: the reason of its email.rejected event, or the bounce type and subtype, such as Permanent/NoEmail","type":["string","null"]},"bounce":{"anyOf":[{"type":"object","properties":{"type":{"type":["string","null"],"description":"Which type it is."},"subtype":{"type":["string","null"],"description":"The bounce subtype, such as NoEmail."},"smtpStatus":{"type":["string","null"],"description":"The SMTP status code, such as 5.1.1."},"diagnostic":{"type":["string","null"],"description":"The mail server's own message."}},"required":["type","subtype","smtpStatus","diagnostic"],"additionalProperties":false},{"type":"null"}],"description":"The bounce the recipient's mail server reported, or null."}},"required":["id","address","kind","state","lastEventAt","reason","bounce"],"additionalProperties":false}},"possibleDuplicate":{"default":false,"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"holdReason":{"default":null,"type":["string","null"],"description":"Why the email is held back instead of sent, or null."},"heldAt":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it was held, or null."},"heldForSeconds":{"default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"How long it has been held, or null."},"tracking":{"default":{"opens":false,"clicks":false},"type":"object","properties":{"opens":{"type":"boolean","description":"Whether opens are tracked."},"clicks":{"type":"boolean","description":"Whether clicks are tracked."}},"required":["opens","clicks"],"additionalProperties":false,"description":"Whether this email records opens and clicks. Both are false for an email without an HTML part."},"engagement":{"default":{"opens":0,"clicks":0,"firstOpenedAt":null,"lastOpenedAt":null,"lastClickedAt":null,"links":[]},"type":"object","properties":{"opens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Times the email was opened, at most 100."},"clicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Clicks on the email's links, at most 100."},"firstOpenedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email was first opened, or null."},"lastOpenedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email was last opened, or null."},"lastClickedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When a link was last clicked, or null."},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"A URL."},"clicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Whether clicks are tracked."}},"required":["url","clicks"],"additionalProperties":false},"description":"Each clicked link with its clicks, most clicked first."}},"required":["opens","clicks","firstOpenedAt","lastOpenedAt","lastClickedAt","links"],"additionalProperties":false,"description":"Opens and clicks are counted for the whole email, because all its recipients get the same copy. Treat them as estimates: privacy features and security scanners load images and follow links without a person."}},"required":["id","state","acceptedAt","recipients","recipientDetails","possibleDuplicate","holdReason","heldAt","heldForSeconds","tracking","engagement"],"additionalProperties":false},"MessageSummary":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"state":{"type":"string","enum":["accepted","queued","held","submitting","submitted","submission_unknown","failed"],"description":"The email's overall state."},"subject":{"type":"string","description":"The subject line."},"fromAddress":{"type":"string","description":"The sender address."},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire accepted the email, in ISO 8601."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"recipientCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many recipients the email has."}},"required":["id","state","subject","fromAddress","acceptedAt","possibleDuplicate","recipientCount"],"additionalProperties":false},"MessageList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"state":{"type":"string","enum":["accepted","queued","held","submitting","submitted","submission_unknown","failed"],"description":"The email's overall state."},"subject":{"type":"string","description":"The subject line."},"fromAddress":{"type":"string","description":"The sender address."},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire accepted the email, in ISO 8601."},"possibleDuplicate":{"type":"boolean","description":"True when the email may have been sent twice, after a submission whose outcome was unclear."},"recipientCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many recipients the email has."}},"required":["id","state","subject","fromAddress","acceptedAt","possibleDuplicate","recipientCount"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"AcceptedMessage":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The message ID. Read the email with getMessage."},"state":{"type":"string","const":"queued","description":"The state right after acceptance."},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire accepted the email, in ISO 8601."}},"required":["id","state","acceptedAt"],"additionalProperties":false},"AttachmentUploadSlotRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255,"description":"The file name."},"contentType":{"type":"string","maxLength":255,"pattern":"^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$","description":"The MIME type, such as application/pdf."},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":15000000,"description":"The file size in bytes."},"contentHash":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"The SHA-256 of the file, in lowercase hex."}},"required":["filename","contentType","bytes","contentHash"],"additionalProperties":false},"AttachmentUploadSlot":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"uploadUrl":{"type":"string","format":"uri","description":"PUT the file bytes to this URL."},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The upload URL stops working at this time."},"requiredHeaders":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Send these headers with the PUT, exactly as given."}},"required":["id","uploadUrl","expiresAt","requiredHeaders"],"additionalProperties":false},"AttachmentStatus":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"state":{"type":"string","enum":["uploaded","scanning","clean","rejected","expired"],"description":"The scan state. Use the attachment once it is clean."},"rejectionReason":{"type":["string","null"],"description":"Why the file was refused, or null."}},"required":["id","state","rejectionReason"],"additionalProperties":false},"SendingDomainCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":253,"description":"The domain to send from, such as mail.example.com."},"purpose":{"default":"transactional","type":"string","enum":["transactional","marketing"],"description":"transactional for app email, marketing for newsletters."}},"required":["domain","purpose"],"additionalProperties":false},"DnsRecord":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","mail_from_mx","mail_from_spf","dmarc"],"description":"What the record is for."},"type":{"type":"string","enum":["CNAME","TXT","MX"],"description":"The DNS record type."},"name":{"type":"string","description":"The record name (host)."},"value":{"type":"string","description":"The record value."},"status":{"type":"string","enum":["pending","valid","invalid"],"description":"Whether the record was found with the right value."},"blocking":{"type":"boolean","description":"Whether the domain cannot be verified until this record is right."}},"required":["kind","type","name","value","status","blocking"],"additionalProperties":false},"SendingDomainStatus":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"domain":{"type":"string","description":"The domain name."},"purpose":{"type":"string","enum":["transactional","marketing"],"description":"transactional for app email, marketing for newsletters."},"state":{"type":"string","enum":["pending","verified","active","failed","disabled","deleting"],"description":"The verification state. Email can be sent once it is verified."},"verificationFailure":{"type":["string","null"],"description":"Why verification failed, or null."},"providerCheckedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email provider last checked the domain, or null."},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","mail_from_mx","mail_from_spf","dmarc"],"description":"Which kind it is."},"type":{"type":"string","enum":["CNAME","TXT","MX"],"description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"The value the attribute is compared with."},"status":{"type":"string","enum":["pending","valid","invalid"],"description":"The current status."},"blocking":{"type":"boolean","description":"Whether the domain cannot be verified until this record is right."}},"required":["kind","type","name","value","status","blocking"],"additionalProperties":false},"description":"The DNS records to publish at the domain's DNS provider."}},"required":["id","domain","purpose","state","verificationFailure","providerCheckedAt","dnsRecords"],"additionalProperties":false},"SendingDomainList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"domain":{"type":"string","description":"The domain name."},"purpose":{"type":"string","enum":["transactional","marketing"],"description":"transactional for app email, marketing for newsletters."},"state":{"type":"string","enum":["pending","verified","active","failed","disabled","deleting"],"description":"The verification state."},"verificationFailure":{"type":["string","null"],"description":"Why verification failed, or null."},"providerCheckedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email provider last checked the domain, or null."},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","mail_from_mx","mail_from_spf","dmarc"],"description":"Which kind it is."},"type":{"type":"string","enum":["CNAME","TXT","MX"],"description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"The value the attribute is compared with."},"status":{"type":"string","enum":["pending","valid","invalid"],"description":"The current status."},"blocking":{"type":"boolean","description":"Whether the domain cannot be verified until this record is right."}},"required":["kind","type","name","value","status","blocking"],"additionalProperties":false},"description":"The DNS records to publish."}},"required":["id","domain","purpose","state","verificationFailure","providerCheckedAt","dnsRecords"],"additionalProperties":false},"description":"The items on this page."}},"required":["data"],"additionalProperties":false},"SendingDomainDeletionStatus":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"type":"string","enum":["deleted","pending"],"description":"How far the removal has got."}},"required":["status"],"additionalProperties":false},"ReceivingAddressCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"localPart":{"type":"string","minLength":1,"maxLength":64,"description":"The part before the @, such as support. Letters, digits and . _ + -, stored in lower case."},"forwardTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"Where clean email is forwarded: the verified email address of a member of the organization. Null stores the email without forwarding it."}},"required":["localPart"],"additionalProperties":false},"ReceivingAddressUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"forwardTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"Where clean email is forwarded: the verified email address of a member of the organization. Null stores the email without forwarding it."}},"required":["forwardTo"],"additionalProperties":false},"ReceivingMxRecord":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"type":{"type":"string","const":"MX","description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"Priority and host, as most DNS providers take them."},"status":{"type":"string","enum":["pending","valid","invalid","conflict"],"description":"conflict: another mail server is preferred over or equal to Ternwire, so it gets some or all of the mail."},"observedValue":{"type":["string","null"],"description":"What the DNS lookup found, or null."},"checkedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it was last checked, in ISO 8601, or null before the first check."}},"required":["type","name","value","status","observedValue","checkedAt"],"additionalProperties":false},"ReceivingAddress":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"domainId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a sending domain."},"address":{"type":"string","description":"Email address."},"localPart":{"type":"string","description":"The part before the @."},"forwardTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"Where clean email is forwarded: the verified email address of a member of the organization. Null stores the email without forwarding it."},"receiving":{"type":"boolean","description":"Whether email to this address is accepted now."},"withinPlan":{"type":"boolean","description":"False for an address beyond the plan's number per domain, as after a downgrade. It takes no email until the plan allows it again."},"mxRecord":{"type":"object","properties":{"type":{"type":"string","const":"MX","description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"Priority and host, as most DNS providers take them."},"status":{"type":"string","enum":["pending","valid","invalid","conflict"],"description":"conflict: another mail server is preferred over or equal to Ternwire, so it gets some or all of the mail."},"observedValue":{"type":["string","null"],"description":"What the lookup found, or null."},"checkedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it was last checked, in ISO 8601, or null before the first check."}},"required":["type","name","value","status","observedValue","checkedAt"],"additionalProperties":false,"description":"The MX record that sends the domain's mail to Ternwire."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","domainId","address","localPart","forwardTo","receiving","withinPlan","mxRecord","createdAt"],"additionalProperties":false},"ReceivingAddressList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"domainId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a sending domain."},"address":{"type":"string","description":"Email address."},"localPart":{"type":"string","description":"The part before the @."},"forwardTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"Where clean email is forwarded: the verified email address of a member of the organization. Null stores the email without forwarding it."},"receiving":{"type":"boolean","description":"Whether email to this address is accepted now."},"withinPlan":{"type":"boolean","description":"False for an address beyond the plan's number per domain, as after a downgrade. It takes no email until the plan allows it again."},"mxRecord":{"type":"object","properties":{"type":{"type":"string","const":"MX","description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"Priority and host, as most DNS providers take them."},"status":{"type":"string","enum":["pending","valid","invalid","conflict"],"description":"conflict: another mail server is preferred over or equal to Ternwire, so it gets some or all of the mail."},"observedValue":{"type":["string","null"],"description":"What the lookup found, or null."},"checkedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it was last checked, in ISO 8601, or null before the first check."}},"required":["type","name","value","status","observedValue","checkedAt"],"additionalProperties":false,"description":"The MX record that sends the domain's mail to Ternwire."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","domainId","address","localPart","forwardTo","receiving","withinPlan","mxRecord","createdAt"],"additionalProperties":false},"description":"The items on this page."},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Addresses this domain may have on the plan."}},"required":["data","limit"],"additionalProperties":false},"InboundEmailVerdicts":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"spam":{"type":"string","description":"PASS, or FAIL when spam was found. GRAY is not conclusive."},"virus":{"type":"string","description":"PASS, or FAIL when a virus was found."},"spf":{"type":"string","description":"The SPF check result."},"dkim":{"type":"string","description":"The DKIM check result."},"dmarc":{"type":"string","description":"The DMARC check result."}},"required":["spam","virus","spf","dkim","dmarc"],"additionalProperties":false},"InboundEmailForward":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"forwarded","description":"The current state."},"messageId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an email, as returned when it was sent."}},"required":["state","messageId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"not_forwarded","description":"The current state."},"reason":{"type":"string","enum":["spam","authentication_failed","loop","target_unverified","domain_cannot_send","rejected"],"description":"spam: the spam check did not pass. authentication_failed: the sender's DMARC check failed. loop: the email is a copy Ternwire forwarded. target_unverified: the forwarding address is no longer a member's verified email. domain_cannot_send: the receiving domain is not active for transactional sending, which the forwarded copy needs. rejected: the copy could not be sent, for example because the quota ran out or the address is blocked."}},"required":["state","reason"],"additionalProperties":false}]},{"type":"null"}],"description":"Null when the address forwards nowhere."},"InboundEmailSummary":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"receivingAddressId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of a receiving address."},"to":{"type":"string","description":"The address it was sent to."},"from":{"type":"string","description":"The From header, or the sender address when it had none."},"subject":{"type":["string","null"],"description":"The subject line."},"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire received it, in ISO 8601."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Size in bytes."},"verdicts":{"type":"object","properties":{"spam":{"type":"string","description":"PASS, or FAIL when spam was found. GRAY is not conclusive."},"virus":{"type":"string","description":"PASS, or FAIL when a virus was found."},"spf":{"type":"string","description":"The SPF check result."},"dkim":{"type":"string","description":"The DKIM check result."},"dmarc":{"type":"string","description":"The DMARC check result."}},"required":["spam","virus","spf","dkim","dmarc"],"additionalProperties":false,"description":"Spam, virus, SPF, DKIM and DMARC results."},"forward":{"anyOf":[{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"forwarded","description":"The current state."},"messageId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The Message-ID header."}},"required":["state","messageId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"not_forwarded","description":"The current state."},"reason":{"type":"string","enum":["spam","authentication_failed","loop","target_unverified","domain_cannot_send","rejected"],"description":"spam: the spam check did not pass. authentication_failed: the sender's DMARC check failed. loop: the email is a copy Ternwire forwarded. target_unverified: the forwarding address is no longer a member's verified email. domain_cannot_send: the receiving domain is not active for transactional sending, which the forwarded copy needs. rejected: the copy could not be sent, for example because the quota ran out or the address is blocked."}},"required":["state","reason"],"additionalProperties":false}]},{"type":"null"}],"description":"Null when the address forwards nowhere."}},"required":["id","receivingAddressId","to","from","subject","receivedAt","sizeBytes","verdicts","forward"],"additionalProperties":false},"InboundEmailAttachment":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"filename":{"type":["string","null"],"description":"The file name."},"contentType":{"type":"string","description":"The MIME type, such as application/pdf."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Size in bytes."},"contentId":{"type":["string","null"],"description":"The Content-ID of an inline attachment, or null."}},"required":["filename","contentType","sizeBytes","contentId"],"additionalProperties":false},"InboundEmail":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"receivingAddressId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of a receiving address."},"to":{"type":"string","description":"The address it was sent to."},"from":{"type":"string","description":"The From header, or the sender address when it had none."},"subject":{"type":["string","null"],"description":"The subject line."},"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire received it, in ISO 8601."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Size in bytes."},"verdicts":{"type":"object","properties":{"spam":{"type":"string","description":"PASS, or FAIL when spam was found. GRAY is not conclusive."},"virus":{"type":"string","description":"PASS, or FAIL when a virus was found."},"spf":{"type":"string","description":"The SPF check result."},"dkim":{"type":"string","description":"The DKIM check result."},"dmarc":{"type":"string","description":"The DMARC check result."}},"required":["spam","virus","spf","dkim","dmarc"],"additionalProperties":false,"description":"Spam, virus, SPF, DKIM and DMARC results."},"forward":{"anyOf":[{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"forwarded","description":"The current state."},"messageId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The Message-ID header."}},"required":["state","messageId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"not_forwarded","description":"The current state."},"reason":{"type":"string","enum":["spam","authentication_failed","loop","target_unverified","domain_cannot_send","rejected"],"description":"spam: the spam check did not pass. authentication_failed: the sender's DMARC check failed. loop: the email is a copy Ternwire forwarded. target_unverified: the forwarding address is no longer a member's verified email. domain_cannot_send: the receiving domain is not active for transactional sending, which the forwarded copy needs. rejected: the copy could not be sent, for example because the quota ran out or the address is blocked."}},"required":["state","reason"],"additionalProperties":false}]},{"type":"null"}],"description":"Null when the address forwards nowhere."},"toHeader":{"type":"array","items":{"type":"string"},"description":"The To header as it arrived."},"cc":{"type":"array","items":{"type":"string"},"description":"Carbon-copy recipient addresses."},"replyTo":{"type":"array","items":{"type":"string"},"description":"The address replies go to, when it is not the sender."},"messageId":{"type":["string","null"],"description":"The Message-ID header."},"inReplyTo":{"type":["string","null"],"description":"The In-Reply-To header, or null."},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The Date header, or null."},"text":{"type":["string","null"],"description":"The plain-text body."},"html":{"description":"The sender's HTML as received. It is not sanitized.","type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":["string","null"],"description":"The file name."},"contentType":{"type":"string","description":"The MIME type, such as application/pdf."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Size in bytes."},"contentId":{"type":["string","null"],"description":"The Content-ID of an inline attachment, or null."}},"required":["filename","contentType","sizeBytes","contentId"],"additionalProperties":false},"description":"The attachments, without their content."},"contentAvailable":{"type":"boolean","description":"False once retention removed the content."}},"required":["id","receivingAddressId","to","from","subject","receivedAt","sizeBytes","verdicts","forward","toHeader","cc","replyTo","messageId","inReplyTo","sentAt","text","html","attachments","contentAvailable"],"additionalProperties":false},"InboundEmailList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"receivingAddressId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of a receiving address."},"to":{"type":"string","description":"The address it was sent to."},"from":{"type":"string","description":"The From header, or the sender address when it had none."},"subject":{"type":["string","null"],"description":"The subject line."},"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire received it, in ISO 8601."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Size in bytes."},"verdicts":{"type":"object","properties":{"spam":{"type":"string","description":"PASS, or FAIL when spam was found. GRAY is not conclusive."},"virus":{"type":"string","description":"PASS, or FAIL when a virus was found."},"spf":{"type":"string","description":"The SPF check result."},"dkim":{"type":"string","description":"The DKIM check result."},"dmarc":{"type":"string","description":"The DMARC check result."}},"required":["spam","virus","spf","dkim","dmarc"],"additionalProperties":false,"description":"Spam, virus, SPF, DKIM and DMARC results."},"forward":{"anyOf":[{"oneOf":[{"type":"object","properties":{"state":{"type":"string","const":"forwarded","description":"The current state."},"messageId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The Message-ID header."}},"required":["state","messageId"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","const":"not_forwarded","description":"The current state."},"reason":{"type":"string","enum":["spam","authentication_failed","loop","target_unverified","domain_cannot_send","rejected"],"description":"spam: the spam check did not pass. authentication_failed: the sender's DMARC check failed. loop: the email is a copy Ternwire forwarded. target_unverified: the forwarding address is no longer a member's verified email. domain_cannot_send: the receiving domain is not active for transactional sending, which the forwarded copy needs. rejected: the copy could not be sent, for example because the quota ran out or the address is blocked."}},"required":["state","reason"],"additionalProperties":false}]},{"type":"null"}],"description":"Null when the address forwards nowhere."}},"required":["id","receivingAddressId","to","from","subject","receivedAt","sizeBytes","verdicts","forward"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"Suppression":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"address":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address."},"reason":{"type":"string","enum":["bounce","complaint","manual"],"description":"Why, when known."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it expires, in ISO 8601."}},"required":["id","address","reason","createdAt","expiresAt"],"additionalProperties":false},"SuppressionList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"address":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address."},"reason":{"type":"string","enum":["bounce","complaint","manual"],"description":"Why, when known."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it expires, in ISO 8601."}},"required":["id","address","reason","createdAt","expiresAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"SuppressionCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"address":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address to stop emailing"}},"required":["address"],"additionalProperties":false},"WebhookEndpointCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"url":{"type":"string","format":"uri","description":"A URL."},"eventTypes":{"minItems":1,"type":"array","items":{"type":"string","enum":["email.delivered","email.bounced","email.complained","email.delayed","email.rejected","email.submitted","email.submission_unknown","email.received","email.opened","email.clicked","contact.subscription_confirmed","contact.unsubscribed","broadcast.started","broadcast.paused","broadcast.completed","broadcast.canceled","broadcast.failed"]},"description":"The webhook event types the endpoint receives."}},"required":["url","eventTypes"],"additionalProperties":false},"WebhookEndpoint":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"url":{"type":"string","format":"uri","description":"A URL."},"eventTypes":{"type":"array","items":{"type":"string"},"description":"The webhook event types the endpoint receives."},"enabled":{"type":"boolean","description":"Whether it is on."},"deliveriesPausedAt":{"description":"When deliveries paused because every recent one failed. Null while they flow. Listed endpoints only.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","url","eventTypes","enabled"],"additionalProperties":false},"WebhookEndpointCreated":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"url":{"type":"string","format":"uri","description":"A URL."},"eventTypes":{"type":"array","items":{"type":"string"},"description":"The webhook event types the endpoint receives."},"enabled":{"type":"boolean","description":"Whether it is on."},"deliveriesPausedAt":{"description":"When deliveries paused because every recent one failed. Null while they flow. Listed endpoints only.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"signingSecret":{"type":"string","minLength":1,"description":"Returned once when the endpoint is created"}},"required":["id","url","eventTypes","enabled","signingSecret"],"additionalProperties":false},"WebhookEndpointList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"url":{"type":"string","format":"uri","description":"A URL."},"eventTypes":{"type":"array","items":{"type":"string"},"description":"The webhook event types the endpoint receives."},"enabled":{"type":"boolean","description":"Whether it is on."},"deliveriesPausedAt":{"description":"When deliveries paused because every recent one failed. Null while they flow. Listed endpoints only.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","url","eventTypes","enabled"],"additionalProperties":false},"description":"The items on this page."}},"required":["data"],"additionalProperties":false},"WebhookEndpointUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"enabled":{"type":"boolean","description":"Disabled endpoints receive no new events"}},"required":["enabled"],"additionalProperties":false},"WebhookAttempt":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"deliveryId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"The ID of the delivery to one endpoint."},"endpointId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a webhook endpoint."},"eventId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of the event being delivered."},"attempt":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Which try this is, from 1."},"state":{"type":"string","enum":["pending","delivering","delivered","exhausted"],"description":"The current state."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status your endpoint answered with, or null when it never answered."},"finalErrorClass":{"anyOf":[{"type":"string","enum":["success","redirect","timeout","tls","network","response_too_large","unsafe_destination","http_response","retry","exhausted"]},{"type":"null"}],"description":"How the delivery ended, or null while it is still being tried."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"attemptNumber":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Which try this was, from 1."},"kind":{"type":"string","enum":["initial","retry","replay"],"description":"Which kind it is."},"errorClass":{"type":"string","enum":["success","redirect","timeout","tls","network","response_too_large","unsafe_destination","http_response","retry","exhausted"],"description":"What happened: success, or the kind of failure."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status your endpoint answered with, or null when it never answered."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","attemptNumber","kind","errorClass","responseStatus","createdAt"],"additionalProperties":false},"description":"Every try, oldest first."}},"required":["id","deliveryId","endpointId","eventId","attempt","state","responseStatus","finalErrorClass","createdAt","history"],"additionalProperties":false},"WebhookAttemptLog":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"attemptNumber":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Which try this was, from 1."},"kind":{"type":"string","enum":["initial","retry","replay"],"description":"initial, retry, or replay when you replayed it."},"errorClass":{"type":"string","enum":["success","redirect","timeout","tls","network","response_too_large","unsafe_destination","http_response","retry","exhausted"],"description":"What happened: success, or the kind of failure."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status your endpoint answered with, or null when it never answered."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","attemptNumber","kind","errorClass","responseStatus","createdAt"],"additionalProperties":false},"WebhookAttemptSummary":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"deliveryId":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}],"description":"The ID of the delivery to one endpoint."},"endpointId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a webhook endpoint."},"eventId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of the event being delivered."},"attempt":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Which try this is, from 1."},"state":{"type":"string","enum":["pending","delivering","delivered","exhausted"],"description":"The current state."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status your endpoint answered with, or null when it never answered."},"finalErrorClass":{"anyOf":[{"type":"string","enum":["success","redirect","timeout","tls","network","response_too_large","unsafe_destination","http_response","retry","exhausted"]},{"type":"null"}],"description":"How the delivery ended, or null while it is still being tried."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"eventType":{"type":"string","description":"The webhook event type."}},"required":["id","deliveryId","endpointId","eventId","attempt","state","responseStatus","finalErrorClass","createdAt","eventType"],"additionalProperties":false},"WebhookAttemptList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"deliveryId":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}],"description":"The ID of the delivery to one endpoint."},"endpointId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a webhook endpoint."},"eventId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of the event being delivered."},"attempt":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Which try this is, from 1."},"state":{"type":"string","enum":["pending","delivering","delivered","exhausted"],"description":"The current state."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status your endpoint answered with, or null when it never answered."},"finalErrorClass":{"anyOf":[{"type":"string","enum":["success","redirect","timeout","tls","network","response_too_large","unsafe_destination","http_response","retry","exhausted"]},{"type":"null"}],"description":"How the delivery ended, or null while it is still being tried."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"eventType":{"type":"string","description":"The webhook event type."}},"required":["id","deliveryId","endpointId","eventId","attempt","state","responseStatus","finalErrorClass","createdAt","eventType"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"WebhookSigningSecretRotated":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"signingSecret":{"type":"string","minLength":1,"description":"Returned once when the signing secret is rotated"}},"required":["signingSecret"],"additionalProperties":false},"DeliveryMetrics":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The start of the window, in ISO 8601."},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The end of the window, in ISO 8601."},"messages":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The total."},"byState":{"type":"object","propertyNames":{"type":"string","enum":["accepted","queued","held","submitting","submitted","submission_unknown","failed"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["accepted","queued","held","submitting","submitted","submission_unknown","failed"],"description":"The count for each state."}},"required":["total","byState"],"additionalProperties":false,"description":"Emails accepted in the window, by state."},"recipients":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The total."},"byState":{"type":"object","propertyNames":{"type":"string","enum":["queued","submitted","delayed","delivered","bounced","complained","rejected","suppressed"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["queued","submitted","delayed","delivered","bounced","complained","rejected","suppressed"],"description":"The count for each state."}},"required":["total","byState"],"additionalProperties":false,"description":"Recipients of emails accepted in the window, by state."},"rates":{"type":"object","properties":{"delivered":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Share of recipients in the window currently in this state, null when there are none"},"bounced":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Share of recipients in the window currently in this state, null when there are none"},"complained":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Share of recipients in the window currently in this state, null when there are none"}},"required":["delivered","bounced","complained"],"additionalProperties":false,"description":"Shares of recipients in the window that are delivered, bounced and complained."},"queue":{"type":"object","properties":{"queued":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are waiting to be sent."},"held":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Emails held back, for example while sending is paused for review."},"oldestQueuedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the oldest waiting email was accepted, or null."}},"required":["queued","held","oldestQueuedAt"],"additionalProperties":false,"description":"Email waiting to be sent now."},"usage":{"anyOf":[{"type":"object","properties":{"planCode":{"type":"string","description":"The plan the workspace is on."},"includedRecipients":{"type":"string","pattern":"^\\d+$","description":"Recipients the plan includes this period, as a decimal string."},"usedRecipients":{"type":"string","pattern":"^\\d+$","description":"Recipients used this period, as a decimal string."},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The start of the billing period."},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The end of the billing period."}},"required":["planCode","includedRecipients","usedRecipients","periodStart","periodEnd"],"additionalProperties":false},{"type":"null"}],"description":"Recipient usage in the current billing period"}},"required":["from","to","messages","recipients","rates","queue","usage"],"additionalProperties":false},"MarketingEmailSubmission":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."},"purpose":{"type":"string","const":"marketing","description":"transactional for app email, marketing for newsletters."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","subject","purpose","audienceId","contactId"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","maxLength":800,"description":"Sender address on a verified domain, optionally with a display name: `Acme Shop <hello@acme.com>`. Quote a name that has commas or other punctuation."},"to":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"cc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Carbon-copy recipient addresses."},"bcc":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Blind-copy recipient addresses."},"replyTo":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The address replies go to, when it is not the sender."},"attachmentIds":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Attachments uploaded with createAttachmentUploadSlot whose scan came back clean."},"tags":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"additionalProperties":{"type":"string","maxLength":256},"description":"Your own labels for the email, such as `{ \"order\": \"123\" }`. Keys are up to 64 letters, digits, _ or -, values up to 256 characters."},"listManagement":{"type":"object","properties":{"unsubscribe":{"type":"string","format":"uri","description":"The URL or mailto: address that unsubscribes the recipient."},"unsubscribePost":{"type":"string","const":"List-Unsubscribe=One-Click","description":"Set to List-Unsubscribe=One-Click to allow one-click unsubscribe. Needs an https unsubscribe URL."}},"required":["unsubscribe"],"additionalProperties":false,"description":"Adds List-Unsubscribe headers. Use it for any email a recipient can opt out of."},"headers":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^X-[A-Za-z0-9-]+$"},"additionalProperties":{"type":"string","maxLength":998},"description":"Custom headers, such as `{ \"X-Order-Id\": \"123\" }`. Names must start with X-."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"purpose":{"type":"string","const":"marketing","description":"transactional for app email, marketing for newsletters."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."}},"required":["from","to","cc","bcc","attachmentIds","tags","headers","templateId","values","purpose","audienceId","contactId"],"additionalProperties":false}]},"Locale":{"$schema":"http://json-schema.org/draft-07/schema#","type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},"LocalizedTemplates":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"Audience":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."},"description":{"type":["string","null"],"description":"A longer description you choose."},"confirmationFrom":{"type":"string","description":"The sender of the double opt-in confirmation email."},"defaultLocale":{"type":["string","null"],"description":"The locale used for contacts that have none."},"privacyPolicyUrl":{"type":["string","null"],"description":"Your privacy policy, linked from the confirmation email and sign-up page."},"signupToken":{"description":"The secret part of the hosted sign-up page's address. Null while the page is off.","type":["string","null"]},"archivedAt":{"type":["string","null"],"description":"When it was archived, in ISO 8601, or null."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","name","description","confirmationFrom","defaultLocale","privacyPolicyUrl","signupToken","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"AudienceCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"A longer description you choose."},"confirmationFrom":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The sender of the double opt-in confirmation email."},"defaultLocale":{"anyOf":[{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},{"type":"null"}],"description":"The locale used for contacts that have none."},"privacyPolicyUrl":{"description":"Your privacy policy. The hosted sign-up page links to it.","anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]}},"required":["name","confirmationFrom"],"additionalProperties":false},"AudienceUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"A longer description you choose."},"confirmationFrom":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The sender of the double opt-in confirmation email."},"defaultLocale":{"anyOf":[{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},{"type":"null"}],"description":"The locale used for contacts that have none."},"privacyPolicyUrl":{"description":"Your privacy policy. The hosted sign-up page links to it.","anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]}},"additionalProperties":false},"AudienceList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."},"description":{"type":["string","null"],"description":"A longer description you choose."},"confirmationFrom":{"type":"string","description":"The sender of the double opt-in confirmation email."},"defaultLocale":{"type":["string","null"],"description":"The locale used for contacts that have none."},"privacyPolicyUrl":{"type":["string","null"],"description":"Your privacy policy, linked from the confirmation email and sign-up page."},"signupToken":{"description":"The secret part of the hosted sign-up page's address. Null while the page is off.","type":["string","null"]},"archivedAt":{"type":["string","null"],"description":"When it was archived, in ISO 8601, or null."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","name","description","confirmationFrom","defaultLocale","privacyPolicyUrl","signupToken","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"Contact":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"email":{"type":"string","description":"Email address."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"locale":{"type":["string","null"],"description":"A locale such as en or pt-BR."},"subscriptions":{"type":"array","items":{"type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["pending","confirmed","unsubscribed"],"description":"The current state."},"consent":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["api","dashboard","import","confirmation","unsubscribe_link","list_unsubscribe","signup_page"],"description":"Where it came from."},"collectedVia":{"type":"string","description":"Your description of where the consent was given, such as signup form."},"capturedAt":{"type":"string","description":"When the consent was given, in ISO 8601."},"policyVersion":{"type":["string","null"],"description":"The version of your privacy or consent policy the person agreed to."},"evidenceReference":{"type":["string","null"],"description":"Your own reference to the consent record, such as a form submission ID."},"recordedAt":{"type":"string","description":"When Ternwire recorded the consent."}},"required":["source","collectedVia","capturedAt","policyVersion","evidenceReference","recordedAt"],"additionalProperties":false},{"type":"null"}],"description":"How the contact's consent was given."},"confirmation":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["queued","sent","expired","failed"],"description":"The current state."},"at":{"type":"string","description":"When it happened."}},"required":["state","at"],"additionalProperties":false},{"type":"null"}],"description":"When and how the contact confirmed the subscription, or null."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["audienceId","state","consent","confirmation","updatedAt"],"additionalProperties":false},"description":"The contact's subscription to each audience."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","email","attributes","locale","subscriptions","createdAt","updatedAt"],"additionalProperties":false},"ContactUpsert":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address."},"attributes":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"locale":{"anyOf":[{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},{"type":"null"}],"description":"A locale such as en or pt-BR."}},"required":["email"],"additionalProperties":false},"ContactList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"email":{"type":"string","description":"Email address."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"locale":{"type":["string","null"],"description":"A locale such as en or pt-BR."},"subscriptions":{"type":"array","items":{"type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["pending","confirmed","unsubscribed"],"description":"The current state."},"consent":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["api","dashboard","import","confirmation","unsubscribe_link","list_unsubscribe","signup_page"],"description":"Where it came from."},"collectedVia":{"type":"string","description":"Your description of where the consent was given, such as signup form."},"capturedAt":{"type":"string","description":"When the consent was given, in ISO 8601."},"policyVersion":{"type":["string","null"],"description":"The version of your privacy or consent policy the person agreed to."},"evidenceReference":{"type":["string","null"],"description":"Your own reference to the consent record, such as a form submission ID."},"recordedAt":{"type":"string","description":"When Ternwire recorded the consent."}},"required":["source","collectedVia","capturedAt","policyVersion","evidenceReference","recordedAt"],"additionalProperties":false},{"type":"null"}],"description":"How the contact's consent was given."},"confirmation":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["queued","sent","expired","failed"],"description":"The current state."},"at":{"type":"string","description":"When it happened."}},"required":["state","at"],"additionalProperties":false},{"type":"null"}],"description":"When and how the contact confirmed the subscription, or null."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["audienceId","state","consent","confirmation","updatedAt"],"additionalProperties":false},"description":"The contact's subscription to each audience."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","email","attributes","locale","subscriptions","createdAt","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"SubscriptionRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address."},"attributes":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"locale":{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},"consent":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":100,"description":"Where it came from."},"policyVersion":{"description":"The privacy policy they agreed to: a version name or a link.","type":"string","minLength":1,"maxLength":500},"wording":{"type":"string","maxLength":2000,"description":"The consent wording the person agreed to."},"evidenceReference":{"type":"string","maxLength":500,"description":"Your own reference to the consent record, such as a form submission ID."},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the consent was given, in ISO 8601."}},"required":["source"],"additionalProperties":false,"description":"How the contact's consent was given."}},"required":["email","consent"],"additionalProperties":false},"SubscriptionResult":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["pending","confirmed","unsubscribed"],"description":"The current state."},"confirmation":{"type":"object","properties":{"status":{"type":"string","enum":["sent","throttled","not_required","failed","held"],"description":"The current status."},"messageId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of an email, as returned when it was sent."},"reason":{"type":"string","description":"Why, when known."}},"required":["status","messageId"],"additionalProperties":false,"description":"When and how the contact confirmed the subscription, or null."}},"required":["contactId","audienceId","state","confirmation"],"additionalProperties":false},"SubscriptionOptOut":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["pending","confirmed","unsubscribed"],"description":"The current state."}},"required":["contactId","audienceId","state"],"additionalProperties":false},"ContactImportCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"consent":{"type":"string","enum":["pending","confirmed"],"description":"How the contact's consent was given."},"policyVersion":{"type":"string","minLength":1,"maxLength":100,"description":"The version of your privacy or consent policy the person agreed to."},"wording":{"type":"string","maxLength":2000,"description":"The consent wording the person agreed to."},"source":{"description":"The platform the file came from. Omit it to detect the platform from the file's columns.","type":"string","enum":["generic","mailchimp","sendgrid","klaviyo","brevo","kit","beehiiv","activecampaign","constant_contact","mailerlite","hubspot","substack","ghost","aweber","getresponse","campaign_monitor","omnisend"]},"status":{"description":"The status of every row, for a file that holds one status and has no column saying so, such as a suppression export. A row keeps the stricter of this and its own status.","type":"string","enum":["subscribed","pending","unsubscribed","bounced","complained"]},"columns":{"description":"Renames the file's columns before they are read, from the header as written to a name such as email, first_name or a field of your own. An empty name leaves the column out. Example: {\"E-Mail Adresse\": \"email\", \"Notes\": \"\"}.","type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"type":"string","maxLength":64}},"consentCapturedAt":{"description":"For a confirmed import: when people in this file opted in, used for every row without its own consent_captured_at.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"consentSource":{"description":"For a confirmed import: how people in this file opted in, such as In my shop, used for every row without its own consent_source.","type":"string","minLength":1,"maxLength":100},"csv":{"type":"string","minLength":1,"maxLength":5242880,"description":"The CSV file content, at most 10,000 rows."},"batch":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,63}$","description":"A value of your choosing, shared by every part."},"part":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"This part's position, counting from 1."},"last":{"type":"boolean","description":"True on the final part, which closes the batch."},"fingerprint":{"description":"A digest of the whole file. A key is bound to what it first carried, so sending this on every part makes a retry with a different file conflict at its first part.","type":"string","maxLength":128}},"required":["id","part","last"],"additionalProperties":false,"description":"Links this import to the other parts of one file. The CLI and MCP upload commands split a file and set this for you."},"fileName":{"description":"The uploaded file's name, shown in the list of imports.","type":"string","minLength":1,"maxLength":255}},"required":["audienceId","consent","csv"],"additionalProperties":false},"ContactImport":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["awaiting_review","ready","applying","applied","rejected","expired"],"description":"The current state."},"consent":{"type":"string","enum":["pending","confirmed"],"description":"How the contact's consent was given."},"source":{"type":"string","description":"Where it came from."},"summary":{"anyOf":[{"type":"object","properties":{"statuses":{"type":"object","propertyNames":{"type":"string","enum":["subscribed","pending","unsubscribed","bounced","complained"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["subscribed","pending","unsubscribed","bounced","complained"],"description":"How many rows have each subscription status."},"errors":{"type":"object","propertyNames":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The first row errors, by row number and code."},"columns":{"type":"object","properties":{"email":{"type":"string","description":"Email address."},"status":{"type":"array","items":{"type":"string"},"description":"The current status."},"consentCapturedAt":{"type":"array","items":{"type":"string"},"description":"The column that holds when consent was given."},"locale":{"type":["string","null"],"description":"A locale such as en or pt-BR."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"ignored":{"type":"array","items":{"type":"string"},"description":"Columns the import did not read."}},"required":["email","status","consentCapturedAt","locale","attributes","ignored"],"additionalProperties":false,"description":"Which file columns were read and which were ignored."}},"required":["statuses","errors","columns"],"additionalProperties":false},{"type":"null"}],"description":"Totals by row status, and which columns were read."},"batchId":{"type":["string","null"],"description":"The ID of the batch this part belongs to, when the file was sent in parts."},"batchPart":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The position of this part in its batch, from 1."},"fileName":{"type":["string","null"],"description":"The uploaded file's name."},"rowCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows in the file."},"validCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows that can be applied."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The row number in the file, from 1."},"code":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The error code."}},"required":["row","code"],"additionalProperties":false},"description":"The first row errors, by row number and code."},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"type":"null"}],"description":"What applying did, as counts by outcome."},"expiresAt":{"type":"string","description":"When it expires, in ISO 8601."},"reviewedAt":{"type":["string","null"],"description":"When Ternwire reviewed it, in ISO 8601, or null."},"appliedAt":{"type":["string","null"],"description":"When it was applied, in ISO 8601, or null before then."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."}},"required":["id","audienceId","state","consent","source","summary","batchId","batchPart","fileName","rowCount","validCount","errors","result","expiresAt","reviewedAt","appliedAt","createdAt"],"additionalProperties":false},"ContactImportBatch":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,63}$","description":"Unique ID of this object."},"importId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The first part. Operators review a batch by this import."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["uploading","awaiting_review","ready","applying","applied","rejected","expired"],"description":"The current state."},"consent":{"type":"string","enum":["pending","confirmed"],"description":"How the contact's consent was given."},"source":{"type":"string","description":"Where it came from."},"summary":{"anyOf":[{"type":"object","properties":{"statuses":{"type":"object","propertyNames":{"type":"string","enum":["subscribed","pending","unsubscribed","bounced","complained"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["subscribed","pending","unsubscribed","bounced","complained"],"description":"How many rows have each subscription status."},"errors":{"type":"object","propertyNames":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The first row errors, by row number and code."},"columns":{"type":"object","properties":{"email":{"type":"string","description":"Email address."},"status":{"type":"array","items":{"type":"string"},"description":"The current status."},"consentCapturedAt":{"type":"array","items":{"type":"string"},"description":"The column that holds when consent was given."},"locale":{"type":["string","null"],"description":"A locale such as en or pt-BR."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"ignored":{"type":"array","items":{"type":"string"},"description":"Columns the import did not read."}},"required":["email","status","consentCapturedAt","locale","attributes","ignored"],"additionalProperties":false,"description":"Which file columns were read and which were ignored."}},"required":["statuses","errors","columns"],"additionalProperties":false},{"type":"null"}],"description":"Totals by row status, and which columns were read."},"fileName":{"type":["string","null"],"description":"The uploaded file's name."},"parts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Each part of the file."},"rowCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows in the file."},"validCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows that can be applied."},"appliedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Parts applied so far."},"errorCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Row errors across all parts."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The row number in the file, from 1."},"code":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The error code."}},"required":["row","code"],"additionalProperties":false},"description":"The first 100 errors, with row numbers from the whole file. summary.errors counts all of them."},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"type":"null"}],"description":"What applying did, as counts by outcome."},"expiresAt":{"type":"string","description":"When it expires, in ISO 8601."},"reviewedAt":{"type":["string","null"],"description":"When Ternwire reviewed it, in ISO 8601, or null."},"appliedAt":{"type":["string","null"],"description":"When it was applied, in ISO 8601, or null before then."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."}},"required":["id","importId","audienceId","state","consent","source","summary","fileName","parts","rowCount","validCount","appliedCount","errorCount","errors","result","expiresAt","reviewedAt","appliedAt","createdAt"],"additionalProperties":false},"ContactImportList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"state":{"type":"string","enum":["awaiting_review","ready","applying","applied","rejected","expired"],"description":"The current state."},"consent":{"type":"string","enum":["pending","confirmed"],"description":"How the contact's consent was given."},"source":{"type":"string","description":"Where it came from."},"summary":{"anyOf":[{"type":"object","properties":{"statuses":{"type":"object","propertyNames":{"type":"string","enum":["subscribed","pending","unsubscribed","bounced","complained"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["subscribed","pending","unsubscribed","bounced","complained"],"description":"How many rows have each subscription status."},"errors":{"type":"object","propertyNames":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The first row errors, by row number and code."},"columns":{"type":"object","properties":{"email":{"type":"string","description":"Email address."},"status":{"type":"array","items":{"type":"string"},"description":"The current status."},"consentCapturedAt":{"type":"array","items":{"type":"string"},"description":"The column that holds when consent was given."},"locale":{"type":["string","null"],"description":"A locale such as en or pt-BR."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom contact data, such as `{ \"plan\": \"pro\" }`. Templates read it as contact.<name>, and segments filter on it."},"ignored":{"type":"array","items":{"type":"string"},"description":"Columns the import did not read."}},"required":["email","status","consentCapturedAt","locale","attributes","ignored"],"additionalProperties":false,"description":"Which file columns were read and which were ignored."}},"required":["statuses","errors","columns"],"additionalProperties":false},{"type":"null"}],"description":"Totals by row status, and which columns were read."},"batchId":{"type":["string","null"],"description":"The ID of the batch this part belongs to, when the file was sent in parts."},"batchPart":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The position of this part in its batch, from 1."},"fileName":{"type":["string","null"],"description":"The uploaded file's name."},"rowCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows in the file."},"validCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows that can be applied."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The row number in the file, from 1."},"code":{"type":"string","enum":["invalid_email","duplicate_email","missing_consent_evidence","invalid_consent_captured_at","invalid_attribute","invalid_locale","unknown_subscription_status"],"description":"The error code."}},"required":["row","code"],"additionalProperties":false},"description":"The first row errors, by row number and code."},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"type":"null"}],"description":"What applying did, as counts by outcome."},"expiresAt":{"type":"string","description":"When it expires, in ISO 8601."},"reviewedAt":{"type":["string","null"],"description":"When Ternwire reviewed it, in ISO 8601, or null."},"appliedAt":{"type":["string","null"],"description":"When it was applied, in ISO 8601, or null before then."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."}},"required":["id","audienceId","state","consent","source","summary","batchId","batchPart","fileName","rowCount","validCount","errors","result","expiresAt","reviewedAt","appliedAt","createdAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"ContactImportSourceList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."},"howToExport":{"type":"string","description":"How to export the list from that platform."},"detected":{"type":"boolean","description":"Whether a file is recognized from its columns, or source has to name this one"},"columnsVerified":{"type":"boolean","description":"False when the column names come from documentation rather than a real export, so check summary.columns before applying"},"consentColumns":{"type":"array","items":{"type":"string"},"description":"Columns read as the opt-in time. consent_captured_at works for every source, and is the only one for a platform that exports none."},"statusColumns":{"type":"array","items":{"type":"string"},"description":"The columns that hold each row's subscription status."}},"required":["id","name","howToExport","detected","columnsVerified","consentColumns","statusColumns"],"additionalProperties":false},"description":"The items on this page."}},"required":["data"],"additionalProperties":false},"Segment":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},"Broadcast":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","description":"A name you choose."},"from":{"type":"string","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"type":["string","null"],"description":"The address replies go to, when it is not the sender."},"templateId":{"type":"string","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"A template per contact locale, such as `{ \"de\": \"template_...\" }`. A contact without a match gets templateId."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"abTest":{"anyOf":[{"type":"object","properties":{"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"A name you choose."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]}},"required":["name"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"testPercent":{"default":20,"description":"Share of recipients in the test group, split evenly across variants.","type":"integer","minimum":10,"maximum":50},"winnerMetric":{"default":"clicks","description":"Unique clicks by default. Opens are inflated by mail privacy proxies that load every image.","type":"string","enum":["clicks","opens"]},"waitMinutes":{"default":240,"description":"How long after the last test copy is handed out the winner is chosen and the remainder sent.","type":"integer","minimum":30,"maximum":4320}},"required":["variants","testPercent","winnerMetric","waitMinutes"],"additionalProperties":false},{"type":"null"}],"description":"An A/B test of 2 to 4 variants. Leave it out to send one version."},"tracking":{"anyOf":[{"type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."}},"required":["openTracking","clickTracking"],"additionalProperties":false},{"type":"null"}],"description":"Open and click tracking."},"maxRecipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The most contacts this broadcast may send to. It stops sending at this number."},"state":{"type":"string","enum":["draft","scheduled","preparing","testing","sending","paused","canceling","completed","canceled","expired","failed"],"description":"The current state."},"pauseReason":{"anyOf":[{"type":"string","enum":["customer","quota_exceeded"]},{"type":"null"}],"description":"Why it is paused: customer when you paused it, quota_exceeded when the plan's limit stopped it."},"failureReason":{"type":["string","null"],"description":"Why it failed, or null."},"scheduledAt":{"type":["string","null"],"description":"When it is scheduled to start, in ISO 8601 with an offset."},"startedAt":{"type":["string","null"],"description":"When it started, in ISO 8601, or null before then."},"expiresAt":{"type":["string","null"],"description":"When it expires, in ISO 8601."},"finishedAt":{"type":["string","null"],"description":"When it finished, in ISO 8601, or null before then."},"testSentAt":{"description":"When the latest test copy of this broadcast was sent, or null before any.","type":["string","null"]},"progress":{"type":"object","properties":{"snapshotCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many contacts the broadcast was frozen with, or null before it started."},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies still to send."},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies accepted for delivery."},"skipped":{"type":"object","propertyNames":{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"],"description":"Contacts skipped, by reason."},"outcomes":{"type":"object","propertyNames":{"type":"string","enum":["queued","submitted","delivered","bounced","complained","failed","unknown"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["queued","submitted","delivered","bounced","complained","failed","unknown"],"description":"Accepted copies by their current delivery outcome."}},"required":["snapshotCount","pending","accepted","skipped","outcomes"],"additionalProperties":false,"description":"How far sending has got."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","audienceId","name","from","replyTo","templateId","localizedTemplates","values","segment","abTest","tracking","maxRecipients","state","pauseReason","failureReason","scheduledAt","startedAt","expiresAt","finishedAt","testSentAt","progress","createdAt","updatedAt"],"additionalProperties":false},"BroadcastCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"from":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"The address replies go to, when it is not the sender."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"abTest":{"anyOf":[{"type":"object","properties":{"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"A name you choose."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]}},"required":["name"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"testPercent":{"default":20,"description":"Share of recipients in the test group, split evenly across variants.","type":"integer","minimum":10,"maximum":50},"winnerMetric":{"default":"clicks","description":"Unique clicks by default. Opens are inflated by mail privacy proxies that load every image.","type":"string","enum":["clicks","opens"]},"waitMinutes":{"default":240,"description":"How long after the last test copy is handed out the winner is chosen and the remainder sent.","type":"integer","minimum":30,"maximum":4320}},"required":["variants","testPercent","winnerMetric","waitMinutes"],"additionalProperties":false},{"type":"null"}],"description":"An A/B test of 2 to 4 variants. Leave it out to send one version."},"maxRecipients":{"type":"integer","minimum":1,"maximum":100000,"description":"The most contacts this broadcast may send to. It stops sending at this number."}},"required":["audienceId","name","from","templateId","localizedTemplates","values","maxRecipients"],"additionalProperties":false},"BroadcastUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"from":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"The address replies go to, when it is not the sender."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"abTest":{"anyOf":[{"type":"object","properties":{"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"A name you choose."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]}},"required":["name"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"testPercent":{"default":20,"description":"Share of recipients in the test group, split evenly across variants.","type":"integer","minimum":10,"maximum":50},"winnerMetric":{"default":"clicks","description":"Unique clicks by default. Opens are inflated by mail privacy proxies that load every image.","type":"string","enum":["clicks","opens"]},"waitMinutes":{"default":240,"description":"How long after the last test copy is handed out the winner is chosen and the remainder sent.","type":"integer","minimum":30,"maximum":4320}},"required":["variants","testPercent","winnerMetric","waitMinutes"],"additionalProperties":false},{"type":"null"}],"description":"An A/B test of 2 to 4 variants. Leave it out to send one version."},"maxRecipients":{"type":"integer","minimum":1,"maximum":100000,"description":"The most contacts this broadcast may send to. It stops sending at this number."}},"additionalProperties":false},"BroadcastList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","description":"A name you choose."},"from":{"type":"string","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"type":["string","null"],"description":"The address replies go to, when it is not the sender."},"templateId":{"type":"string","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"A template per contact locale, such as `{ \"de\": \"template_...\" }`. A contact without a match gets templateId."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"abTest":{"anyOf":[{"type":"object","properties":{"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"A name you choose."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]}},"required":["name"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"testPercent":{"default":20,"description":"Share of recipients in the test group, split evenly across variants.","type":"integer","minimum":10,"maximum":50},"winnerMetric":{"default":"clicks","description":"Unique clicks by default. Opens are inflated by mail privacy proxies that load every image.","type":"string","enum":["clicks","opens"]},"waitMinutes":{"default":240,"description":"How long after the last test copy is handed out the winner is chosen and the remainder sent.","type":"integer","minimum":30,"maximum":4320}},"required":["variants","testPercent","winnerMetric","waitMinutes"],"additionalProperties":false},{"type":"null"}],"description":"An A/B test of 2 to 4 variants. Leave it out to send one version."},"tracking":{"anyOf":[{"type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."}},"required":["openTracking","clickTracking"],"additionalProperties":false},{"type":"null"}],"description":"Open and click tracking."},"maxRecipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The most contacts this broadcast may send to. It stops sending at this number."},"state":{"type":"string","enum":["draft","scheduled","preparing","testing","sending","paused","canceling","completed","canceled","expired","failed"],"description":"The current state."},"pauseReason":{"anyOf":[{"type":"string","enum":["customer","quota_exceeded"]},{"type":"null"}],"description":"Why it is paused: customer when you paused it, quota_exceeded when the plan's limit stopped it."},"failureReason":{"type":["string","null"],"description":"Why it failed, or null."},"scheduledAt":{"type":["string","null"],"description":"When it is scheduled to start, in ISO 8601 with an offset."},"startedAt":{"type":["string","null"],"description":"When it started, in ISO 8601, or null before then."},"expiresAt":{"type":["string","null"],"description":"When it expires, in ISO 8601."},"finishedAt":{"type":["string","null"],"description":"When it finished, in ISO 8601, or null before then."},"testSentAt":{"description":"When the latest test copy of this broadcast was sent, or null before any.","type":["string","null"]},"progress":{"type":"object","properties":{"snapshotCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many contacts the broadcast was frozen with, or null before it started."},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies still to send."},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Copies accepted for delivery."},"skipped":{"type":"object","propertyNames":{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"],"description":"Contacts skipped, by reason."},"outcomes":{"type":"object","propertyNames":{"type":"string","enum":["queued","submitted","delivered","bounced","complained","failed","unknown"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["queued","submitted","delivered","bounced","complained","failed","unknown"],"description":"Accepted copies by their current delivery outcome."}},"required":["snapshotCount","pending","accepted","skipped","outcomes"],"additionalProperties":false,"description":"How far sending has got."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","audienceId","name","from","replyTo","templateId","localizedTemplates","values","segment","abTest","tracking","maxRecipients","state","pauseReason","failureReason","scheduledAt","startedAt","expiresAt","finishedAt","testSentAt","progress","createdAt","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"BroadcastSend":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"scheduledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When it is scheduled to start, in ISO 8601 with an offset."}},"additionalProperties":false},"BroadcastPreviewRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"locale":{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},"variant":{"type":"string","minLength":1,"maxLength":50,"description":"The A/B test variant, or null."}},"additionalProperties":false},"BroadcastPreview":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"variant":{"type":["string","null"],"description":"The A/B test variant that rendered, or null."},"locale":{"type":["string","null"],"description":"The localized template that rendered, or null for templateId."},"subject":{"type":"string","description":"The subject line."},"html":{"type":["string","null"],"description":"The HTML body."},"text":{"type":["string","null"],"description":"The plain-text body."},"estimatedRecipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many contacts the broadcast would reach now."},"recipientLimit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The most contacts a broadcast sent now can reach."}},"required":["variant","locale","subject","html","text","estimatedRecipients","recipientLimit"],"additionalProperties":false},"BroadcastTestRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"locale":{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},"variant":{"type":"string","minLength":1,"maxLength":50,"description":"The A/B test variant, or null."}},"required":["to"],"additionalProperties":false},"BroadcastTestResult":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"state":{"type":"string","const":"queued","description":"The current state."},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When Ternwire accepted the email, in ISO 8601."}},"required":["id","state","acceptedAt"],"additionalProperties":false},"description":"The items on this page."}},"required":["data"],"additionalProperties":false},"BroadcastRecipient":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"email":{"type":["string","null"],"description":"Email address."},"state":{"type":"string","enum":["pending","accepted","skipped"],"description":"pending, accepted, or skipped."},"skipReason":{"anyOf":[{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"]},{"type":"null"}],"description":"Why the contact was skipped, or null."},"messageId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of an email, as returned when it was sent."},"opened":{"type":"boolean","description":"Whether an open was recorded."},"clicked":{"type":"boolean","description":"Whether a click was recorded."},"variant":{"type":["string","null"],"description":"The A/B test variant, or null."},"phase":{"anyOf":[{"type":"string","enum":["test","remainder"]},{"type":"null"}],"description":"test for an A/B test copy, remainder for the winner sent to the rest, or null."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","contactId","email","state","skipReason","messageId","opened","clicked","variant","phase","updatedAt"],"additionalProperties":false},"BroadcastRecipientList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"email":{"type":["string","null"],"description":"Email address."},"state":{"type":"string","enum":["pending","accepted","skipped"],"description":"pending, accepted, or skipped."},"skipReason":{"anyOf":[{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","canceled","expired","recipient_cap_reached","quota_exceeded","rejected"]},{"type":"null"}],"description":"Why the contact was skipped, or null."},"messageId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},{"type":"null"}],"description":"The ID of an email, as returned when it was sent."},"opened":{"type":"boolean","description":"Whether an open was recorded."},"clicked":{"type":"boolean","description":"Whether a click was recorded."},"variant":{"type":["string","null"],"description":"The A/B test variant, or null."},"phase":{"anyOf":[{"type":"string","enum":["test","remainder"]},{"type":"null"}],"description":"test for an A/B test copy, remainder for the winner sent to the rest, or null."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","contactId","email","state","skipReason","messageId","opened","clicked","variant","phase","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"BroadcastEngagement":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"broadcastId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a broadcast."},"tracking":{"anyOf":[{"type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."}},"required":["openTracking","clickTracking"],"additionalProperties":false},{"type":"null"}],"description":"Open and click tracking."},"uniqueOpens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who opened at least once. An estimate: privacy proxies and scanners open email too."},"totalOpens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every open recorded, including repeats."},"uniqueClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who clicked at least once."},"totalClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every click recorded, including repeats."},"unsubscribed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who have unsubscribed from the audience since the broadcast started."},"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"A URL."},"uniqueClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who clicked at least once."},"totalClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every click recorded, including repeats."}},"required":["url","uniqueClicks","totalClicks"],"additionalProperties":false},"description":"Clicks per link."}},"required":["broadcastId","tracking","uniqueOpens","totalOpens","uniqueClicks","totalClicks","unsubscribed","links"],"additionalProperties":false},"AbTest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"variants":{"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"A name you choose."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]}},"required":["name"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"testPercent":{"default":20,"description":"Share of recipients in the test group, split evenly across variants.","type":"integer","minimum":10,"maximum":50},"winnerMetric":{"default":"clicks","description":"Unique clicks by default. Opens are inflated by mail privacy proxies that load every image.","type":"string","enum":["clicks","opens"]},"waitMinutes":{"default":240,"description":"How long after the last test copy is handed out the winner is chosen and the remainder sent.","type":"integer","minimum":30,"maximum":4320}},"required":["variants","testPercent","winnerMetric","waitMinutes"],"additionalProperties":false},"BroadcastAbTestResults":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"broadcastId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a broadcast."},"testPercent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The share of the audience in the test group."},"winnerMetric":{"type":"string","enum":["clicks","opens"],"description":"opens or clicks."},"waitMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How long after the test copies the winner is chosen."},"decideAt":{"description":"When the winner is chosen. Null until every test copy has been handed out.","type":["string","null"]},"winner":{"anyOf":[{"type":"object","properties":{"variant":{"type":"string","description":"The A/B test variant, or null."},"chosenBy":{"type":"string","enum":["auto","early","manual"],"description":"auto when the wait ended, early when the metric was applied before then, manual when a variant was named."},"decidedAt":{"type":"string","description":"When the winner was chosen, or null."}},"required":["variant","chosenBy","decidedAt"],"additionalProperties":false},{"type":"null"}],"description":"The winning variant, or null before it is chosen."},"variants":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"A name you choose."},"templateId":{"type":"string","description":"The ID of a saved template."},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Contacts assigned to the test group."},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Test copies accepted for delivery."},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many were delivered."},"uniqueOpens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who opened at least once. An estimate: privacy proxies and scanners open email too."},"uniqueClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who clicked at least once."},"openRate":{"type":"number","minimum":0,"maximum":1,"description":"uniqueOpens divided by accepted, 0 when none accepted."},"clickRate":{"type":"number","minimum":0,"maximum":1,"description":"uniqueClicks divided by accepted, 0 when none accepted."}},"required":["name","templateId","recipients","accepted","delivered","uniqueOpens","uniqueClicks","openRate","clickRate"],"additionalProperties":false},"description":"The A/B test variants, 2 to 4."},"remainder":{"type":"object","properties":{"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipient counts."},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Copies accepted for delivery."}},"required":["recipients","accepted"],"additionalProperties":false,"description":"The contacts that get the winner."}},"required":["broadcastId","testPercent","winnerMetric","waitMinutes","decideAt","winner","variants","remainder"],"additionalProperties":false},"BroadcastAbTestWinner":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"variant":{"type":"string","minLength":1,"maxLength":50,"description":"The A/B test variant, or null."}},"additionalProperties":false},"MarketingTracking":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."}},"required":["openTracking","clickTracking"],"additionalProperties":false},"MarketingSettings":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."},"updatedAt":{"type":["string","null"],"description":"When it last changed, in ISO 8601."}},"required":["openTracking","clickTracking","updatedAt"],"additionalProperties":false},"MarketingSettingsUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image that records when a copy is opened."},"clickTracking":{"type":"boolean","description":"Send HTML links through a Ternwire redirect that records clicks."}},"additionalProperties":false},"EmailTrackingSettings":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image to the HTML part of each email, which records when the email is opened."},"clickTracking":{"type":"boolean","description":"Send each http and https link in the HTML part through a Ternwire redirect that records the click."},"updatedAt":{"type":["string","null"],"description":"When it last changed, in ISO 8601."}},"required":["openTracking","clickTracking","updatedAt"],"additionalProperties":false},"EmailTrackingSettingsUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"openTracking":{"type":"boolean","description":"Add a 1x1 image to the HTML part of each email, which records when the email is opened."},"clickTracking":{"type":"boolean","description":"Send each http and https link in the HTML part through a Ternwire redirect that records the click."}},"additionalProperties":false},"AutomationTrigger":{"$schema":"http://json-schema.org/draft-07/schema#","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_subscribed","description":"What enrolls a contact: a confirmed subscription or an event."}},"required":["type"],"additionalProperties":false,"description":"Fires when a contact's membership in the audience becomes confirmed: through the API, an import, the dashboard or a double opt-in confirmation."},{"type":"object","properties":{"type":{"type":"string","const":"event","description":"What enrolls a contact: a confirmed subscription or an event."},"eventName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"The event name, as sent to createContactEvent."}},"required":["type","eventName"],"additionalProperties":false,"description":"Fires when POST /v1/events records an event with this name for a confirmed member of the audience."}]},"AutomationStep":{"$schema":"http://json-schema.org/draft-07/schema#","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_email","description":"send_email, wait, or exit_unless."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["type","templateId","localizedTemplates","values"],"additionalProperties":false,"description":"Sends one marketing copy. Templates read `contact.*` and, for an event trigger, the event's properties as `event.*`."},{"type":"object","properties":{"type":{"type":"string","const":"wait","description":"send_email, wait, or exit_unless."},"minutes":{"type":"integer","minimum":1,"maximum":525600,"description":"How long to wait, in minutes."}},"required":["type","minutes"],"additionalProperties":false,"description":"Waits 1 minute to 365 days before the next step."},{"type":"object","properties":{"type":{"type":"string","const":"exit_unless","description":"send_email, wait, or exit_unless."},"segment":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false,"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."}},"required":["type","segment"],"additionalProperties":false,"description":"Ends the enrollment unless the contact still matches the segment."}]},"Automation":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","description":"A name you choose."},"from":{"type":"string","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"type":["string","null"],"description":"The address replies go to, when it is not the sender."},"trigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_subscribed","description":"Which type it is."}},"required":["type"],"additionalProperties":false,"description":"Fires when a contact's membership in the audience becomes confirmed: through the API, an import, the dashboard or a double opt-in confirmation."},{"type":"object","properties":{"type":{"type":"string","const":"event","description":"Which type it is."},"eventName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"The event name, as sent to createContactEvent."}},"required":["type","eventName"],"additionalProperties":false,"description":"Fires when POST /v1/events records an event with this name for a confirmed member of the audience."}],"description":"What enrolls a contact."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_email","description":"Which type it is."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["type","templateId","localizedTemplates","values"],"additionalProperties":false,"description":"Sends one marketing copy. Templates read `contact.*` and, for an event trigger, the event's properties as `event.*`."},{"type":"object","properties":{"type":{"type":"string","const":"wait","description":"Which type it is."},"minutes":{"type":"integer","minimum":1,"maximum":525600,"description":"How long to wait, in minutes."}},"required":["type","minutes"],"additionalProperties":false,"description":"Waits 1 minute to 365 days before the next step."},{"type":"object","properties":{"type":{"type":"string","const":"exit_unless","description":"Which type it is."},"segment":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false,"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."}},"required":["type","segment"],"additionalProperties":false,"description":"Ends the enrollment unless the contact still matches the segment."}]},"description":"The steps run in order for each enrolled contact."},"reentry":{"type":"string","enum":["once","always"],"description":"Whether a contact can be enrolled again after finishing."},"state":{"type":"string","enum":["draft","active","paused","archived"],"description":"The current state."},"pauseReason":{"anyOf":[{"type":"string","enum":["manual","quota_exceeded","organization_blocked"]},{"type":"null"}],"description":"Why it is paused: customer when you paused it, quota_exceeded when the plan's limit stopped it."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The current version. Activating changed steps makes a new one."},"activatedAt":{"type":["string","null"],"description":"When it was last activated, in ISO 8601, or null."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","audienceId","name","from","replyTo","trigger","segment","steps","reentry","state","pauseReason","version","activatedAt","createdAt","updatedAt"],"additionalProperties":false},"AutomationCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"from":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"The address replies go to, when it is not the sender."},"trigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_subscribed","description":"Which type it is."}},"required":["type"],"additionalProperties":false,"description":"Fires when a contact's membership in the audience becomes confirmed: through the API, an import, the dashboard or a double opt-in confirmation."},{"type":"object","properties":{"type":{"type":"string","const":"event","description":"Which type it is."},"eventName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"The event name, as sent to createContactEvent."}},"required":["type","eventName"],"additionalProperties":false,"description":"Fires when POST /v1/events records an event with this name for a confirmed member of the audience."}],"description":"What enrolls a contact."},"segment":{"description":"Contacts must match it when they enter. Leave it out to enroll every member.","anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}]},"steps":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_email","description":"Which type it is."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["type","templateId","localizedTemplates","values"],"additionalProperties":false,"description":"Sends one marketing copy. Templates read `contact.*` and, for an event trigger, the event's properties as `event.*`."},{"type":"object","properties":{"type":{"type":"string","const":"wait","description":"Which type it is."},"minutes":{"type":"integer","minimum":1,"maximum":525600,"description":"How long to wait, in minutes."}},"required":["type","minutes"],"additionalProperties":false,"description":"Waits 1 minute to 365 days before the next step."},{"type":"object","properties":{"type":{"type":"string","const":"exit_unless","description":"Which type it is."},"segment":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false,"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."}},"required":["type","segment"],"additionalProperties":false,"description":"Ends the enrollment unless the contact still matches the segment."}]},"description":"The steps run in order for each enrolled contact."},"reentry":{"default":"once","description":"`once` enrolls a contact at most one time. `always` enrolls again on each trigger after the previous enrollment finished.","type":"string","enum":["once","always"]}},"required":["audienceId","name","from","trigger","steps","reentry"],"additionalProperties":false},"AutomationUpdate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"A name you choose."},"from":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}],"description":"The address replies go to, when it is not the sender."},"trigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_subscribed","description":"Which type it is."}},"required":["type"],"additionalProperties":false,"description":"Fires when a contact's membership in the audience becomes confirmed: through the API, an import, the dashboard or a double opt-in confirmation."},{"type":"object","properties":{"type":{"type":"string","const":"event","description":"Which type it is."},"eventName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"The event name, as sent to createContactEvent."}},"required":["type","eventName"],"additionalProperties":false,"description":"Fires when POST /v1/events records an event with this name for a confirmed member of the audience."}],"description":"What enrolls a contact."},"segment":{"description":"Contacts must match it when they enter. Leave it out to enroll every member.","anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}]},"steps":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_email","description":"Which type it is."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["type","templateId","localizedTemplates","values"],"additionalProperties":false,"description":"Sends one marketing copy. Templates read `contact.*` and, for an event trigger, the event's properties as `event.*`."},{"type":"object","properties":{"type":{"type":"string","const":"wait","description":"Which type it is."},"minutes":{"type":"integer","minimum":1,"maximum":525600,"description":"How long to wait, in minutes."}},"required":["type","minutes"],"additionalProperties":false,"description":"Waits 1 minute to 365 days before the next step."},{"type":"object","properties":{"type":{"type":"string","const":"exit_unless","description":"Which type it is."},"segment":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false,"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."}},"required":["type","segment"],"additionalProperties":false,"description":"Ends the enrollment unless the contact still matches the segment."}]},"description":"The steps run in order for each enrolled contact."},"reentry":{"type":"string","enum":["once","always"],"description":"Whether a contact can be enrolled again after finishing."}},"additionalProperties":false},"AutomationList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"audienceId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an audience."},"name":{"type":"string","description":"A name you choose."},"from":{"type":"string","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"replyTo":{"type":["string","null"],"description":"The address replies go to, when it is not the sender."},"trigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"contact_subscribed","description":"Which type it is."}},"required":["type"],"additionalProperties":false,"description":"Fires when a contact's membership in the audience becomes confirmed: through the API, an import, the dashboard or a double opt-in confirmation."},{"type":"object","properties":{"type":{"type":"string","const":"event","description":"Which type it is."},"eventName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"The event name, as sent to createContactEvent."}},"required":["type","eventName"],"additionalProperties":false,"description":"Fires when POST /v1/events records an event with this name for a confirmed member of the audience."}],"description":"What enrolls a contact."},"segment":{"anyOf":[{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false},{"type":"null"}],"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"send_email","description":"Which type it is."},"templateId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a saved template."},"localizedTemplates":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"Template id per recipient locale. Selection tries the contact's exact locale, then its language (de-AT then de), then the audience defaultLocale and its language, then templateId.","examples":[{"sk":"tmpl_slovak0001","de-AT":"tmpl_austria001"}]},"values":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["type","templateId","localizedTemplates","values"],"additionalProperties":false,"description":"Sends one marketing copy. Templates read `contact.*` and, for an event trigger, the event's properties as `event.*`."},{"type":"object","properties":{"type":{"type":"string","const":"wait","description":"Which type it is."},"minutes":{"type":"integer","minimum":1,"maximum":525600,"description":"How long to wait, in minutes."}},"required":["type","minutes"],"additionalProperties":false,"description":"Waits 1 minute to 365 days before the next step."},{"type":"object","properties":{"type":{"type":"string","const":"exit_unless","description":"Which type it is."},"segment":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"description":"all: every condition must match. any: one is enough."},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","starts_with"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","minLength":1,"maxLength":500,"description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["in","not_in"],"description":"How the condition compares the attribute with value."},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["attribute","operator","values"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["exists","not_exists"],"description":"How the condition compares the attribute with value."}},"required":["attribute","operator"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["greater_than","greater_or_equal","less_than","less_or_equal"],"description":"How the condition compares the attribute with value."},"value":{"type":"number","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$","description":"The contact attribute the condition reads."},"operator":{"type":"string","enum":["before","after"],"description":"How the condition compares the attribute with value."},"value":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The value the attribute is compared with."}},"required":["attribute","operator","value"],"additionalProperties":false}]},"description":"The conditions of the segment."}},"required":["match","conditions"],"additionalProperties":false,"description":"Narrows the audience to contacts whose attributes match. Leave it out for every confirmed contact."}},"required":["type","segment"],"additionalProperties":false,"description":"Ends the enrollment unless the contact still matches the segment."}]},"description":"The steps run in order for each enrolled contact."},"reentry":{"type":"string","enum":["once","always"],"description":"Whether a contact can be enrolled again after finishing."},"state":{"type":"string","enum":["draft","active","paused","archived"],"description":"The current state."},"pauseReason":{"anyOf":[{"type":"string","enum":["manual","quota_exceeded","organization_blocked"]},{"type":"null"}],"description":"Why it is paused: customer when you paused it, quota_exceeded when the plan's limit stopped it."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The current version. Activating changed steps makes a new one."},"activatedAt":{"type":["string","null"],"description":"When it was last activated, in ISO 8601, or null."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."},"updatedAt":{"type":"string","description":"When it last changed, in ISO 8601."}},"required":["id","audienceId","name","from","replyTo","trigger","segment","steps","reentry","state","pauseReason","version","activatedAt","createdAt","updatedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"AutomationStats":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"automationId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an automation."},"enrolled":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many contacts were enrolled."},"active":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are active."},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many completed."},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many failed."},"exited":{"type":"object","propertyNames":{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","segment","archived","rejected"]},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","segment","archived","rejected"],"description":"How many exited early."},"steps":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The step's position, from 0."},"type":{"type":"string","enum":["send_email","wait","exit_unless"],"description":"The step type."},"sent":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many were sent."},"uniqueOpens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who opened at least once. An estimate: privacy proxies and scanners open email too."},"uniqueClicks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients who clicked at least once."}},"required":["index","type","sent","uniqueOpens","uniqueClicks"],"additionalProperties":false},"description":"Counts for each step of the current version."}},"required":["automationId","enrolled","active","completed","failed","exited","steps"],"additionalProperties":false},"AutomationEnrollment":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"automationId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an automation."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"email":{"type":"string","description":"Email address."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The automation version the contact runs."},"state":{"type":"string","enum":["active","completed","exited","failed"],"description":"active, completed or exited."},"stepIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The step the contact is at, from 0."},"nextRunAt":{"type":["string","null"],"description":"When the next step runs, or null."},"exitReason":{"anyOf":[{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","segment","archived","rejected"]},{"type":"null"}],"description":"Why the contact left early, or null."},"enteredAt":{"type":"string","description":"When the contact was enrolled."},"finishedAt":{"type":["string","null"],"description":"When it finished, in ISO 8601, or null before then."}},"required":["id","automationId","contactId","email","version","state","stepIndex","nextRunAt","exitReason","enteredAt","finishedAt"],"additionalProperties":false},"AutomationEnrollmentList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"automationId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of an automation."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"email":{"type":"string","description":"Email address."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The automation version the contact runs."},"state":{"type":"string","enum":["active","completed","exited","failed"],"description":"active, completed or exited."},"stepIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The step the contact is at, from 0."},"nextRunAt":{"type":["string","null"],"description":"When the next step runs, or null."},"exitReason":{"anyOf":[{"type":"string","enum":["unsubscribed","membership_changed","contact_removed","audience_archived","suppressed","segment","archived","rejected"]},{"type":"null"}],"description":"Why the contact left early, or null."},"enteredAt":{"type":"string","description":"When the contact was enrolled."},"finishedAt":{"type":["string","null"],"description":"When it finished, in ISO 8601, or null before then."}},"required":["id","automationId","contactId","email","version","state","stepIndex","nextRunAt","exitReason","enteredAt","finishedAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."},"hasMore":{"type":"boolean","description":"Deprecated: read page.hasMore."},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Deprecated: read page.nextCursor."}},"required":["data","page","hasMore","nextCursor"],"additionalProperties":false},"AutomationTestRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"description":"Recipient addresses."},"step":{"type":"integer","minimum":0,"maximum":19,"description":"Zero-based index of a send_email step."},"locale":{"type":"string","maxLength":16,"description":"BCP 47 language tag such as en, sk or en-GB.","examples":["sk"]},"event":{"default":{},"description":"Sample event properties for a template that reads `event.*`.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{}}},"required":["to","step","event"],"additionalProperties":false},"ContactEventCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address."},"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]*$","examples":["trial_started"],"description":"A name you choose."},"properties":{"default":{},"description":"Templates in the enrolled sequence read these as `event.*`.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{}}},"required":["name","properties"],"additionalProperties":false},"ContactEventResult":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."},"contactId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$","description":"The ID of a contact."},"enrolled":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,127}$"},"description":"How many automations the contact was enrolled in."},"createdAt":{"type":"string","description":"When it was created, in ISO 8601."}},"required":["id","name","contactId","enrolled","createdAt"],"additionalProperties":false},"ApiKey":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":["string","null"],"description":"A name you choose."},"prefix":{"type":"string","description":"The first characters of the key, shown to tell keys apart. Never the whole key."},"mode":{"type":"string","enum":["live","test"],"description":"live sends real email; test runs the pipeline with simulated outcomes."},"scopes":{"type":"array","items":{"type":"string","enum":["organization:read","send","contacts:read","contacts:write","broadcasts:read","broadcasts:write","marketing:send","automations:read","automations:write","events:write","inbound:read","api_keys:write","templates:generate"]},"description":"What the key may do."},"allowedDomains":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The sending domains the key may send from, or null for every domain."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops working, or null for never."},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key last made a request, or null."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key was revoked, or null while it works."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","name","prefix","mode","scopes","allowedDomains","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false},"ApiKeyList":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":["string","null"],"description":"A name you choose."},"prefix":{"type":"string","description":"The first characters of the key, shown to tell keys apart. Never the whole key."},"mode":{"type":"string","enum":["live","test"],"description":"live sends real email; test runs the pipeline with simulated outcomes."},"scopes":{"type":"array","items":{"type":"string","enum":["organization:read","send","contacts:read","contacts:write","broadcasts:read","broadcasts:write","marketing:send","automations:read","automations:write","events:write","inbound:read","api_keys:write","templates:generate"]},"description":"What the key may do."},"allowedDomains":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The sending domains the key may send from, or null for every domain."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops working, or null for never."},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key last made a request, or null."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key was revoked, or null while it works."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."}},"required":["id","name","prefix","mode","scopes","allowedDomains","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false},"description":"The items on this page."},"page":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Pass it as cursor to get the next page. Null on the last page."},"hasMore":{"type":"boolean","description":"Whether another page follows."}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Where this page sits in the list."}},"required":["data","page"],"additionalProperties":false},"ApiKeyCreate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name that says where the key is used, such as Production server."},"mode":{"type":"string","enum":["live","test"],"description":"live or test. A test key can only create test keys."},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["organization:read","send","contacts:read","contacts:write","broadcasts:read","broadcasts:write","marketing:send","automations:read","automations:write","events:write","inbound:read","api_keys:write","templates:generate"]},"description":"What the key may do: a subset of the calling key's scopes."},"allowedDomains":{"anyOf":[{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":253}},{"type":"null"}],"description":"Limit the key to these sending domains. Leave it out for every domain, which a domain-limited caller cannot do."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}],"description":"When the key stops working, in ISO 8601 with an offset. No later than the calling key."}},"required":["name","mode","scopes"],"additionalProperties":false},"ApiKeyCreated":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":["string","null"],"description":"A name you choose."},"prefix":{"type":"string","description":"The first characters of the key, shown to tell keys apart. Never the whole key."},"mode":{"type":"string","enum":["live","test"],"description":"live sends real email; test runs the pipeline with simulated outcomes."},"scopes":{"type":"array","items":{"type":"string","enum":["organization:read","send","contacts:read","contacts:write","broadcasts:read","broadcasts:write","marketing:send","automations:read","automations:write","events:write","inbound:read","api_keys:write","templates:generate"]},"description":"What the key may do."},"allowedDomains":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The sending domains the key may send from, or null for every domain."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops working, or null for never."},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key last made a request, or null."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key was revoked, or null while it works."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was created, in ISO 8601."},"key":{"type":"string","description":"The secret key. It is returned only in this response, so store it now."}},"required":["id","name","prefix","mode","scopes","allowedDomains","expiresAt","lastUsedAt","revokedAt","createdAt","key"],"additionalProperties":false},"CurrentAccount":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."}},"required":["id","name"],"additionalProperties":false,"description":"The workspace the key belongs to."},"credential":{"type":"object","properties":{"kind":{"type":"string","enum":["api_key","oauth"],"description":"api_key for an API key, oauth for an access token from a connected app."},"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":["string","null"],"description":"A name you choose."},"prefix":{"type":"string","description":"The first characters of the key, shown to tell keys apart."},"mode":{"type":"string","enum":["live","test"],"description":"live sends real email; test runs the pipeline with simulated outcomes."},"scopes":{"type":"array","items":{"type":"string","enum":["organization:read","send","contacts:read","contacts:write","broadcasts:read","broadcasts:write","marketing:send","automations:read","automations:write","events:write","inbound:read","api_keys:write","templates:generate"]},"description":"What the key may do. Each operation says which scope it needs."},"allowedDomains":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The sending domains the key may send from, or null for every domain."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops working, or null for never."}},"required":["kind","id","name","prefix","mode","scopes","allowedDomains","expiresAt"],"additionalProperties":false,"description":"The key making this request."},"plan":{"type":"object","properties":{"code":{"type":"string","description":"The plan, such as free or pro."},"complimentary":{"type":"boolean","description":"Whether the plan is given at no charge."},"billingStatus":{"type":["string","null"],"description":"The subscription's billing status, or null on the free plan."}},"required":["code","complimentary","billingStatus"],"additionalProperties":false,"description":"The workspace's plan."},"sending":{"type":"object","properties":{"state":{"type":"string","enum":["test_only","pending_review","active","suspended","closed"],"description":"test_only, pending_review, active, suspended or closed."},"liveSendingAllowed":{"type":"boolean","description":"Whether live email can be sent now."},"blockedBy":{"type":["string","null"],"description":"What stops live sending, or null when nothing does."},"paymentActionRequired":{"type":"boolean","description":"Whether a payment problem needs the owner's attention."},"sandbox":{"anyOf":[{"type":"object","properties":{"from":{"type":"string","description":"Sender address, optionally with a display name: `Acme <hello@acme.com>`."},"dailyLimit":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many recipients it allows in 24 hours."},"remainingToday":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many recipients are left in the current 24 hours."},"allowedRecipients":{"type":"array","items":{"type":"string"},"description":"The only addresses it can send to: the workspace members' own."}},"required":["from","dailyLimit","remainingToday","allowedRecipients"],"additionalProperties":false},{"type":"null"}],"description":"Ternwire's shared test sender, for trying sending before a domain is verified, or null when it is not offered."}},"required":["state","liveSendingAllowed","blockedBy","paymentActionRequired","sandbox"],"additionalProperties":false,"description":"Whether the workspace can send live email now."},"quota":{"type":"object","properties":{"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The start of the billing period."},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The end of the billing period."},"includedRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients the plan includes this period."},"recipientLimit":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most recipients the workspace can send to this period, overage included."},"usedRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients used this period."},"remainingRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Recipients left this period."},"daily":{"anyOf":[{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The limit."},"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are used."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are left."},"resetsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the count starts again."}},"required":["limit","used","remaining","resetsAt"],"additionalProperties":false},{"type":"null"}],"description":"The daily recipient limit of the free plan, or null on paid plans."}},"required":["periodStart","periodEnd","includedRecipients","recipientLimit","usedRecipients","remainingRecipients","daily"],"additionalProperties":false,"description":"How many recipients the plan allows, and how many are used."},"marketingEnabled":{"type":"boolean","description":"Whether newsletter sending is turned on for the workspace."},"aiTemplateCredits":{"type":"object","properties":{"access":{"type":"string","enum":["unavailable","upgrade_required","billing_inactive","ready"],"description":"Whether the plan can use AI template generation, and why not."},"included":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits the plan includes this period."},"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are used."},"hardCap":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most credits that can be used this period."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many are left."},"periodEnd":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The end of the billing period."}},"required":["access","included","used","hardCap","remaining","periodEnd"],"additionalProperties":false,"description":"Credits for writing templates with AI."}},"required":["organization","credential","plan","sending","quota","marketingEnabled","aiTemplateCredits"],"additionalProperties":false},"TemplateRenderRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"values":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"additionalProperties":false},"UnsavedTemplateRenderRequest":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"template":{"anyOf":[{"type":"object","properties":{"format":{"type":"string","const":"handlebars","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["name","subject"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","const":"react-email","description":"handlebars or react-email."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"A name you choose."},"subject":{"type":"string","maxLength":998,"description":"The subject line."},"editorContent":{"type":"string","minLength":1,"maxLength":5000000,"description":"The dashboard editor's document. Leave it out unless you edit in the editor."},"html":{"type":"string","minLength":1,"maxLength":5000000,"description":"The HTML body."},"text":{"type":"string","maxLength":5000000,"description":"The plain-text body."}},"required":["format","name","subject","editorContent","html","text"],"additionalProperties":false}],"description":"The template to render, in the same shape createEmailTemplate takes."},"values":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{},"description":"Template variables, such as `{ \"first_name\": \"Ada\" }`."}},"required":["template"],"additionalProperties":false},"RenderedTemplate":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"subject":{"type":"string","description":"The subject line."},"html":{"type":["string","null"],"description":"The HTML body."},"text":{"type":["string","null"],"description":"The plain-text body."}},"required":["subject","html","text"],"additionalProperties":false},"AiTemplateRequest":{"$schema":"http://json-schema.org/draft-07/schema#","oneOf":[{"type":"object","properties":{"format":{"type":"string","const":"handlebars","description":"handlebars or react-email."},"instruction":{"type":"string","minLength":1,"maxLength":4000,"description":"What the template should say and look like, in plain words."},"draft":{"type":"object","properties":{"subject":{"type":"string","maxLength":998,"description":"The subject line."},"html":{"type":"string","maxLength":200000,"description":"The HTML body."},"text":{"type":"string","maxLength":200000,"description":"The plain-text body."}},"required":["subject"],"additionalProperties":false,"description":"The current template to refine. Leave it out to write a new one."}},"required":["format","instruction"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","const":"react-email","description":"handlebars or react-email."},"instruction":{"type":"string","minLength":1,"maxLength":4000,"description":"What the template should say and look like, in plain words."},"draft":{"type":"object","properties":{"subject":{"type":"string","maxLength":998,"description":"The subject line."},"editorContent":{"type":"string","maxLength":200000,"description":"The dashboard editor's document. Leave it out unless you edit in the editor."}},"required":["subject","editorContent"],"additionalProperties":false,"description":"The current template to refine. Leave it out to write a new one."}},"required":["format","instruction"],"additionalProperties":false}]},"GeneratedTemplate":{"$schema":"http://json-schema.org/draft-07/schema#","oneOf":[{"type":"object","properties":{"format":{"type":"string","const":"handlebars","description":"handlebars or react-email."},"mode":{"type":"string","enum":["generate","refine"],"description":"generate for a new template, refine when a draft was given."},"subject":{"type":"string","description":"The subject line."},"html":{"type":"string","description":"The HTML body."},"text":{"type":"string","description":"The plain-text body."},"credits":{"type":"object","properties":{"charged":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits charged for this request."},"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits used this period, this request included."},"included":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits the plan includes this period."},"hardCap":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most credits that can be used this period."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits left this period."}},"required":["charged","used","included","hardCap","remaining"],"additionalProperties":false,"description":"The credits this request used and what is left."}},"required":["format","mode","subject","html","text","credits"],"additionalProperties":false},{"type":"object","properties":{"format":{"type":"string","const":"react-email","description":"handlebars or react-email."},"mode":{"type":"string","enum":["generate","refine"],"description":"generate for a new template, refine when a draft was given."},"subject":{"type":"string","description":"The subject line."},"editorContent":{"type":"string","description":"The dashboard editor's document. Leave it out unless you edit in the editor."},"credits":{"type":"object","properties":{"charged":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits charged for this request."},"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits used this period, this request included."},"included":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits the plan includes this period."},"hardCap":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most credits that can be used this period."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits left this period."}},"required":["charged","used","included","hardCap","remaining"],"additionalProperties":false,"description":"The credits this request used and what is left."}},"required":["format","mode","subject","editorContent","credits"],"additionalProperties":false}]},"AiCreditBalance":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"access":{"type":"string","enum":["unavailable","upgrade_required","billing_inactive","ready"],"description":"Whether the plan can use AI template generation, and why not."},"included":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits the plan includes this period."},"used":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits used this period."},"hardCap":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most credits that can be used this period."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits left this period."},"periodEnd":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the credit period ends, or null."}},"required":["access","included","used","hardCap","remaining","periodEnd"],"additionalProperties":false},"DomainCheck":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"domain":{"type":"string","description":"The domain name."},"purpose":{"type":"string","enum":["transactional","marketing"],"description":"transactional for app email, marketing for newsletters."},"state":{"type":"string","enum":["pending","verified","active","failed","disabled","deleting"],"description":"The current state."},"verificationFailure":{"type":["string","null"],"description":"Why verification failed, or null."},"providerCheckedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the email provider last checked the domain, or null."},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","mail_from_mx","mail_from_spf","dmarc"],"description":"Which kind it is."},"type":{"type":"string","enum":["CNAME","TXT","MX"],"description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"The value the attribute is compared with."},"status":{"type":"string","enum":["pending","valid","invalid"],"description":"The current status."},"blocking":{"type":"boolean","description":"Whether the domain cannot be verified until this record is right."},"found":{"type":"boolean","description":"Whether DNS has the record with the right value now."},"observedValue":{"type":["string","null"],"description":"What the DNS lookup found, or null."}},"required":["kind","type","name","value","status","blocking","found","observedValue"],"additionalProperties":false},"description":"Each record the domain needs, with what DNS answered now."},"checkedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was last checked, in ISO 8601, or null before the first check."},"readyToSend":{"type":"boolean","description":"Whether email can be sent from the domain now."},"blockingRecordsPending":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records that block verification are still missing or wrong."}},"required":["id","domain","purpose","state","verificationFailure","providerCheckedAt","dnsRecords","checkedAt","readyToSend","blockingRecordsPending"],"additionalProperties":false},"DomainDnsSetup":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"domainId":{"type":"string","description":"The ID of a sending domain."},"domain":{"type":"string","description":"The domain name."},"zone":{"type":"string","description":"The DNS zone the records go in."},"host":{"type":["string","null"],"description":"The part of the domain below the zone, or null at the zone's root."},"status":{"type":"string","enum":["ready","manual","onboarding_required"],"description":"The current status."},"provider":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of this object."},"name":{"type":"string","description":"A name you choose."},"controlPanelUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Where the user edits DNS at the provider, or null."}},"required":["id","name","controlPanelUrl"],"additionalProperties":false},{"type":"null"}],"description":"The domain's DNS provider, when Ternwire recognizes it, or null."},"actionUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"With status ready: the page where a person approves the records at their DNS provider. Give it to the user; an agent cannot approve it."},"message":{"type":"string","description":"What to do next, in plain words."},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dkim","spf","mail_from_mx","mail_from_spf","dmarc"],"description":"Which kind it is."},"type":{"type":"string","enum":["CNAME","TXT","MX"],"description":"Which type it is."},"name":{"type":"string","description":"A name you choose."},"value":{"type":"string","description":"The value the attribute is compared with."},"status":{"type":"string","enum":["pending","valid","invalid"],"description":"The current status."},"blocking":{"type":"boolean","description":"Whether the domain cannot be verified until this record is right."}},"required":["kind","type","name","value","status","blocking"],"additionalProperties":false},"description":"The records to add by hand when one-click setup is not available."}},"required":["domainId","domain","zone","host","status","provider","actionUrl","message","dnsRecords"],"additionalProperties":false},"ApiErrorBody":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["ab_test_not_configured","ab_test_tracking_required","ab_test_variant_not_found","ab_test_winner_chosen","activation_failed","ai_credits_exhausted","ai_invalid_output","ai_output_truncated","ai_prompt_too_large","ai_refused","ai_unavailable","already_member","already_requested","api_key_domain_restricted","api_key_privilege_exceeded","api_key_secret_unavailable","attachment_not_clean","attachment_pending_limit","attachment_upload_expired","attachment_upload_mismatch","attachment_upload_not_open","audience_archived","audience_too_large","automation_not_editable","automation_step_not_email","broadcast_active","broadcast_intent_resolved","broadcast_not_sending","broadcast_recipient_cap_reached","captcha_failed","checkout_incomplete","checkout_ownership_mismatch","checkout_unavailable","confirmation_sender_unverified","contact_import_invalid","contact_limit_exceeded","csrf_rejected","domain_in_workspace","domain_limit_reached","domain_taken","duplicate_recipient","erasure_unavailable","error","forbidden","forward_address_not_member","idempotency_conflict","idempotency_in_progress","idempotency_key_required","idempotency_record_deleted","impersonation_forbidden","import_batch_incomplete","import_batch_mismatch","import_expired","inbound_email_content_unavailable","invalid_api_key","invalid_attachment","invalid_checkout","invalid_domain","invalid_local_part","invalid_plan","invalid_request","invalid_template","invalid_transition","invalid_webhook_url","invitation_email_mismatch","invitation_exists","invitation_limit_reached","invitation_unavailable","last_owner","legal_hold","live_key_required","live_send_api_key_not_found","live_sending_not_approved","mailbox_provider_domain","manage_existing_subscription_in_portal","marketing_audience_archived","marketing_canceled","marketing_confirmation_allowance_exhausted","marketing_contact_removed","marketing_disabled","marketing_expired","marketing_list_management_not_allowed","marketing_live_key_required","marketing_membership_changed","marketing_recipient_mismatch","marketing_sender_unverified","marketing_single_recipient_required","marketing_stream_not_approved","marketing_stream_paused","marketing_unsubscribed","marketing_warmup_limit_reached","message_too_large","missing_scope","missing_subscription","not_found","not_held","not_waiting","organization_cannot_send","paid_active_required","paid_plan_required","payload_too_large","payment_action_required","plan_missing","plan_not_configured","preview_contact_missing","provider_failure","quota_exceeded","rate_limited","receiving_address_limit_reached","receiving_address_taken","receiving_unavailable","recipient_suppressed","request_failed","sandbox_daily_limit_reached","sandbox_marketing_not_allowed","sandbox_recipient_not_member","sandbox_sender_address","schedule_out_of_range","send_temporarily_unavailable","sender_domain_inactive","sender_domain_not_allowed","sender_domain_not_found","sender_domain_wrong_purpose","service_unavailable","subscription_inactive","suppression_not_removable","template_changed","template_in_use","template_limit_reached","template_name_conflict","template_not_found","template_render_failed","template_storage_limit_reached","temporarily_unavailable","tenant_missing","test_recipient_not_member","unauthorized","webhook_endpoint_limit_reached","webhook_test_rate_limited","webhook_url_taken"]},{"type":"string"}],"description":"The same error code as code. Kept for clients written before code was on every error."},"code":{"anyOf":[{"type":"string","enum":["ab_test_not_configured","ab_test_tracking_required","ab_test_variant_not_found","ab_test_winner_chosen","activation_failed","ai_credits_exhausted","ai_invalid_output","ai_output_truncated","ai_prompt_too_large","ai_refused","ai_unavailable","already_member","already_requested","api_key_domain_restricted","api_key_privilege_exceeded","api_key_secret_unavailable","attachment_not_clean","attachment_pending_limit","attachment_upload_expired","attachment_upload_mismatch","attachment_upload_not_open","audience_archived","audience_too_large","automation_not_editable","automation_step_not_email","broadcast_active","broadcast_intent_resolved","broadcast_not_sending","broadcast_recipient_cap_reached","captcha_failed","checkout_incomplete","checkout_ownership_mismatch","checkout_unavailable","confirmation_sender_unverified","contact_import_invalid","contact_limit_exceeded","csrf_rejected","domain_in_workspace","domain_limit_reached","domain_taken","duplicate_recipient","erasure_unavailable","error","forbidden","forward_address_not_member","idempotency_conflict","idempotency_in_progress","idempotency_key_required","idempotency_record_deleted","impersonation_forbidden","import_batch_incomplete","import_batch_mismatch","import_expired","inbound_email_content_unavailable","invalid_api_key","invalid_attachment","invalid_checkout","invalid_domain","invalid_local_part","invalid_plan","invalid_request","invalid_template","invalid_transition","invalid_webhook_url","invitation_email_mismatch","invitation_exists","invitation_limit_reached","invitation_unavailable","last_owner","legal_hold","live_key_required","live_send_api_key_not_found","live_sending_not_approved","mailbox_provider_domain","manage_existing_subscription_in_portal","marketing_audience_archived","marketing_canceled","marketing_confirmation_allowance_exhausted","marketing_contact_removed","marketing_disabled","marketing_expired","marketing_list_management_not_allowed","marketing_live_key_required","marketing_membership_changed","marketing_recipient_mismatch","marketing_sender_unverified","marketing_single_recipient_required","marketing_stream_not_approved","marketing_stream_paused","marketing_unsubscribed","marketing_warmup_limit_reached","message_too_large","missing_scope","missing_subscription","not_found","not_held","not_waiting","organization_cannot_send","paid_active_required","paid_plan_required","payload_too_large","payment_action_required","plan_missing","plan_not_configured","preview_contact_missing","provider_failure","quota_exceeded","rate_limited","receiving_address_limit_reached","receiving_address_taken","receiving_unavailable","recipient_suppressed","request_failed","sandbox_daily_limit_reached","sandbox_marketing_not_allowed","sandbox_recipient_not_member","sandbox_sender_address","schedule_out_of_range","send_temporarily_unavailable","sender_domain_inactive","sender_domain_not_allowed","sender_domain_not_found","sender_domain_wrong_purpose","service_unavailable","subscription_inactive","suppression_not_removable","template_changed","template_in_use","template_limit_reached","template_name_conflict","template_not_found","template_render_failed","template_storage_limit_reached","temporarily_unavailable","tenant_missing","test_recipient_not_member","unauthorized","webhook_endpoint_limit_reached","webhook_test_rate_limited","webhook_url_taken"]},{"type":"string"}],"description":"The error code, such as invalid_request or rate_limited. Branch on it, not on message. The docs list every code with what to do: https://ternwire.com/docs/api-errors."},"title":{"type":"string","description":"A short summary of the error."},"message":{"type":"string","description":"What went wrong and what to do, in plain English. It can change, so don't parse it."},"detail":{"type":"string","description":"More detail, when there is some."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"On validation errors: each field that needs a change, with what to change."},"reason":{"type":"string","description":"A more specific reason, on some codes."},"kind":{"type":"string","description":"A more specific kind, on some codes."},"actualBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"On message_too_large: the size of the message."},"limitBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"On message_too_large: the most allowed."},"oldestQueuedAt":{"type":["string","null"],"description":"On queue errors: when the oldest waiting email was accepted."},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"On plan limits: the limit that was reached."},"field":{"type":"string","description":"The field the error is about."},"missing":{"type":"array","items":{"type":"string"},"description":"On template_render_failed: the template variables that had no value."},"requiredScope":{"type":"string","description":"On missing_scope: the scope the API key needs."},"addresses":{"type":"array","items":{"type":"string"},"description":"On recipient_suppressed: the recipients on the blocked addresses list."},"requestId":{"type":"string","description":"The request's X-Request-Id. Quote it when you contact support."}},"required":["status","code"],"additionalProperties":{}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"em_live_* or em_test_*","description":"An API key from the API keys page of the dashboard, sent as Authorization: Bearer <key>."}}},"security":[{"apiKey":[]}]}