# Send an email message Sends an email message. Endpoint: PATCH /email-messages/{id} Version: latest Security: SecretApiKey, JWT ## Path parameters: - `id` (string, required) ID of the resource. ## Request fields (application/json): - `status` (string, required) Status of the email message. Enum: "outbox" ## Response 200 fields (application/json): - `id` (string) ID of the email message. Example: "mail_msg_0YVCNR8ZRBCVMAX28DP4XRFZVA" - `status` (string) Status of the email message. Enum: "draft", "outbox", "sent", "failed" - `metadata` (object,null) Metadata associated with the email message. Example: {"eventType":"subscription-canceled"} - `credentialHash` (string,null) ID of the SMTP or Email Service Provider (ESP) credential. Example: "b120c2ca-6c2b-4690-9dff-3b0d87852dc7" - `from` (string, required) Email address of the sender. Example: "from-example@rebilly.com" - `to` (array, required) List of email addresses to which the email message is sent. Example: ["to-example@rebilly.com"] - `cc` (array) List of CC email addresses to which the email message is sent. Example: ["cc-example@rebilly.com"] - `bcc` (array) List of BCC email addresses to which the email message is sent. Example: ["cc-example@rebilly.com"] - `subject` (string, required) Subject of the email message. Example: "Welcome dear customer!" - `text` (string, required) Body of the email message in plain text. Example: "Email message text body" - `html` (string, required) Body of the email message in HTML format. Example: "

Email message html body

" - `attachments` (array) Attachments of the email message. - `attachments.resourceType` (string, required) Type of attachment resource. Example: "invoice" - `attachments.resourceId` (string, required) ID of the attachment resource. Example: "att_0YV7J787J0DW0918MQQMDHWA7M" - `responseCode` (integer,null) Status code returned by a mail service after an attempt to send email. Example: 250 - `responseBody` (string,null) Body of response returned by a mail service after an attempt to send email. - `initiatedTime` (string,null) Date and time when the email is initiated. - `sentTime` (string,null) Date and time when the email is sent. - `createdTime` (string) Date and time which is set automatically when the resource is created. - `updatedTime` (string) Date and time which updates automatically when the resource is updated. - `_links` (array) Related links. - `_links.href` (string) Link URL. - `_links.rel` (string) Type of link. Enum: "self" ## Response 401 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 403 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 409 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 422 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - `invalidFields` (array) Invalid field details. Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}] - `invalidFields.field` (string) Name of the field. Dot notation is used for nested object field names. - `invalidFields.message` (string) Message field. ## Response 429 fields (application/json): - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". Example: "about:blank" - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. Example: "Rate Limit Exceeded" - `status` (integer) HTTP status code. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. Example: "A request cannot be executed because the user has sent too many requests within a certain period of time" - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.