このエンドポイントを含むWeb API v2の機能は、2025年2月に提供を終了します。
今後はWeb API v3をご利用ください。
これらのAPIリクエストはアカウント単位での設定です。SMTP APIのようにメール単位での設定変更ではありません。
以下の各設定に関する詳細についてはSettingsページを参照してください。
フィルタ設定を変更場合、Filter設定エンドポイントを利用してください。
Address Whitelist
名称 - addresswhitelist
このコールを使用する場合、全てのメールアドレスとドメインを設定する必要があります。このコールを使用すると現在のフィルタ設定を上書きします。コール時の設定からエントリを除外することでエントリを削除することができます。
| URI引数 |
必須 |
条件 |
説明 |
| name |
yes |
addresswhitelist |
設定の名称 |
| list |
yes |
メールアドレスまたはドメインのリスト |
list[]=support@example.com&list[]=sales@example.com |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=addresswhitelist&list[]=support@example.com&list[]=sales@example.com
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=addresswhitelist&list[]=support@example.com&list[]=sales@example.com
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
BCC “Blind Carbon Copy”
名称 - bcc
| URI引数 |
必須 |
条件 |
説明 |
| name |
yes |
bcc |
設定の名称 |
| email |
yes |
BCCを受け取るメールアドレス |
email@example.com |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=bcc&email=email@example.com
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=bcc&email=email@example.com
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
Click Tracking
名称 - clicktrack
| URI引数 |
必須 |
条件 |
説明 |
| name |
yes |
clicktrack |
設定の名称 |
| enable_text |
yes |
テキストメールでクリックトラッキングを有効化します |
0 または 1 |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=clicktrack&enable_text=1
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=clicktrack&enable_text=1
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
DKIM
名称 - dkim
| URI引数 |
必須 |
条件 |
説明 |
| name |
yes |
dkim |
設定の名称 |
| domain |
yes |
DKIM認証で署名に使用するドメイン |
example.com |
| use_from |
no |
有効化された場合、メールのFrom:ヘッダのドメインがDKIM署名として使用されます |
0 または 1 |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=dkim&domain=example.com&use_from=1
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=dkim&domain=example.com&use_from=1
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
Legacy Email Templates
API App 名 - template
| URI引数 |
必須 |
条件 |
説明 |
| name |
yes |
template |
設定の名称 |
| text/html |
yes |
HTML本文のテンプレート |
<html><head></head><body bgcolor=pink><div style=width:200px bgcolor=#FFF><% body %></div></body></html> |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=template&text/html=%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%20bgcolor%3D%27pink%27%3E%3Cdiv%20style%3D%27width%3A200px%27%20bgcolor%3D%27%23FFF%27%3E%3C%25%20body%20%25%3E%3C%2Fdiv%3E%3C%2Fbody%3E%3C%2Fhtml%3E
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=template&text/html=%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%20bgcolor%3D%27pink%27%3E%3Cdiv%20style%3D%27width%3A200px%27%20bgcolor%3D%27%23FFF%27%3E%3C%25%20body%20%25%3E%3C%2Fdiv%3E%3C%2Fbody%3E%3C%2Fhtml%3E
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
Event Webhook
名称 - eventnotify
version以外のフィールドは各コールに必須です。
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
eventnotify |
設定の名称 |
| processed |
Yes |
メールが処理された場合通知します |
0 |
| dropped |
Yes |
メールがドロップされた場合通知します |
1 |
| deferred |
Yes |
メールが遅延された場合通知します |
1 |
| delivered |
Yes |
メールが配信された場合通知します |
1 |
| bounce |
Yes |
メールがバウンスされた場合通知します |
1 |
| click |
Yes |
メールがクリックされた場合通知します |
1 |
| open |
Yes |
メールがOpenされた場合通知します |
1 |
| unsubscribe |
Yes |
メールが配信停止された場合通知します |
1 |
| spamreport |
Yes |
メールが迷惑メールとしてマークされた場合通知します |
1 |
| group_unsubscribe |
Yes |
Unsubscribe Groupから配信停止された場合通知します |
1 |
| group_resubscribe |
Yes |
Unsubscribe Groupに配信再開された場合通知します |
1 |
| url |
Yes |
POST先URL |
https://notificationurl.example.com/event |
| version |
No |
使用したいEvent Webhookのバージョン (1-3) |
3 |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=eventnotify&processed=0&dropped=1&deferred=1&delivered=1&bounce=1&click=1&unsubscribe=1&spamreport=1&url=https://notificationurl.example.com/event&version=3
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=eventnotify&processed=0&dropped=1&deferred=1&delivered=1&bounce=1&click=1&unsubscribe=1&spamreport=1&url=https://notificationurl.example.com/event&version=3
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
Footer
名称 - footer
「missing paramters」のエラーを避けるためには、text/htmlまたはtext/plainどちらかを指定するか、両方指定する必要があります。
Google Analytics
名称 - ganalytics
「missing paramters」のエラーを避けるためには、任意パラメータのうちいずれか一つを指定する必要があります。
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
ganalytics |
設定の名称 |
| utm_source |
No |
参照元のソース名 |
Transactional Email |
| utm_medium |
No |
マーケティング媒体の名前 |
email |
| utm_campaign |
No |
キャンペーンの名前 |
Redesigned Transaction |
| utm_term |
No |
有料のキーワードを識別 |
Health |
| utm_content |
No |
広告を区別するために使用します |
PageB |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=ganalytics&utm_source=Transactional
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=ganalytics&utm_source=Transactional
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
SPAM Filter Checker
名称 - spamcheck
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
spamcheck |
設定の名称 |
| max_score |
Yes |
メールのスパムスコアこの値を超えると迷惑メールとして認識され受信者に送信されません。デフォルトの閾値は5.0ですが、任意の値に設定することができます。SpamAssassinがこのフィルタの迷惑メールチェック処理として使用されます。従って、一般的にはSpamAssassinで使用される値でmaxscoreを設定することができます。 |
1.2 |
| url |
Yes |
メールが迷惑メールとして扱われた場合の理由が記載されたSpamAssassinのレポートのコピーとメールをURLにPOSTします。 |
https://www.example.com/spamcheck.php |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=spamcheck&max_score=1.2&url=https://www.example.com/spamcheck.php
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=spamcheck&max_score=1.2&url=https://www.example.com/spamcheck.php
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
Subscription Tracking
名称 - subscriptiontrack
「missing paramters」のエラーを避けるためには、任意パラメータのうちいずれか一つを指定する必要があります。
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
subscriptiontrack |
設定の名称 |
| text/html |
No |
HTMLメール本文のための文字列 |
配信停止をご希望の場合 <% こちらをクリック %> |
| text/plain |
No |
テキストメール本文のための文字列 |
配信停止をご希望の場合以下をクリックしてください: <% %> |
| url |
No |
配信管理のリンクをクリックした際のリダイレクト先URL |
http://www.example.com/UnsubscribeLandingPage |
| landing |
No |
SendGridにより表示されるリダイレクト先ページのHTMLコンテンツ |
<html>Content</html> |
| replace |
No |
配信管理のリンクでSendGridにより置換されるコンテンツに追加するタグ |
[unsubscribe_tag] |
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=subscriptiontrack&text/html=%3Cp%3EIf%20you%20would%20like%20to%20unsubscribe%20and%20stop%20receiving%20these%20emails%20%3C%25%20click%20here%20%25%3E%3C%2Fp%3E&text/plain=If%20you%20would%20like%20to%20unsubscribe%20and%20stop%20receiving%20these%20emails%20click%20here%3A%20%3C%25%20%25%3E.&url=http://www.example.com/UnsubscribeLandingPage&replace=%5Bunsubscribe_tag%5D
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=subscriptiontrack&text/html=%3Cp%3EIf%20you%20would%20like%20to%20unsubscribe%20and%20stop%20receiving%20these%20emails%20%3C%25%20click%20here%20%25%3E%3C%2Fp%3E&text/plain=If%20you%20would%20like%20to%20unsubscribe%20and%20stop%20receiving%20these%20emails%20click%20here%3A%20%3C%25%20%25%3E.&url=http://www.example.com/UnsubscribeLandingPage&replace=%5Bunsubscribe_tag%5D
|
Response
1
2
3
| <result>
<message>success</message>
</result>
|
SendGrid for New Relic
名称 - newrelic
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
newrelic |
設定の名称 |
| license_key |
Yes |
New Relic Settingページで確認することができます |
|
| enable_subusers |
Yes |
false:無効 true:有効 |
|
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=newrelic&license_key=1234567&enable_subusers=true
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=newrelic&license_key=1234567&enable_subusers=true
|
Response
1
| <message>success</message>
|
Sendwithus
名称 - sendwithus
| URI引数 |
必須 |
条件 |
説明 |
| name |
Yes |
sendwithus |
設定の名称 |
| license_key |
Yes |
sendwithusのSettingページで確認することができます |
|
|
|
| Data |
|
| Response Status |
|
| Response Body |
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.json
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=sendwithus&license_key=1234567
|
Response
1
2
3
| {
"message": "success"
}
|
Call
| POST |
https://api.sendgrid.com/api/filter.setup.xml
|
| POST Data |
api_user=apikey&api_key=your_sendgrid_api_key&name=sendwithus&license_key=1234567
|
Response
1
| <message>success</message>
|