{"openapi":"3.1.0","info":{"title":"Duta API","version":"1","description":"Transactional email for Malaysia. Every route also answers without the /v1 prefix, as Resend's do, so a Resend SDK works with only its base URL changed. Every response carries X-Request-Id."},"servers":[{"url":"https://api.duta.indra.sh/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from the dashboard, starting duta_"}},"schemas":{"SendResult":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sent","suppressed"],"description":"sent is a sandbox send, delivered at once"}},"required":["id","status"]},"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"name":{"type":"string","description":"The Resend error name, so code that branches on it keeps working"},"message":{"type":"string"},"code":{"type":"string","enum":["unauthorized","forbidden","not_found","validation_failed","domain_not_verified","from_domain_not_allowed","recipient_suppressed","recipient_not_confirmed","rate_limited","quota_exceeded","conflict","payment_required","account_paused","content_rejected","platform_halted","payload_too_large","length_required","idempotency_conflict","provider_error","internal_error"],"description":"Duta's error code, finer grained than name"},"detail":{"type":"object","additionalProperties":{}},"request_id":{"type":"string","description":"Find this request on the Logs screen"}},"required":["statusCode","name","message","code","request_id"]},"EmailSummary":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"status":{"type":"string","description":"Duta's exact status"},"last_event":{"type":"string","enum":["bounced","canceled","clicked","complained","delivered","delivery_delayed","failed","opened","queued","scheduled","sent","suppressed"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"},"from_addr":{"type":"string"},"to_addr":{"type":"string"}},"required":["id","from","to","subject","status","last_event","created_at","from_addr","to_addr"]},"Email":{"type":"object","properties":{"object":{"type":"string","enum":["email"]},"id":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":["array","null"],"items":{"type":"string"}},"bcc":{"type":["array","null"],"items":{"type":"string"}},"reply_to":{"type":["array","null"],"items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":["string","null"]},"text":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]}},"status":{"type":"string"},"last_event":{"type":"string","enum":["bounced","canceled","clicked","complained","delivered","delivery_delayed","failed","opened","queued","scheduled","sent","suppressed"]},"failure_reason":{"type":["string","null"]},"message_id":{"type":["string","null"],"description":"The provider message id"},"scheduled_at":{"type":"null"},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"},"log_id":{"type":["string","null"],"description":"The request that sent it"},"events":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"occurred_at":{"type":"string","format":"date-time","description":"ISO 8601"},"payload":{"type":["string","null"]}},"required":["type","occurred_at","payload"]}}},"required":["object","id","from","to","cc","bcc","reply_to","subject","html","text","tags","status","last_event","failure_reason","message_id","scheduled_at","created_at","log_id","events"]},"EmailBody":{"type":"object","properties":{"archived":{"type":"boolean","description":"false when the content was not kept"},"html":{"type":["string","null"]},"text":{"type":["string","null"]},"headers":{"type":["object","null"],"additionalProperties":{"type":"string"}},"attachments":{"type":"array","items":{}}},"required":["archived","html","text","headers","attachments"]},"DnsRecord":{"type":"object","properties":{"record":{"type":"string","enum":["DKIM","SPF","DMARC"]},"type":{"type":"string","enum":["CNAME","TXT","MX"]},"name":{"type":"string"},"value":{"type":"string"},"priority":{"type":"integer"},"ttl":{"type":"string","enum":["Auto"]},"status":{"type":"string","enum":["verified","pending","not_started"]},"purpose":{"type":"string"},"required":{"type":"boolean"},"group":{"type":"string","enum":["dkim","sending","dmarc"]}},"required":["record","type","name","value","ttl","status","purpose","required","group"]},"Domain":{"type":"object","properties":{"object":{"type":"string","enum":["domain"]},"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed"]},"region":{"type":"string"},"capabilities":{"type":"object","properties":{"sending":{"type":"string","enum":["enabled"]},"receiving":{"type":"string","enum":["disabled"]}},"required":["sending","receiving"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"},"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"}},"verified_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"},"last_checked_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"}},"required":["object","id","name","domain","status","region","capabilities","created_at","records","verified_at","last_checked_at"]},"DomainSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed"]},"region":{"type":"string"},"capabilities":{"type":"object","properties":{"sending":{"type":"string","enum":["enabled"]},"receiving":{"type":"string","enum":["disabled"]}},"required":["sending","receiving"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"},"verified_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"},"last_checked_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"}},"required":["id","name","domain","status","region","capabilities","created_at","verified_at","last_checked_at"]},"DomainVerify":{"type":"object","properties":{"object":{"type":"string","enum":["domain"]},"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"status":{"type":"string","enum":["pending","verified"]},"dns_ready":{"type":"boolean"},"ses_verified":{"type":"boolean"},"records":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/DnsRecord"},{"type":"object","properties":{"found":{"type":"boolean"}},"required":["found"]}]}}},"required":["object","id","name","domain","status","dns_ready","ses_verified","records"]},"CreatedApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permission":{"type":"string","enum":["full_access","sending_access"]},"scope":{"type":"string","enum":["send","full"]},"prefix":{"type":"string"},"last4":{"type":"string"},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"},"token":{"type":"string","description":"The key. Shown once and never again"},"key":{"type":"string","description":"The same as token"}},"required":["id","name","permission","scope","prefix","last4","created_at","token","key"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permission":{"type":"string","enum":["full_access","sending_access"]},"scope":{"type":"string","enum":["send","full"]},"prefix":{"type":"string"},"last4":{"type":"string"},"last_used_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"},"revoked_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["id","name","permission","scope","prefix","last4","last_used_at","revoked_at","created_at"]},"CreatedWebhook":{"type":"object","properties":{"object":{"type":"string","enum":["webhook"]},"id":{"type":"string"},"url":{"type":"string"},"endpoint":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"signing_secret":{"type":"string","description":"whsec_ secret for verifying deliveries. Shown once"},"secret":{"type":"string","description":"The same as signing_secret"},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["object","id","url","endpoint","events","signing_secret","secret","created_at"]},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"},"description":"Empty means every event"},"status":{"type":"string","enum":["active","disabled"]},"failure_count":{"type":"integer"},"last_failure_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601"},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["id","url","events","status","failure_count","last_failure_at","created_at"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"message_id":{"type":["string","null"]},"attempt":{"type":"integer"},"status_code":{"type":["integer","null"]},"ok":{"anyOf":[{"type":"boolean"},{"type":"integer"}]},"error":{"type":["string","null"]},"duration_ms":{"type":["integer","null"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["id","event_type","message_id","attempt","status_code","ok","error","duration_ms","created_at"]},"Suppression":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","enum":["hard_bounce","complaint","unsubscribe","manual"]},"source":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["email","reason","source","created_at"]},"LogSummary":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"status":{"type":"integer"},"duration_ms":{"type":["integer","null"]},"message_id":{"type":["string","null"]},"key_name":{"type":["string","null"]},"key_scope":{"type":["string","null"],"enum":["send","full"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["id","method","path","status","duration_ms","message_id","key_name","key_scope","created_at"]},"Log":{"allOf":[{"$ref":"#/components/schemas/LogSummary"},{"type":"object","properties":{"account_id":{"type":["string","null"]},"key_id":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"ip":{"type":["string","null"]},"request_body":{"type":["string","null"],"description":"Truncated. Kept for writes only"},"response_body":{"type":["string","null"]}},"required":["account_id","key_id","user_agent","ip","request_body","response_body"]}]},"Usage":{"type":"object","properties":{"period":{"type":"string","description":"The calendar month, YYYY-MM"},"periodDays":{"type":"number","enum":[30]},"plan":{"type":"object","properties":{"id":{"type":"string"},"includedEmails":{"type":["integer","null"]},"overageSenPerThousand":{"type":["integer","null"]},"maxDomains":{"type":"integer"},"dailyLimit":{"type":["integer","null"]},"logRetentionDays":{"type":"integer"},"ratePerSecond":{"type":"number"}},"required":["id","includedEmails","overageSenPerThousand","maxDomains","dailyLimit","logRetentionDays","ratePerSecond"]},"usage":{"type":"object","properties":{"usedThisMonth":{"type":"integer"},"includedEmails":{"type":["integer","null"]},"overage":{"type":"integer"},"overageBlocks":{"type":"integer"},"overageChargedSen":{"type":"integer","description":"Integer sen"},"overageCapSen":{"type":["integer","null"]},"percent":{"type":"number"}},"required":["usedThisMonth","includedEmails","overage","overageBlocks","overageChargedSen","overageCapSen","percent"]},"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Messages by status over the last 30 days"}},"required":["period","periodDays","plan","usage","counts"]}},"parameters":{}},"paths":{"/emails":{"post":{"operationId":"sendEmail","tags":["Emails"],"summary":"Send an email","description":"Needs html or text. On the Free plan, or from a sandbox address, the mail goes through the sandbox. scheduled_at, template, topic_id are refused with 422 rather than ignored.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"required":false,"description":"Repeat a request safely for 24 hours. A replay carries Idempotent-Replayed: true","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"},"to":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"reply_to":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"subject":{"type":"string","minLength":1},"html":{"type":"string"},"text":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1},"content":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["Buffer"]},"data":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255}}},"required":["type","data"]}],"description":"Base64 content, or a serialised Node Buffer"},"path":{"type":"string","description":"A public https URL Duta downloads. Not accepted in a batch"},"content_type":{"type":"string","description":"Inferred from the filename when left out"},"content_id":{"type":"string","description":"For inline images referenced as cid: in the HTML"}}}},"tags":{"anyOf":[{"type":"object","additionalProperties":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"}},{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"},"value":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"}},"required":["name","value"]}}]}},"required":["from","to","subject"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listEmails","tags":["Emails"],"summary":"List emails","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"description":"1 to 100. Default 50","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"description":"The next value from the previous page","name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"description":"Matches subject, to and from","name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}},"has_more":{"type":"boolean"},"next":{"type":["string","null"],"description":"Pass as after to get the following page"}},"required":["data","has_more","next"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/emails/batch":{"post":{"operationId":"sendBatch","tags":["Emails"],"summary":"Send up to 100 emails","description":"Strict by default: one invalid email and none are sent. With x-batch-validation: permissive the valid ones are sent and the rest listed in errors by index. Attachments by path are not accepted here.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"required":false,"description":"Repeat a request safely for 24 hours. A replay carries Idempotent-Replayed: true","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","enum":["strict","permissive"]},"required":false,"name":"x-batch-validation","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"from":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"},"to":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"cc":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"bcc":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"reply_to":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}],"description":"An address as \"Name <email>\" or plain email, or an object with email and name"}}]},"subject":{"type":"string","minLength":1},"html":{"type":"string"},"text":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1},"content":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["Buffer"]},"data":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255}}},"required":["type","data"]}],"description":"Base64 content, or a serialised Node Buffer"},"path":{"type":"string","description":"A public https URL Duta downloads. Not accepted in a batch"},"content_type":{"type":"string","description":"Inferred from the filename when left out"},"content_id":{"type":"string","description":"For inline images referenced as cid: in the HTML"}}}},"tags":{"anyOf":[{"type":"object","additionalProperties":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"}},{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"},"value":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"}},"required":["name","value"]}}]}},"required":["from","to","subject"]},"minItems":1,"maxItems":100}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SendResult"}},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["index","message","code","name"]}}},"required":["data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/emails/{id}":{"get":{"operationId":"getEmail","tags":["Emails"],"summary":"Retrieve an email","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Email"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/emails/{id}/body":{"get":{"operationId":"getEmailBody","tags":["Emails"],"summary":"Retrieve an email's archived content","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailBody"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"post":{"operationId":"createDomain","tags":["Domains"],"summary":"Add a domain","description":"Returns the two DNS records to publish. region is accepted and ignored: Duta sends from one region.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":253,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$","description":"The domain to send from, such as example.com"},"domain":{"type":"string","minLength":3,"maxLength":253,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$","description":"The same as name, under Duta's original spelling"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listDomains","tags":["Domains"],"summary":"List domains","security":[{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"has_more":{"type":"boolean","enum":[false]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainSummary"}}},"required":["object","has_more","data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"get":{"operationId":"getDomain","tags":["Domains"],"summary":"Retrieve a domain","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteDomain","tags":["Domains"],"summary":"Remove a domain","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["domain"]},"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]},"status":{"type":"string","enum":["revoked"]}},"required":["object","id","deleted","status"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"operationId":"verifyDomain","tags":["Domains"],"summary":"Check a domain's DNS now","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainVerify"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys":{"post":{"operationId":"createApiKey","tags":["API keys"],"summary":"Create an API key","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"permission":{"type":"string","enum":["full_access","sending_access"],"description":"Defaults to sending_access. full_access can also manage domains, keys and webhooks"},"scope":{"type":"string","enum":["send","full"],"description":"The same as permission, under Duta's original spelling"},"domain_id":{"description":"Not supported yet. Sending it is refused"}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listApiKeys","tags":["API keys"],"summary":"List API keys","security":[{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"has_more":{"type":"boolean","enum":[false]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["object","has_more","data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys/{id}":{"delete":{"operationId":"deleteApiKey","tags":["API keys"],"summary":"Revoke an API key","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["api_key"]},"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]},"status":{"type":"string","enum":["revoked"]}},"required":["object","id","deleted","status"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Add a webhook endpoint","description":"Events: email.sent, email.delivered, email.bounced, email.complained, email.failed, email.delivery_delayed, email.opened, email.clicked. Up to 10 endpoints.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","format":"uri","description":"A public https URL"},"url":{"type":"string","format":"uri","description":"The same as endpoint, under Duta's original spelling"},"events":{"type":"array","items":{"type":"string","enum":["email.sent","email.delivered","email.bounced","email.complained","email.failed","email.delivery_delayed","email.opened","email.clicked"]},"description":"Leave out or empty for every event"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhook"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"has_more":{"type":"boolean","enum":[false]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["object","has_more","data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Retrieve a webhook endpoint","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Delete a webhook endpoint","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["deleted"]}},"required":["id","status"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Webhooks"],"summary":"List delivery attempts","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"description":"1 to 100. Default 50","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"description":"The next value from the previous page","name":"after","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"},"next":{"type":["string","null"],"description":"Pass as after to get the following page"}},"required":["data","has_more","next"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"testWebhook","tags":["Webhooks"],"summary":"Send a signed test delivery","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"type":"integer"},"error":{"type":"string","enum":["unreachable"]}},"required":["delivered"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}/enable":{"post":{"operationId":"enableWebhook","tags":["Webhooks"],"summary":"Enable a disabled endpoint","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active"]}},"required":["id","status"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key has sending access only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suppressions":{"get":{"operationId":"listSuppressions","tags":["Suppressions"],"summary":"List suppressed addresses","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"description":"Matches the address","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"description":"1 to 500. Default 100","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"description":"The next value from the previous page","name":"after","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"has_more":{"type":"boolean"},"next":{"type":["string","null"],"description":"Pass as after to get the following page"}},"required":["data","has_more","next"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSuppression","tags":["Suppressions"],"summary":"Suppress an address","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254},"reason":{"type":"string","enum":["manual"],"default":"manual"}},"required":["email"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","enum":["manual"]},"created_at":{"type":"string","format":"date-time","description":"ISO 8601"}},"required":["email","reason","created_at"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suppressions/{email}":{"delete":{"operationId":"deleteSuppression","tags":["Suppressions"],"summary":"Remove a manual suppression","description":"Bounces, complaints and unsubscribes are permanent and answer 403.","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"email","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"status":{"type":"string","enum":["removed"]}},"required":["email","status"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/logs":{"get":{"operationId":"listLogs","tags":["Logs"],"summary":"List API requests","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"description":"1 to 100. Default 50","name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"description":"The next value from the previous page","name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"description":"Matches the path","name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"description":"A code such as 404, or a class: 2, 4 or 5","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"method","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/LogSummary"}},"has_more":{"type":"boolean"},"next":{"type":["string","null"],"description":"Pass as after to get the following page"}},"required":["data","has_more","next"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/logs/{id}":{"get":{"operationId":"getLog","tags":["Logs"],"summary":"Retrieve an API request","security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"getUsage","tags":["Usage"],"summary":"This month's usage and plan limits","security":[{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request was refused. code says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Retry after the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}