{ "swagger": "2.0", "info": { "title": "CommunicationEmailClient", "description": "Azure Communication Email Service", "version": "2021-10-01-preview" }, "paths": { "/emails/{messageId}/status": { "get": { "tags": [ "EmailGetSendStatus" ], "summary": "Gets the status of a message sent previously.", "operationId": "Email_GetSendStatus", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "messageId", "description": "System generated message id (GUID) returned from a previous call to send email", "required": true, "type": "string" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "default": { "description": "Error", "headers": { "x-ms-error-code": { "description": "Error code - this will be the same as the code in the error property in the response body.", "type": "string" } }, "schema": { "$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" } }, "200": { "description": "Message status was successfully retrieved.", "headers": { "Retry-After": { "description": "Amount of time client should wait before retrying the request, specified in seconds ", "type": "integer" } }, "schema": { "$ref": "#/definitions/SendStatusResult" } } }, "x-ms-examples": { "Get Message Status": { "$ref": "./examples/GetSendStatus.json" } } } }, "/emails:send": { "post": { "tags": [ "EmailSend" ], "summary": "Queues an email message to be sent to one or more recipients", "operationId": "Email_Send", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "header", "name": "repeatability-request-id", "description": "If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs.", "type": "string", "required": true }, { "in": "header", "name": "repeatability-first-sent", "description": "Must be sent by clients to specify that a request is repeatable. Repeatability-First-Sent is used to specify the date and time at which the request was first created in the IMF-fix date form of HTTP-date as defined in RFC7231. eg- Tue, 26 Mar 2019 16:06:51 GMT", "type": "string", "required": true }, { "$ref": "#/parameters/ApiVersionParameter" }, { "in": "body", "name": "emailMessage", "description": "Message payload for sending an email", "required": true, "schema": { "$ref": "#/definitions/EmailMessage" } } ], "responses": { "default": { "description": "Error", "headers": { "x-ms-error-code": { "description": "Error code - this will be the same as the code in the error property in the response body.", "type": "string" } }, "schema": { "$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse" } }, "202": { "description": "Message accepted, the `Operation-Location` header contains the URL to poll for the message status.", "headers": { "Repeatability-Result": { "description": "Status of a repeatable request.", "type": "string" }, "Operation-Location": { "description": "Location url of where to poll the status of this message from.", "type": "string" }, "Retry-After": { "description": "Amount of time client should wait before retrying the request, specified in seconds ", "type": "integer" }, "x-ms-request-id": { "description": "System generated GUID indicating the id of this specific message, to be used for tracking purposes.", "type": "string" } } } }, "x-ms-examples": { "Send Email": { "$ref": "./examples/SendEmail.json" } } } } }, "definitions": { "EmailMessage": { "description": "Message payload for sending an email", "required": [ "sender", "content", "recipients" ], "type": "object", "properties": { "headers": { "description": "Custom email headers to be passed.", "type": "array", "x-ms-client-name": "CustomHeaders", "items": { "$ref": "#/definitions/EmailCustomHeader" } }, "sender": { "description": "Sender email address from a verified domain.", "type": "string", "example": "info@contoso.com" }, "content": { "description": "Email content to be sent.", "$ref": "#/definitions/EmailContent" }, "importance": { "description": "The importance type for the email.", "$ref": "#/definitions/EmailImportance" }, "recipients": { "description": "Recipients for the email.", "$ref": "#/definitions/EmailRecipients" }, "attachments": { "description": "list of attachments", "type": "array", "items": { "$ref": "#/definitions/EmailAttachment" } }, "replyTo": { "description": "Email addresses where recipients' replies will be sent to.", "type": "array", "items": { "$ref": "#/definitions/EmailAddress" } }, "disableUserEngagementTracking": { "description": "Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.", "type": "boolean" } } }, "EmailCustomHeader": { "description": "Custom header for email.", "type": "object", "required": [ "name", "value" ], "properties": { "name": { "description": "Header name.", "type": "string", "example": "" }, "value": { "description": "Header value.", "type": "string", "example": "" } } }, "EmailAddress": { "description": "An object representing the email address and its display name", "type": "object", "required": [ "email" ], "properties": { "email": { "description": "Email address.", "type": "string", "example": "abc@contoso.com" }, "displayName": { "description": "Email display name.", "type": "string", "example": "abc" } } }, "EmailContent": { "description": "Content of the email.", "type": "object", "required": [ "subject" ], "properties": { "subject": { "description": "Subject of the email message", "type": "string", "example": "An exciting offer especially for you!" }, "plainText": { "description": "Plain text version of the email message.", "type": "string", "example": "This exciting offer was created especially for you, our most loyal customer." }, "html": { "description": "Html version of the email message.", "type": "string", "example": "