コンテンツにスキップ

イベントの下書きを作る

POST
/api/v1/events
curl --request POST \
--url https://app.goyoka.com/api/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "sender_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "slug": "example", "title": "example", "description": "example", "visibility": "PUBLIC", "display_mode": "LIST", "delivery_mode": "IN_PERSON", "location_name": "example", "location_address": "example", "online_url": "example", "address_visibility": "PUBLIC", "payment_note": "example", "reception_default": { "opens_before_minutes": 1, "closes_before_minutes": 1 }, "notice": "example", "menus": [ { "key": "example", "service_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "price_yen": 1, "duration_minutes": 1, "timing_mode": "FIXED", "required": true, "display_order": 1, "selection_group_key": "example" } ], "selection_groups": [ { "key": "example", "name": "example", "min_selections": 1, "max_selections": 1, "display_order": 1, "conditions": [ { "mode": "ALL", "kind": "PAID_MENU_SELECTED", "target_menu_key": "example" } ] } ], "questions": [ { "prompt": "example", "kind": "TEXT", "required": true, "options": [ "example" ] } ], "occurrences": [ { "starts_at": "2026-04-15T12:00:00Z", "ends_at": "2026-04-15T12:00:00Z", "opens_at": "2026-04-15T12:00:00Z", "closes_at": "2026-04-15T12:00:00Z", "cancel_deadline_at": "2026-04-15T12:00:00Z", "reception_overridden": true, "location_name": "example", "location_address": "example", "online_url": "example", "menus": [ { "menu_key": "example", "starts_at": "2026-04-15T12:00:00Z", "ends_at": "2026-04-15T12:00:00Z", "capacity": 1 } ] } ] }'

複数メニュー・選択グループ・質問・開催回を含むDRAFT⁠を作成します。status⁠は指定できません。条件グラフは保存前に検査します。ORGANIZER_ALLOWED⁠は入力できますが、許可名簿の保存口がないため選択できない既存制約があります。任意の冪等キーを使えます。

条件の対象欠落・同じグループの参照・循環・重複は422 BOOKING_INPUT_INVALID⁠です。details.blocks⁠は理由の配列で、code⁠で分岐しmessage⁠を表示します。

BOOKING_INPUT_INVALID⁠は、欄名を持つ業務エラーならdetails.fieldErrors、欄名がない場合はdetails⁠なしとなる経路もあります。MCP⁠でも業務エラーはstructuredContent.error⁠に返します。入力の形の誤りは、REST⁠では422 VALIDATION(details.fieldErrors)、MCP⁠ではツールの入力検査のエラー文を返します。

ハンドラ内で検査するお店の中でのslug⁠の重複(details.fieldErrors.slug)、メニュー・選択グループのkey⁠や開催回内のmenu_key⁠の重複、開催・受付期間の前後関係(reception_default⁠の開始と締切を含む)、参照するkey⁠の欠落、条件mode⁠の混在は422 VALIDATION⁠です。これはMCP⁠でもstructuredContent.error⁠にcode:VALIDATION⁠とdetails.fieldErrors⁠を返します。

必要な範囲: events:write

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
sender_profile_id
string | null 形式: uuid
slug
必須
string
1文字以上 63文字以下 /^[a-z0-9-]{1,63}$/
title
必須
string
120文字以下
description
string | null
2000文字以下
visibility
必須
string
取りうる値: PUBLIC LINK_ONLY MEMBERS_ONLY
display_mode
必須
string
取りうる値: LIST CALENDAR
delivery_mode
必須
string
取りうる値: IN_PERSON ONLINE
location_name
string | null
120文字以下
location_address
string | null
300文字以下
online_url
string | null
address_visibility
string
取りうる値: PUBLIC CONFIRMED_ONLY INDIVIDUAL
payment_note
string | null
2000文字以下
reception_default

