POST /reservations
Summary: 予約を作成する
資源・開始・終了・目的を指定して自分名義の予約を作成します。同じIdempotency-Keyの再送には24時間、元の作成応答を返します。
Headers
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
Idempotency-Key |
string |
yes | 同じ更新系リクエストの重複処理を防ぐためにクライアントが指定する一意なキーです。同じキーで再送された場合、サーバーは同一リクエストとして扱います。 | minLength=1, maxLength=128, pattern=^[A-Za-z0-9_-]+$ |
Path Parameters
なし
Query Parameters
なし
Data
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
resourceId |
string |
yes | 予約する資源を一意に識別するIDです。 | minLength=1, maxLength=36 |
startAt |
string |
yes | 予約開始日時です。15分刻みで、現在より後かつ30日以内です。 | - |
endAt |
string |
yes | 予約終了日時です。15分刻みで、開始と同じ日本時間の日付内です。 | - |
purpose |
string |
yes | 予約目的です。1〜200文字です。 | minLength=1, maxLength=200 |
Responses
| Status | 説明 | Media type | Body |
|---|---|---|---|
201 |
Successful Response | application/json |
8 field(s) |
401 |
認証情報が未指定、期限切れ、または検証できない場合。 | application/json |
13 field(s) |
404 |
予約対象の資源が存在しない場合。 | application/json |
13 field(s) |
409 |
予約枠が重なる、資源が無効、または同じIdempotency-Keyで異なる入力を送った場合。 | application/json |
13 field(s) |
422 |
bodyまたはheaderが型や制約に一致しない、または予約時刻の規則に反する場合。 | application/json |
13 field(s) |
429 |
呼び出し頻度が許可された上限を超えた場合。 | application/json |
13 field(s) |
500 |
SlotKeeper内部で想定外のエラーが発生した場合。 | application/json |
13 field(s) |
503 |
DBの競合や接続障害が再試行上限を超えた場合。 | application/json |
13 field(s) |
201 Successful Response
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
reservationId |
string |
yes | 予約を一意に識別するIDです。 | minLength=1, maxLength=36 |
resourceId |
string |
yes | 予約対象の資源を一意に識別するIDです。 | minLength=1, maxLength=36 |
ownerPrincipalId |
string |
yes | 予約者を表す認証主体IDです。 | minLength=1, maxLength=200 |
startAt |
string |
yes | 予約開始日時です。 | - |
endAt |
string |
yes | 予約終了日時です。この時刻を含みません。 | - |
purpose |
string |
yes | 予約目的です。本人と管理者だけに返します。 | minLength=1, maxLength=200 |
status |
string(confirmed, cancelled) |
yes | 予約の状態を表す列挙値です。 | confirmed=確定済みで重複判定の対象になる予約です。 cancelled=取消済みで重複判定から除く予約です。 |
version |
integer |
yes | 予約取消の楽観ロックに使う版です。 | minimum=1.0 |
401 認証情報が未指定、期限切れ、または検証できない場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
404 予約対象の資源が存在しない場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
409 予約枠が重なる、資源が無効、または同じIdempotency-Keyで異なる入力を送った場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
422 bodyまたはheaderが型や制約に一致しない、または予約時刻の規則に反する場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
429 呼び出し頻度が許可された上限を超えた場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
500 SlotKeeper内部で想定外のエラーが発生した場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
503 DBの競合や接続障害が再試行上限を超えた場合。
Media type: application/json
| 項目 | 型 | 必須 | 説明 | 制約 |
|---|---|---|---|---|
error |
ErrorBody |
yes | エラーコード、メッセージ、追跡IDを含む共通エラー本文です。 | - |
error.code |
string |
yes | エラー種別を機械的に判定するためのコードです。 | minLength=1, maxLength=100 |
error.message |
string |
yes | 利用者が次に確認・修正・再試行・問い合わせすべき内容を示すメッセージです。 | maxLength=1000 |
error.details |
array<ErrorDetail> |
no | リトライ可否、問い合わせ時に伝える追跡ID、確認対象リソースなどの詳細一覧です。 | - |
error.details[].field |
string | null |
no | 入力検証エラーが発生したリクエスト項目です。 | minLength=1, maxLength=256 |
error.details[].reason |
string | null |
no | 入力検証エラー、再試行判断、または問い合わせ時に確認する具体的な理由です。 | minLength=1 |
error.details[].statusCode |
integer | null |
no | 返却されたHTTPステータスコードです。 | minimum=400.0, maximum=599.0 |
error.details[].retryable |
boolean | null |
no | 同じリクエストを再実行して解消する可能性があるかどうかです。 | - |
error.details[].reference |
string | null |
no | 問い合わせ時に伝える追跡IDまたは相関IDです。 | minLength=1, maxLength=128 |
error.details[].resource |
ErrorResource | null |
no | 再送、状態確認、問い合わせ時に確認する対象リソースです。 | - |
error.details[].resource.resourceId |
string | null |
no | 予約対象資源の存在確認、予約表の再取得に使用する資源IDです。 | minLength=1, maxLength=36 |
error.details[].resource.idempotencyKey |
string | null |
no | 同じ要求を再送するときに再利用するIdempotency-Keyです。 | - |
error.traceId |
string |
yes | 障害調査でログとレスポンスを対応付ける追跡IDです。 | minLength=1, maxLength=128 |
Samples
HTTP 201
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"reservationId": "5d2c7f3e-0000-0000-0000-000000000001",
"resourceId": "00000000-0000-0000-0000-000000000001",
"ownerPrincipalId": "alice",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議",
"status": "confirmed",
"version": 1
}
HTTP 401
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "UNAUTHORIZED",
"message": "認証情報を確認し、有効な認証情報で再送してください。",
"details": [
{
"reason": "認証情報が未指定、期限切れ、または検証できない場合。",
"statusCode": 401,
"retryable": false,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 404
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "NOT_FOUND",
"message": "指定したリソースIDが正しいか確認してから再送してください。",
"details": [
{
"reason": "予約対象の資源が存在しない場合。",
"statusCode": 404,
"retryable": false,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 409
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "CONFLICT",
"message": "リソースの最新状態またはIdempotency-Keyを確認してから再送してください。理由: 予約枠が重なる、資源が無効、または同じIdempotency-Keyで異なる入力を送った場合。",
"details": [
{
"reason": "予約枠が重なる、資源が無効、または同じIdempotency-Keyで異なる入力を送った場合。",
"statusCode": 409,
"retryable": false,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 422
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "VALIDATION_ERROR",
"message": "リクエストの型、必須項目、制約をOpenAPI仕様に合わせて修正してください。",
"details": [
{
"reason": "bodyまたはheaderが型や制約に一致しない、または予約時刻の規則に反する場合。",
"statusCode": 422,
"retryable": false,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 429
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "呼び出し頻度を下げ、時間をおいてから再送してください。",
"details": [
{
"reason": "呼び出し頻度が許可された上限を超えた場合。",
"statusCode": 429,
"retryable": true,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 500
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "想定外のエラーが発生しました。追跡IDを添えて問い合わせてください。",
"details": [
{
"reason": "SlotKeeper内部で想定外のエラーが発生した場合。",
"statusCode": 500,
"retryable": false,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}
HTTP 503
Request
{
"headers": {
"Authorization": "Bearer <access-token>",
"Idempotency-Key": "reservation-20260926-0001"
},
"body": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"startAt": "2026-09-26T01:00:00Z",
"endAt": "2026-09-26T02:00:00Z",
"purpose": "定例会議"
}
}
Response
{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "一時的に処理できません。時間をおいて同じリクエストを再送してください。",
"details": [
{
"reason": "DBの競合や接続障害が再試行上限を超えた場合。",
"statusCode": 503,
"retryable": true,
"reference": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S",
"resource": {
"resourceId": "00000000-0000-0000-0000-000000000001",
"idempotencyKey": "reservation-20260926-0001"
}
}
],
"traceId": "trc_01HZY6WJ7X4W9A0V7P9N2Q3R4S"
}
}