{"openapi":"3.1.0","info":{"title":"Relayit API","version":"0.0.0","description":"HTTP API for sending messages through Relayit. Prefer POST /messages/email for new integrations."},"paths":{"/messages/email":{"post":{"tags":["Send"],"operationId":"send.sendEmail","parameters":[{"name":"app","in":"header","schema":{"type":"string","description":"App attribution (must pair with environment)."},"required":false},{"name":"environment","in":"header","schema":{"type":"string","description":"App Environment attribution (must pair with app)."},"required":false},{"name":"idempotency-key","in":"header","schema":{"type":"string","maxLength":256,"description":"Idempotency Key — same key returns the original Message."},"required":false},{"name":"x-api-key","in":"header","schema":{"type":"string","description":"The API key to use for the request."},"required":true}],"security":[],"responses":{"201":{"description":"Success","content":{"application/json;charset=utf-8":{"schema":{"type":"object","properties":{"id":{"type":"string"},"stripped":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string"}},"required":["email","reason"],"additionalProperties":false}}},"required":["id"],"additionalProperties":false}}}},"400":{"description":"InvalidAppEnvironment","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/InvalidAppEnvironmentEncoded"}},"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["Bad Request"]}}}},"403":{"description":"InvalidApiKey","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/InvalidApiKeyEncoded"}}}},"404":{"description":"Error","content":{"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["NOT_FOUND"]}}}},"413":{"description":"PayloadTooLarge","content":{"application/json;charset=utf-8":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PayloadTooLargeEncoded"},{"$ref":"#/components/schemas/PayloadTooLargeEncoded"}]}}}},"422":{"description":"SendRefused | AcceptRefused | SchemaValidationFailed","content":{"application/json;charset=utf-8":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SendRefusedEncoded"},{"$ref":"#/components/schemas/AcceptRefusedEncoded"}]}},"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"},{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"}]}}}},"429":{"description":"SendLimitExceeded","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/SendLimitExceededEncoded"}}}},"500":{"description":"InternalServerError","content":{"application/json;charset=utf-8":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InternalServerErrorEncoded"},{"$ref":"#/components/schemas/InternalServerErrorEncoded"}]}}}}},"description":"Create a transactional email. Provide inline html/text or a template, not both.","summary":"Send email","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":1,"description":"Sender. Email or \"Name <email@example.com>\"."},"to":{"$ref":"#/components/schemas/Recipient"},"subject":{"type":"string","description":"Email subject line. Required for inline html/text; optional with template (overrides template subject when set)."},"bcc":{"$ref":"#/components/schemas/Recipient"},"cc":{"$ref":"#/components/schemas/Recipient"},"scheduled_at":{"type":"string","minLength":1,"description":"When to send. ISO 8601 preferred."},"reply_to":{"$ref":"#/components/schemas/EmailAddressList"},"html":{"type":"string"},"text":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom headers to add to the email."},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"},"maxItems":20,"description":"Files to attach, up to 20: each at most 10485760 bytes once decoded or downloaded, and all together at most 29230769 bytes, what fits in an email of SES's 40 MB maximum once base64 encoded."},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","minLength":1,"maxLength":256}},"required":["name","value"],"additionalProperties":true,"title":"Tag"},"description":"Tags as { name, value } pairs."},"topic_id":{"not":{},"description":"Not supported, and refused with 422 whatever its value: this endpoint sends transactional email and applies no Topic consent. Leave it out."},"template":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Template id (`tmpl_…`) or active Template slug."},"variables":{"type":"object","description":"Primitive Template variable values (string|number) or reactEmail props (structured JSON)."}},"required":["id"],"additionalProperties":true}},"required":["from","to"],"additionalProperties":true}}},"required":true}}},"/send/{project}/raw/email":{"post":{"tags":["Legacy Send"],"operationId":"legacySend.sendRawEmail","parameters":[{"name":"project","in":"path","schema":{"type":"string","minLength":1},"required":true},{"name":"x-api-key","in":"header","schema":{"type":"string","description":"The API key; `X-API-Key` works too."},"required":false}],"security":[],"responses":{"201":{"description":"Success","content":{"application/json;charset=utf-8":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued"]}},"required":["id","status"],"additionalProperties":false}}}},"400":{"description":"LegacyRefused","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyRefusedEncoded"}},"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["Bad Request"]}}}},"401":{"description":"LegacyUnauthorized","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyUnauthorizedEncoded"}}}},"404":{"description":"LegacyProjectNotFound","content":{"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["NOT_FOUND"]}},"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyProjectNotFoundEncoded"}}}},"413":{"description":"PayloadTooLarge","content":{"application/json;charset=utf-8":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PayloadTooLargeEncoded"},{"$ref":"#/components/schemas/PayloadTooLargeEncoded"}]}}}},"422":{"description":"SchemaValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"},{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"}]}}}},"429":{"description":"LegacyLimitExceeded","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyLimitExceededEncoded"}}}},"500":{"description":"LegacyServerError","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyServerErrorEncoded"}}}}},"description":"Compatibility send with inline html/text. Prefer POST /messages/email.","summary":"Send raw email","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"app":{"type":"string"},"appEnvironment":{"type":"string"},"attachments":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"contentId":{"type":"string"},"contentType":{"type":"string"},"filename":{"type":"string","minLength":1}},"required":["content","filename"],"additionalProperties":false,"title":"Base64 attachment"},{"type":"object","properties":{"contentId":{"type":"string"},"contentType":{"type":"string"},"filename":{"type":"string","minLength":1},"path":{"type":"string","format":"uri","description":"HTTPS URL of a hosted file to attach, fetched as on `/messages/email`. Only `https:` URLs whose host resolves to a public address are fetched; a redirect is refused, not followed."}},"required":["filename","path"],"additionalProperties":false,"title":"Hosted attachment"}]},"maxItems":20,"description":"Files to attach, up to 20: each at most 10485760 bytes once decoded or downloaded, and all together at most 29230769 bytes, what fits in an email of SES's 40 MB maximum once base64 encoded."},"contact":{"type":"object","properties":{"externalIdentifiers":{"type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"}},"additionalProperties":false},"from":{"type":"string","format":"email"},"to":{"type":"string","format":"email"},"payload":{"anyOf":[{"type":"object","properties":{"html":{"type":"string"},"subject":{"type":"string","minLength":1},"text":{"type":"string"}},"required":["html","subject"],"additionalProperties":false},{"type":"object","properties":{"html":{"type":"string"},"subject":{"type":"string","minLength":1},"text":{"type":"string"}},"required":["subject","text"],"additionalProperties":false}]}},"required":["to","payload"],"additionalProperties":false}}},"required":true}}},"/send/{project}/template/email":{"post":{"tags":["Legacy Send"],"operationId":"legacySend.sendTemplateEmail","parameters":[{"name":"project","in":"path","schema":{"type":"string","minLength":1},"required":true},{"name":"x-api-key","in":"header","schema":{"type":"string","description":"The API key; `X-API-Key` works too."},"required":false}],"security":[],"responses":{"201":{"description":"Success","content":{"application/json;charset=utf-8":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued"]}},"required":["id","status"],"additionalProperties":false}}}},"400":{"description":"LegacyRefused","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyRefusedEncoded"}},"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["Bad Request"]}}}},"401":{"description":"LegacyUnauthorized","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyUnauthorizedEncoded"}}}},"404":{"description":"LegacyProjectNotFound","content":{"text/plain;charset=utf-8":{"schema":{"type":"string","enum":["NOT_FOUND"]}},"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyProjectNotFoundEncoded"}}}},"413":{"description":"PayloadTooLarge","content":{"application/json;charset=utf-8":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PayloadTooLargeEncoded"},{"$ref":"#/components/schemas/PayloadTooLargeEncoded"}]}}}},"422":{"description":"SchemaValidationFailed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"},{"$ref":"#/components/schemas/SchemaValidationFailedEncoded"}]}}}},"429":{"description":"LegacyLimitExceeded","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyLimitExceededEncoded"}}}},"500":{"description":"LegacyServerError","content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/LegacyServerErrorEncoded"}}}}},"description":"Compatibility send using a Template. Prefer POST /messages/email.","summary":"Send template email","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"app":{"type":"string"},"appEnvironment":{"type":"string"},"attachments":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"contentId":{"type":"string"},"contentType":{"type":"string"},"filename":{"type":"string","minLength":1}},"required":["content","filename"],"additionalProperties":false,"title":"Base64 attachment"},{"type":"object","properties":{"contentId":{"type":"string"},"contentType":{"type":"string"},"filename":{"type":"string","minLength":1},"path":{"type":"string","format":"uri","description":"HTTPS URL of a hosted file to attach, fetched as on `/messages/email`. Only `https:` URLs whose host resolves to a public address are fetched; a redirect is refused, not followed."}},"required":["filename","path"],"additionalProperties":false,"title":"Hosted attachment"}]},"maxItems":20,"description":"Files to attach, up to 20: each at most 10485760 bytes once decoded or downloaded, and all together at most 29230769 bytes, what fits in an email of SES's 40 MB maximum once base64 encoded."},"contact":{"type":"object","properties":{"externalIdentifiers":{"type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"}},"additionalProperties":false},"from":{"type":"string","format":"email"},"to":{"type":"string","format":"email"},"template":{"type":"object","properties":{"props":{"type":"object"},"slug":{"type":"string","minLength":1}},"required":["slug"],"additionalProperties":false}},"required":["to","template"],"additionalProperties":false}}},"required":true}}}},"components":{"schemas":{"LegacyUnauthorizedEncoded":{"type":"object","properties":{"details":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["details","message"],"additionalProperties":false},"PayloadTooLargeEncoded":{"type":"object","properties":{"code":{"type":"string","enum":["payload_too_large"]},"message":{"type":"string","enum":["Request body exceeds the 50 MiB limit."]}},"required":["code","message"],"additionalProperties":false},"SchemaValidationFailedEncoded":{"type":"object","properties":{"type":{"type":"string","enum":["validation"]},"on":{"type":"string","enum":["body","headers"]},"property":{"type":"string"},"message":{"type":"string"},"summary":{"type":"string"}},"required":["type","on","property","message","summary"],"additionalProperties":false},"LegacyProjectNotFoundEncoded":{"type":"object","properties":{"details":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["details","message"],"additionalProperties":false},"LegacyServerErrorEncoded":{"type":"object","properties":{"details":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["details","message"],"additionalProperties":false},"LegacyLimitExceededEncoded":{"type":"object","properties":{"details":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["details","message"],"additionalProperties":false},"LegacyRefusedEncoded":{"type":"object","properties":{"details":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["details","message"],"additionalProperties":false},"InvalidApiKeyEncoded":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_api_key"]},"message":{"type":"string","enum":["Invalid API key"]}},"required":["code","message"],"additionalProperties":false},"InternalServerErrorEncoded":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"SendLimitExceededEncoded":{"type":"object","properties":{"code":{"type":"string","enum":["daily_limit_exceeded","monthly_limit_exceeded"]},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["code","message","retry_after_seconds"],"additionalProperties":false},"InvalidAppEnvironmentEncoded":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_app_environment"]},"message":{"type":"string","enum":["App and Environment headers must both be present, or both omitted."]}},"required":["code","message"],"additionalProperties":false},"AcceptRefusedEncoded":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{"detail":{"type":"string"},"filename":{"type":"string"},"max_bytes":{"type":"number"},"reason":{"type":"string"},"status":{"type":"number"},"variable":{"type":"string"}},"additionalProperties":false}},"required":["code","message"],"additionalProperties":false},"SendRefusedEncoded":{"type":"object","properties":{"message":{"type":"string"},"on":{"type":"string","enum":["body"]},"type":{"type":"string","enum":["validation"]}},"required":["message","on","type"],"additionalProperties":false},"Attachment":{"anyOf":[{"type":"object","properties":{"content_id":{"type":"string","description":"Inline image id for HTML, e.g. <img src=\"cid:your-id\">."},"content_type":{"type":"string","description":"MIME type; derived from filename when omitted."},"filename":{"type":"string","minLength":1,"description":"Attachment filename including extension (used for MIME type)."},"content":{"type":"string","description":"Base64-encoded file contents."},"path":{"not":{}}},"required":["filename","content"],"additionalProperties":true,"title":"Base64 attachment"},{"type":"object","properties":{"content_id":{"type":"string","description":"Inline image id for HTML, e.g. <img src=\"cid:your-id\">."},"content_type":{"type":"string","description":"MIME type; derived from filename when omitted."},"filename":{"type":"string","minLength":1,"description":"Attachment filename including extension (used for MIME type)."},"content":{"not":{}},"path":{"type":"string","format":"uri","description":"HTTPS URL of a hosted file to attach, fetched when the send is accepted, within the 30 seconds all of a send's attachments have together. Only `https:` URLs whose host resolves to a public address are fetched, each address in turn until one connects; a redirect is refused, not followed."}},"required":["filename","path"],"additionalProperties":true,"title":"Hosted attachment"}],"title":"Attachment"},"EmailAddressList":{"anyOf":[{"type":"string","format":"email","title":"Email address"},{"type":"array","items":{"type":"string","format":"email"},"maxItems":50,"title":"Email addresses"}],"title":"Email address list"},"Recipient":{"anyOf":[{"type":"string","format":"email","title":"Email address"},{"type":"array","items":{"type":"string","format":"email"},"maxItems":50,"title":"Email addresses"},{"$ref":"#/components/schemas/Contact"},{"type":"array","items":{"$ref":"#/components/schemas/Contact"},"maxItems":50,"title":"Contacts"}],"title":"Recipient","description":"Address, address list, or contact objects."},"Contact":{"type":"object","properties":{"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"},"properties":{"type":"object","additionalProperties":{"type":"string"}}},"required":["email"],"additionalProperties":true,"title":"Contact"}},"securitySchemes":{}},"security":[],"tags":[{"name":"Send","description":"Current send endpoints"},{"name":"Legacy Send","description":"Compatibility send endpoints for existing integrations"}]}