コンテンツにスキップ

会話を始める

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

登録済みのお客様へ最初のメールを送り、会話を作ります。

customers:contact⁠がなければcontact全体がnull、許可があればemail⁠だけのobject⁠で、未登録のemail⁠はnull⁠です。

宛先のメールアドレスなし・不達・メール機能停止・送信失敗では422 MESSAGE_UNDELIVERABLE⁠で、details.reason⁠を確認してください。

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

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

同じ冪等キーと内容の成功再送は枠を消費しません。

必要な範囲: messages:write

customers:contact があるとメール・電話が入る(会話はメールのみ)。

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
customer_id
必須
string 形式: uuid
subject
必須
string
1文字以上 200文字以下
body
必須
string
1文字以上 4000文字以下
sender_profile_id
string | null 形式: uuid
例自動生成
{
"customer_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"subject": "example",
"body": "example",
"sender_profile_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

会話を始める

メディアタイプapplication/json
object
data
必須
object
id
必須
string 形式: uuid
customer_id
必須
string | null 形式: uuid
subject
必須
string
contact_name
必須
string
contact
必須
object
email
必須
string | null
status
必須
string
取りうる値: OPEN CLOSED
channel
必須
string
取りうる値: EMAIL
booking_id
必須
string | null 形式: uuid
sender_profile_id
必須
string | null 形式: uuid
last_message_at
必須
string 形式: date-time
created_at
必須
string 形式: date-time
updated_at
必須
string 形式: date-time
例
{
"data": {
"status": "OPEN",
"channel": "EMAIL"
}
}

利用できないヘッダ

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