受付期間の標準(開催の何分前)。省略で保持。reception_overridden⁠がfalse⁠の開催回すべてに効く。両方の値があるときは opens_before_minutes を closes_before_minutes より大きくする。

object
opens_before_minutes
必須
integer | null
<= 525600
closes_before_minutes
必須
integer | null
<= 525600
notice

省略またはnull⁠は、お店の申し込み備考の初期値を写します。trim後空文字は備考なしで作ります。非空の文字列はそのまま保存します。

string | null
2000文字以下
menus
必須
Array<object>
object
key
必須
string
1文字以上
service_id
string | null 形式: uuid
name
必須
string
1文字以上 120文字以下
price_yen
必須
integer
<= 2147483647
duration_minutes
必須
integer
>= 1 <= 2147483647
timing_mode
必須
string
取りうる値: FIXED INDIVIDUAL
required
必須
boolean
display_order
integer
>= -2147483648 <= 2147483647
selection_group_key
string | null
1文字以上
selection_groups
Array<object>
object
key
必須
string
1文字以上
name
必須
string
1文字以上 120文字以下
min_selections
integer
<= 2147483647
max_selections
integer | null
>= 1 <= 2147483647
display_order
integer
>= -2147483648 <= 2147483647
conditions
Array<object>
object
mode
必須
string
取りうる値: ALL ANY
kind
必須
string
取りうる値: PAID_MENU_SELECTED MENU_SELECTED SELF_CONFIRMED ORGANIZER_ALLOWED
target_menu_key
string | null
1文字以上
questions
Array<object>
object
prompt
必須
string
1文字以上 200文字以下
kind
必須
string
取りうる値: TEXT SINGLE CHECKBOX
required
boolean
options
Array<string>
occurrences
必須
Array<object>
object
starts_at
必須
string 形式: date-time
ends_at
必須
string 形式: date-time
opens_at
string | null 形式: date-time
closes_at
string | null 形式: date-time
cancel_deadline_at
string | null 形式: date-time
reception_overridden

true⁠でこの日だけの受付期間(opens_at・closes_at、null⁠はその側の制限なし)、false⁠でイベントのreception_default⁠に従う(opens_at・closes_at⁠を消す)。省略時はopens_at・closes_at⁠のどちらかに日時があればtrue、無ければ今のまま(新しい回はfalse)。

boolean
location_name
string | null
120文字以下
location_address
string | null
300文字以下
online_url
string | null
menus
必須
Array<object>
object
menu_key
必須
string
1文字以上
starts_at

「全員そろって」(FIXED)のメニューの開始。開催時間の中で指定します。作成で省略すると開催の開始と同じにします。

string | null 形式: date-time
ends_at

「全員そろって」(FIXED)のメニューの終了。作成で省略すると開催の終了と同じにします。

string | null 形式: date-time
capacity
integer | null
>= 1 <= 2147483647

イベントの下書きを作る

メディアタイプapplication/json
object
data
必須
object
id
必須
string 形式: uuid
title
必須
string
status
必須
string
取りうる値: DRAFT PUBLISHED ENDED CANCELLED
visibility
必須
string
取りうる値: PUBLIC LINK_ONLY MEMBERS_ONLY
timing
必須
object
first_starts_at
必須
string | null 形式: date-time
last_ends_at
必須
string | null 形式: date-time
occurrence_count
必須
integer
menu_count
必須
integer
question_count
必須
integer
archived_at
必須
string | null 形式: date-time
created_at
必須
string 形式: date-time
reception_default
必須

受付期間の標準。reception_overridden⁠がfalse⁠の開催回すべてに効く

object
opens_before_minutes
必須

開催の何分前に受付を始めるか。null⁠は公開したらすぐ

integer | null
closes_before_minutes
必須

開催の何分前に締め切るか。null⁠は締め切らない(開催の終わりまで)

integer | null
例
{
"data": {
"status": "DRAFT",
"visibility": "PUBLIC"
}
}

利用できないヘッダ

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