コンテンツにスキップ

お知らせの下書きを作る

POST
/api/v1/email/announcements
curl --request POST \
--url https://app.goyoka.com/api/v1/email/announcements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subject": "example", "body": "example", "audience": "example", "event_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "occurrence_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sender_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

件名(1〜200字)・本文(1〜20000字)・宛先・event_id・occurrence_id・sender_profile_id⁠からDRAFT⁠を作ります。作成だけではメールを送りません。audience⁠がEVENT_PARTICIPANTS⁠ならevent_id⁠が必須、他の宛先へevent_id・occurrence_id⁠を送るとnull⁠に揃えて保存します。occurrence_id⁠を渡すと、宛先はevent_id⁠のその開催日の参加者だけになります(省略・null⁠はすべての開催日)。event_id⁠は自店の未アーカイブのイベント、occurrence_id⁠はそのイベントの開催日、sender_profile_id⁠は自店の差出人だけを指せます。違えば404⁠です。鍵やトークンの持ち主が今のこのお店のメンバーでないと409 EMAIL_OPERATION_BLOCKED(NOT_CURRENT_MEMBER)です。この機能(お知らせ配信)が無効なお店では409 EMAIL_OPERATION_BLOCKED(ANNOUNCEMENT_UNAVAILABLE)です。任意の冪等キーを使えます。

summary⁠はemail:read⁠がある場合だけ返し、なければnull⁠です。

必要な範囲: email:write

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
subject
必須
string
body
必須
string
audience
必須
string
event_id
必須
string | null 形式: uuid
occurrence_id

EVENT_PARTICIPANTS のとき、宛先をevent_id⁠のこの開催日の参加者に絞ります。省略・null⁠はすべての開催日です。

string | null 形式: uuid
sender_profile_id
必須
string | null 形式: uuid
例自動生成
{
"subject": "example",
"body": "example",
"audience": "example",
"event_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"occurrence_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"sender_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

お知らせの下書きを作る

メディアタイプapplication/json
object
data
必須
object
id
必須
string 形式: uuid
subject
必須
string
body
必須
string
audience
必須
string
event_id
必須
string | null 形式: uuid
occurrence_id
必須
string | null 形式: uuid
sender_profile_id
必須
string | null 形式: uuid
status
必須
string
scheduled_at
必須
string | null 形式: date-time
send_requested_at
必須
string | null 形式: date-time
sent_at
必須
string | null 形式: date-time
published_at
必須
string | null 形式: date-time
schedule_failed_reason
必須
string | null
created_at
必須
string 形式: date-time
updated_at
必須
string 形式: date-time
summary
必須
object
total
必須
integer
sent
必須
integer
failed
必須
integer
skipped
必須
integer
pending
必須
integer
例自動生成
{
"data": {
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"subject": "example",
"body": "example",
"audience": "example",
"event_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"occurrence_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"sender_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"status": "example",
"scheduled_at": "2026-04-15T12:00:00Z",
"send_requested_at": "2026-04-15T12:00:00Z",
"sent_at": "2026-04-15T12:00:00Z",
"published_at": "2026-04-15T12:00:00Z",
"schedule_failed_reason": "example",
"created_at": "2026-04-15T12:00:00Z",
"updated_at": "2026-04-15T12:00:00Z",
"summary": {
"total": 1,
"sent": 1,
"failed": 1,
"skipped": 1,
"pending": 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"
}
}

鍵が無い・無効

メディアタイプ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"
}
}