Send an email in Dynatrace with the Email API, using UTF-8 and an optional notification settings URL in the message body.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/email/v1/emails |
You provide recipient lists, subject, body, and optional notificationSettingsUrl in the request body. Dynatrace accepts the request or partially accepts it and sends the email using no-reply@apps.dynatrace.com as the sender.
To execute this request, you need a platform token or OAuth access token with email:emails:send scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Send | - | body | Required |
SendEmailRequest object| Element | Type | Description | Required |
|---|---|---|---|
| toRecipients | Recipient | - | Optional |
| ccRecipients | Recipient | - | Optional |
| bccRecipients | Recipient | - | Optional |
| subject | string | - | Optional |
| body | Email | - | Optional |
| notificationSettingsUrl | string | - | Optional |
RecipientLists object| Element | Type | Description | Required |
|---|---|---|---|
| emailAddresses | string[] | - | Optional |
| ssoUserIds | string[] | - | Optional |
| ssoGroupIds | string[] | - | Optional |
EmailBody object| Element | Type | Description | Required |
|---|---|---|---|
| contentType | string | -The element can hold these values
| Optional |
| body | string | - | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"toRecipients": {"emailAddresses": ["string"],"ssoUserIds": ["string"],"ssoGroupIds": ["string"]},"ccRecipients": {},"bccRecipients": {},"subject": "string","body": {"contentType": "text/plain","body": "string"},"notificationSettingsUrl": "string"}
| Code | Type | Description |
|---|---|---|
| 202 | Send | Request accepted or partially accepted |
| 400 | Error | Bad request |
| 401 | Error | Unauthorized |
| 403 | Error | Forbidden |
| 413 | Error | Payload too large |
| 429 | Error | Too many requests |
| 500 | Error | Internal Server Error |
| 503 | Error | Service Unavailable |
ErrorResponse object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | Http status code of the response |
| message | string | - |
| retryAfterSeconds | string | - |
| details | Error | - |
| help | string | Link to a help page |
ErrorDetails object| Element | Type | Description |
|---|---|---|
| errorRef | string | Represents a reference of the error. |
| traceId | string | Unique identifier that follows the path of a single request. |
| errorCode | string | Unique code for error. |
| additionalDetails | Error | Additional details specific for a certain errorCode in form of String to Object map. |
| missingScopes | string[] | List of missing permissions |
ErrorCodeAttributes objectAdditional details specific for a certain errorCode in form of String to Object map.
{"error": {"code": 400,"message": "Too many recipients, current number of recipients is 101, maximum allowed is 100","details": {"errorRef": "fddb6700-a451-40ec-80ba-d84c10c87896","traceId": "c995b75610ccdfb97c23a5f0b47d9eea","errorCode": "TooManyRecipients","requestId": "f4ca73b0-f3f0-4007-8058-8fbb5c7c2ca0","additionalDetails": {"value": 101,"limit": 100}}}}