{"openapi":"3.1.0","info":{"title":"API Despacho","version":"1.0.0","description":"API de e-mail transacional. Autentique com `Authorization: Bearer dp_live_...` (produção) ou `dp_test_...` (teste: valida tudo, nada é enviado de verdade). Erros seguem um formato único com `code` estável."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key do projeto"}},"schemas":{"ErrorInput":{"type":"object","properties":{"type":{"type":"string","description":"URL da página de documentação do erro"},"code":{"type":"string","description":"Código estável do erro; use este campo no seu código"},"message":{"type":"string","description":"Explicação em português"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"request_id":{"type":"string"},"details":{}},"required":["type","code","message","status","request_id"]},"SendEmailRequestInput":{"type":"object","properties":{"from":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""},"to":{"anyOf":[{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""},{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}],"description":"Destinatários. Até 50 somando to, cc e bcc."},"cc":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"bcc":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"reply_to":{"anyOf":[{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""},{"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"subject":{"type":"string","minLength":1,"maxLength":998},"html":{"description":"Corpo em HTML. Informe html, text ou os dois.","type":"string"},"text":{"description":"Corpo em texto. Se vier só html, a versão em texto é gerada.","type":"string"},"headers":{"description":"Cabeçalhos extras, como List-Unsubscribe","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attachments":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","description":"Conteúdo em base64"},"content_type":{"type":"string","maxLength":255}},"required":["filename","content"]}},"tags":{"description":"Até 10 pares chave/valor para filtrar depois","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"description":"high passa na frente na fila. Padrão: normal","type":"string","enum":["high","normal"]}},"required":["from","to","subject"]},"SendEmailResponseInput":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"queued"},"suppressed":{"type":"array","items":{"type":"string"},"description":"Destinatários retirados por estarem na lista de supressão"}},"required":["id","status","suppressed"]},"EmailSummaryInput":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed"]},"env":{"type":"string","enum":["live","test"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string"},"sent_at":{"type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}},"required":["code","detail"]},{"type":"null"}]}},"required":["id","status","env","from","to","cc","bcc","subject","tags","priority","source","created_at","sent_at","error"]},"EmailInput":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed"]},"env":{"type":"string","enum":["live","test"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string"},"sent_at":{"type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}},"required":["code","detail"]},{"type":"null"}]},"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"last_event_at":{"type":["string","null"]},"bounce":{"anyOf":[{"type":"object","properties":{"type":{"type":["string","null"]},"detail":{"type":["string","null"]}},"required":["type","detail"]},{"type":"null"}]}},"required":["email","kind","status","last_event_at","bounce"]}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"recipient":{"type":"string"},"created_at":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","recipient","created_at","data"]}}},"required":["id","status","env","from","to","cc","bcc","subject","tags","priority","source","created_at","sent_at","error","recipients","events"]},"EmailListInput":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummaryInput"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]},"DomainInput":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed"]},"dkim_status":{"type":"string"},"mail_from_status":{"type":"string"},"dmarc_status":{"type":"string"},"mail_from_domain":{"type":"string"},"tracking_enabled":{"type":"boolean"},"region":{"type":"string"},"dns_provider":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}}},"required":["id","label","steps"]},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"name_prefix":{"type":"string"},"value":{"type":"string"},"priority":{"type":["number","null"]},"required":{"type":"boolean"},"status":{"type":"string","description":"pending | ok | missing | wrong | warning"},"found":{"type":"array","items":{"type":"string"}},"hint":{"type":["string","null"]}},"required":["purpose","type","name","name_prefix","value","priority","required","status","found","hint"]}},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_checked_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]}},"required":["id","domain","status","dkim_status","mail_from_status","dmarc_status","mail_from_domain","tracking_enabled","region","dns_provider","records","created_at","verified_at","last_checked_at","expires_at"]},"SuppressionInput":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","enum":["hard_bounce","soft_bounce","complaint","manual"]},"source_email_id":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["email","reason","source_email_id","expires_at","created_at"]},"WebhookInput":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","url","events","active","disabled_reason","created_at"]},"Error":{"type":"object","properties":{"type":{"type":"string","description":"URL da página de documentação do erro"},"code":{"type":"string","description":"Código estável do erro; use este campo no seu código"},"message":{"type":"string","description":"Explicação em português"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"request_id":{"type":"string"},"details":{}},"required":["type","code","message","status","request_id"],"additionalProperties":false},"SendEmailRequest":{"type":"object","properties":{"from":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""},"to":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}],"description":"Destinatários. Até 50 somando to, cc e bcc."},"cc":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"bcc":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"reply_to":{"anyOf":[{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""},{"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":320,"description":"Endereço de e-mail, opcionalmente com nome: \"Nome <nome@dominio.com>\""}}]},"subject":{"type":"string","minLength":1,"maxLength":998},"html":{"description":"Corpo em HTML. Informe html, text ou os dois.","type":"string"},"text":{"description":"Corpo em texto. Se vier só html, a versão em texto é gerada.","type":"string"},"headers":{"description":"Cabeçalhos extras, como List-Unsubscribe","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attachments":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","description":"Conteúdo em base64"},"content_type":{"type":"string","maxLength":255}},"required":["filename","content"],"additionalProperties":false}},"tags":{"description":"Até 10 pares chave/valor para filtrar depois","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"description":"high passa na frente na fila. Padrão: normal","type":"string","enum":["high","normal"]}},"required":["from","to","subject"],"additionalProperties":false},"SendEmailResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"queued"},"suppressed":{"type":"array","items":{"type":"string"},"description":"Destinatários retirados por estarem na lista de supressão"}},"required":["id","status","suppressed"],"additionalProperties":false},"EmailSummary":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed"]},"env":{"type":"string","enum":["live","test"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string"},"sent_at":{"type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}},"required":["code","detail"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","env","from","to","cc","bcc","subject","tags","priority","source","created_at","sent_at","error"],"additionalProperties":false},"Email":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed"]},"env":{"type":"string","enum":["live","test"]},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"tags":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"priority":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string"},"sent_at":{"type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}},"required":["code","detail"],"additionalProperties":false},{"type":"null"}]},"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"last_event_at":{"type":["string","null"]},"bounce":{"anyOf":[{"type":"object","properties":{"type":{"type":["string","null"]},"detail":{"type":["string","null"]}},"required":["type","detail"],"additionalProperties":false},{"type":"null"}]}},"required":["email","kind","status","last_event_at","bounce"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"recipient":{"type":"string"},"created_at":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","recipient","created_at","data"],"additionalProperties":false}}},"required":["id","status","env","from","to","cc","bcc","subject","tags","priority","source","created_at","sent_at","error","recipients","events"],"additionalProperties":false},"EmailList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false},"Domain":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed"]},"dkim_status":{"type":"string"},"mail_from_status":{"type":"string"},"dmarc_status":{"type":"string"},"mail_from_domain":{"type":"string"},"tracking_enabled":{"type":"boolean"},"region":{"type":"string"},"dns_provider":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}}},"required":["id","label","steps"],"additionalProperties":false},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"name_prefix":{"type":"string"},"value":{"type":"string"},"priority":{"type":["number","null"]},"required":{"type":"boolean"},"status":{"type":"string","description":"pending | ok | missing | wrong | warning"},"found":{"type":"array","items":{"type":"string"}},"hint":{"type":["string","null"]}},"required":["purpose","type","name","name_prefix","value","priority","required","status","found","hint"],"additionalProperties":false}},"created_at":{"type":"string"},"verified_at":{"type":["string","null"]},"last_checked_at":{"type":["string","null"]},"expires_at":{"type":["string","null"]}},"required":["id","domain","status","dkim_status","mail_from_status","dmarc_status","mail_from_domain","tracking_enabled","region","dns_provider","records","created_at","verified_at","last_checked_at","expires_at"],"additionalProperties":false},"Suppression":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string","enum":["hard_bounce","soft_bounce","complaint","manual"]},"source_email_id":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["email","reason","source_email_id","expires_at","created_at"],"additionalProperties":false},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","url","events","active","disabled_reason","created_at"],"additionalProperties":false}}},"paths":{"/emails":{"post":{"summary":"Enviar um e-mail","tags":["E-mails"],"description":"Aceita a mensagem e a coloca na fila de envio. Com o cabeçalho `Idempotency-Key` (até 255 caracteres, válido por 24 h), repetir a mesma requisição devolve a mesma resposta sem enviar de novo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequestInput"}}}},"parameters":[{"schema":{"type":"string","maxLength":255},"in":"header","name":"idempotency-key","required":false}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Listar e-mails","tags":["E-mails"],"description":"Do mais novo para o mais antigo, paginado por cursor.","parameters":[{"schema":{"type":"string","enum":["queued","sending","sent","delivered","bounced","complained","failed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false,"description":"Destinatário (busca parcial)"},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"tag","required":false,"description":"\"chave:valor\" ou só \"chave\""},{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"after","required":false,"description":"Criados a partir de (ISO 8601)"},{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"before","required":false,"description":"Criados antes de (ISO 8601)"},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Valor de next_cursor da página anterior"},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailList"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/emails/{id}":{"get":{"summary":"Consultar um e-mail","tags":["E-mails"],"description":"Mensagem, destinatários e linha do tempo de eventos.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Email"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"post":{"summary":"Adicionar um domínio","tags":["Domínios"],"description":"Devolve os registros DNS a criar. A verificação é automática (a cada 10 minutos, por até 72 horas).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253},"mail_from_subdomain":{"description":"Subdomínio do MAIL FROM. Padrão: \"envio\"","type":"string","maxLength":32}},"required":["domain"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Listar domínios","tags":["Domínios"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"get":{"summary":"Consultar um domínio","tags":["Domínios"],"description":"Status de cada registro DNS, com diagnóstico.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remover um domínio","tags":["Domínios"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/verify":{"post":{"summary":"Verificar agora","tags":["Domínios"],"description":"Força uma nova verificação, sem esperar o ciclo automático.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suppressions":{"get":{"summary":"Listar supressões","tags":["Supressões"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"email","required":false},{"schema":{"type":"string","enum":["hard_bounce","soft_bounce","complaint","manual"]},"in":"query","name":"reason","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Incluir um e-mail na supressão","tags":["Supressões"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320}},"required":["email"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suppressions/{email}":{"delete":{"summary":"Remover um e-mail da supressão","tags":["Supressões"],"description":"A remoção fica registrada em auditoria. Para remover uma supressão por reclamação é preciso `?confirm=true`.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"confirm","required":false},{"schema":{"type":"string"},"in":"path","name":"email","required":true}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks":{"post":{"summary":"Criar um endpoint de webhook","tags":["Webhooks"],"description":"Devolve o segredo de assinatura (`secret`) uma única vez. Guarde-o: ele é necessário para verificar as entregas.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000},"events":{"minItems":1,"type":"array","items":{"type":"string"},"description":"Ex.: email.delivered, email.bounced, email.complained"}},"required":["url","events"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"created_at":{"type":"string"},"secret":{"type":"string"}},"required":["id","url","events","active","disabled_reason","created_at","secret"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Listar endpoints","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhooks/{id}":{"patch":{"summary":"Alterar um endpoint","tags":["Webhooks"],"description":"Enviar `active: true` reativa um endpoint desativado por falhas.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"active":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remover um endpoint","tags":["Webhooks"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Default Response"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"servers":[{"url":"https://api.despacho.dev.br/v1"}],"tags":[{"name":"E-mails"},{"name":"Domínios"},{"name":"Supressões"},{"name":"Webhooks"}]}