コンテンツにスキップ

お知らせを自分宛にテスト送信する

POST
/api/v1/email/announcements/{id}/test-send
curl --request POST \
--url https://app.goyoka.com/api/v1/email/announcements/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/test-send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'

APIキー・OAuth⁠では、鍵やトークンの持ち主(APIキーを発行した人、OAuth⁠は同意した人)本人の現在のメンバーシップのアドレスへ1通送り、任意の宛先は指定できません。お客様や他のオーナーへは送りません。件名は「[テスト] 」で始まり、配信停止リンクは仮の文言です。お知らせの状態(DRAFT/SCHEDULED/SENT等)は問わず、常に1通送れます。事業者名・住所が未設定のときは409 EMAIL_OPERATION_BLOCKED(SENDER_IDENTITY_MISSING)で、この場合は送信枠を消費しません。配信が停止されているお店では422 EMAIL_TEST_UNDELIVERABLE(details.reason:suspended)で、送信枠は消費します。

422 EMAIL_TEST_UNDELIVERABLE⁠のdetails.reason⁠はno-email(本人の未登録・不正アドレス)、suspended(配信停止)、send-failed(送信失敗)です。not-current-member⁠は通常は返りませんが、入口の所属確認と宛先解決の間に所属を失うと返る場合があります。

入口で所属がなければ409 EMAIL_OPERATION_BLOCKED(details.blocks[].code:NOT_CURRENT_MEMBER)、scope不足は配送前に403 INSUFFICIENT_SCOPE⁠です。

会話開始・返信と文面・お知らせのテスト送信は、お店合算の既定30通/時の固定窓を共有します。超過はRATE_LIMITED⁠で両経路にdetails.retry_after(秒)が付き、REST⁠は429⁠とRetry-Afterヘッダーも返し、MCP⁠はヘッダーを返しません。同じ冪等キーと内容の成功再送は枠を消費しません。

毎分の上限はRATE_LIMITED⁠で、REST⁠では429⁠とRetry-Afterヘッダー(秒)、MCP⁠では待ち時間を返しません。

必要な範囲: email:write

id
必須
string 形式: uuid

ヘッダーのパラメータ

「ヘッダーのパラメータ」の節へ
Idempotency-Key
string

同じ内容の再送に同じ値を使います。異なる内容との再利用や処理中の再送は409 IDEMPOTENCY_KEY_REUSED⁠です。

メディアタイプapplication/json
object
例自動生成
{}

お知らせを自分宛にテスト送信する

メディアタイプapplication/json
object
data
必須
object
id
必須
string 形式: uuid
sent
必須
boolean
例
{
"data": {
"sent": true
}
}

利用できないヘッダ

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

鍵が無い・無効

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

範囲不足

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

見つからない

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

予約・冪等キーの競合

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

本文が1 MiB⁠を超えている

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

入力の検証失敗

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

回数の上限

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}
RateLimit-Limit
integer
>= 1

固定窓内の回数上限

RateLimit-Remaining
integer

固定窓内の残り回数

RateLimit-Reset
integer

窓終了までの秒数

Retry-After
integer
>= 1

再試行までの待機秒数

内部エラー

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}