コンテンツにスキップ

質問を丸ごと置き換え(送らなかった行は削除)

PUT
/api/v1/events/{id}/questions
curl --request PUT \
--url https://app.goyoka.com/api/v1/events/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/questions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "questions": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "prompt": "example", "kind": "TEXT", "required": true, "options": [ "example" ], "sort_order": 1 } ], "dry_run": true }'

質問を丸ごと置き換え、送らなかった行は削除します。先にGET⁠してください。sort_order⁠より配列順を優先します。完全一致ならID⁠と保存日時を保持します。変更時は全行を再作成しID⁠も変わります。過去の回答スナップショットは変えません。任意の冪等キーを使えます。

アーカイブ済みイベントは404 NOT_FOUND⁠です。

公開入力の形の誤りは、REST⁠では422 VALIDATION(details.fieldErrors⁠の最上位の欄名を確認)、MCP⁠ではツールの入力検査のエラー文を返します。

ハンドラ内で検査する質問ID⁠の重複は422 VALIDATION⁠です。これはMCP⁠でもstructuredContent.error⁠にcode:VALIDATION⁠とdetails.fieldErrors⁠を返します。

必要な範囲: events:write

id
必須
string 形式: uuid

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
questions
必須
Array<object>
object
id
string 形式: uuid
prompt
必須
string
1文字以上 200文字以下
kind
必須
string
取りうる値: TEXT SINGLE CHECKBOX
required
boolean
options
Array<string>
sort_order
integer
>= -2147483648 <= 2147483647
dry_run

true⁠で保存せず、送った内容で保存したときに足す・消す・変える行を preview に返します(data は保存済みのまま)。お店の人に変わる中身を見せてから保存するときに使います。冪等キーは保存のときとは別のキーを使うか、付けないでください(同じキーだと本文が違うので保存が断られます)。

boolean

質問を丸ごと置き換え(送らなかった行は削除)

メディアタイプapplication/json
object
data
必須
Array<object>
object
id
必須
string 形式: uuid
prompt
必須
string
1文字以上 200文字以下
kind
必須
string
取りうる値: TEXT SINGLE CHECKBOX
required
必須
boolean
options
必須
Array<string>
sort_order
必須
integer
>= -2147483648 <= 2147483647
preview

dry_run:true のときだけ返す下見。added は新しく足す行(index は送った配列の位置)、removed は送らなかったので消える行、changed は id ありで値が変わる行と変わる欄の名前です。保存はしていません。

object
saved
必須
boolean
added
必須
Array<object>
object
index
必須
integer
label
必須
string
removed
必須
Array<object>
object
id
必須
string
label
必須
string
warning
必須
string | null
changed
必須
Array<object>
object
id
必須
string
label
必須
string
fields
必須
Array<string>
unchanged_count
必須
integer
order_changed
必須
boolean
notes
必須
Array<string>
例
{
"data": [
{
"kind": "TEXT"
}
],
"preview": {
"saved": false
}
}

利用できないヘッダ

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