Available in Classic and VPC
Request to send mail. Each send request is created as one resource (requestId). Because sending is processed asynchronously, this API returns only the acceptance result.
Request
This section describes the request format. The method and URI are as follows:
| Method | URI |
|---|---|
| POST | /mail/v2/services/{serviceId}/requests |
Request headers
For information about the headers common to all Simple & Easy Notification Service APIs, see Simple & Easy Notification Service request headers.
| Field | Required | Description |
|---|---|---|
x-ncp-lang |
Optional | Response message language
|
Request path parameters
You can use the following path parameters with your request:
| Field | Type | Required | Description |
|---|---|---|---|
serviceId |
String | Required | Mail service ID
|
Request body
You can include the following data in the body of your request:
| Field | Type | Required | Description |
|---|---|---|---|
senderAddress |
String | Conditional | Sender email address
|
senderName |
String | Optional | Sender name
|
templateNo |
Integer | Conditional | Template number
|
title |
String | Conditional | Mail subject
|
body |
String | Conditional | Mail body
|
individual |
Boolean | Optional | Whether to send individually
|
confirmAndSend |
Boolean | Optional | Whether to confirm before sending
|
advertising |
Boolean | Optional | Whether the mail is an advertisement
|
parameters |
Object | Optional | Substitution variables applied to all recipients
|
reservationDateTime |
String | Optional | Reserved sending date and time
|
attachFileIds |
Array | Optional | List of attachment IDs
|
recipients |
Array | Conditional | Recipient list: recipients
|
recipientGroupFilter |
Object | Conditional | Recipients specified by address book group: recipientGroupFilter
|
useBasicUnsubscribeMessage |
Boolean | Optional | Whether to use the default unsubscribe message
|
unsubscribeMessage |
String | Optional | Custom unsubscribe message
|
- If both
recipientsandrecipientGroupFilterare entered, the two lists are concatenated and processed. Duplicates are not removed even if the same address appears in both. In this case, two mails are sent to that address and two are deducted from the monthly sending limit. - If recipients are specified with
recipientGroupFilter, the 100,000-recipient limit does not apply. Only the monthly sending limit applies. CCandBCCare each limited to 30 recipients.- If the monthly sending limit is exceeded,
429 ResourceQuotaExceededis returned. - The acceptance response does not include the sending status. Immediately after acceptance, the status is
READYfor immediate sending orRESERVEDfor reserved sending. Check the subsequent status by polling the Get mail request API. Follow theretry-afterresponse header of that API for the polling interval.
recipients
The following describes recipients.
| Field | Type | Required | Description |
|---|---|---|---|
address |
String | Required | Recipient email address
|
name |
String | Optional | Recipient name
|
type |
String | Optional | Recipient type
|
parameters |
Object | Optional | Substitution variables applied only to this recipient
|
recipientGroupFilter
The following describes recipientGroupFilter.
| Field | Type | Required | Description |
|---|---|---|---|
operator |
String | Optional | Operator for combining group conditions
|
groups |
Array | Required | List of address book group names |
Request example
The request example is as follows:
curl --location --request POST 'https://sens.apigw.ntruss.com/mail/v2/services/ncp:mail:kr:1********2:main/requests' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'x-ncp-lang: en-US' \
--header 'Content-Type: application/json' \
--data '{
"senderAddress": "no_reply@company.com",
"senderName": "Customer Center",
"title": "Welcome, ${customer_name}.",
"body": "Your membership level has been changed from ${BEFORE_GRADE} to ${AFTER_GRADE}.",
"individual": true,
"advertising": false,
"recipients": [
{
"address": "hongildong@example.com",
"name": "Hong Gildong",
"type": "TO",
"parameters": {
"customer_name": "Hong Gildong",
"BEFORE_GRADE": "SILVER",
"AFTER_GRADE": "GOLD"
}
}
],
"useBasicUnsubscribeMessage": true
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
| Field | Type | Required | Description |
|---|---|---|---|
requestId |
String | - | Send request ID
|
requestCount |
Integer | - | Number of mails to send
|
createDateTime |
String | - | Date and time the send request was accepted
|
Response status codes
The following describes the response status codes.
| HTTP status code | Code | Message | Description |
|---|---|---|---|
| 202 | - | Accepted | Send request accepted successfully |
| 400 | InvalidParameter | Bad Request | Request parameter error
|
| 401 | Unauthorized | Unauthorized | Authentication failed |
| 403 | Forbidden | Forbidden | No permission for the serviceId in the path |
| 404 | NotFound | Not Found | The resource in the path does not exist |
| 413 | ContentTooLarge | Content Too Large | Request body size exceeded |
| 429 | ResourceQuotaExceeded | Too Many Requests | Monthly sending limit exceeded |
| 429 | ThrottlingExceeded | Too Many Requests | Call rate limit exceeded |
| 500 | InternalServerError | Internal Server Error | Internal server error |
Unlike other Simple & Easy Notification Service APIs, the mail v2 API returns errors in the NCP API standard error format. Instead of the status and error (string) fields in the response body, the error object below is returned.
Error response body
The response body when a call fails includes the following data:
| Field | Type | Required | Description |
|---|---|---|---|
error |
Object | - | Error information |
error.errorCode |
String | - | Error code
|
error.message |
String | - | Fixed message for each error code
|
error.detail |
String | - | Detailed reason for the request
|
error.fieldErrors |
Array | - | List of errors by parameter
|
Error response example
The response example when a call fails is as follows:
{
"error": {
"errorCode": "InvalidParameter",
"message": "The request contains an invalid parameter."
}
}
Response example
The response example is as follows:
{
"requestId": "20260702-R-01K0ZQ8YV3M4N5P6R7S8T9VAWX-777",
"requestCount": 1,
"createDateTime": "2026-07-02T10:00:00+09:00"
}