Download OpenAPI specification:
KakeiFlow の現行 Laravel 実装を基準に再構成した API 仕様です。
認証済み API は Sanctum の Bearer トークンを利用します。
通常の API は success / message / data 形式を返しますが、GET /user と GET /dashboard、
DELETE /delete-user は専用のレスポンス形状です。
| name required | string <= 255 characters |
| email required | string <email> <= 255 characters |
| password required | string <password> Laravel のデフォルトパスワードルール |
| password_confirmation required | string <password> |
{- "name": "takuya",
- "email": "user@example.com",
- "password": "Password123!",
- "password_confirmation": "Password123!"
}{- "success": true,
- "message": "サインインしました。",
- "data": {
- "user": {
- "id": 1,
- "name": "takuya",
- "email": "user@example.com",
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "token": "1|sRUG3oExamplePersonalAccessToken"
}
}| email required | string <email> |
| password required | string <password> |
{- "email": "user@example.com",
- "password": "Password123!"
}{- "success": true,
- "message": "サインインしました。",
- "data": {
- "user": {
- "id": 1,
- "name": "takuya",
- "email": "user@example.com",
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "token": "1|sRUG3oExamplePersonalAccessToken"
}
}| email required | string <email> |
| token required | string |
| password required | string <password> Laravel のデフォルトパスワードルール |
| password_confirmation required | string <password> |
{- "email": "user@example.com",
- "token": "reset-token-from-email",
- "password": "Password123!",
- "password_confirmation": "Password123!"
}{- "success": true,
- "message": "パスワードを更新しました。",
- "data": null
}| email required | string <email> |
| token required | string |
| password required | string <password> Laravel のデフォルトパスワードルール |
| password_confirmation required | string <password> |
{- "email": "user@example.com",
- "token": "reset-token-from-email",
- "password": "Password123!",
- "password_confirmation": "Password123!"
}{- "success": true,
- "message": "アカウントを再開しました。",
- "data": null
}{- "id": 1,
- "name": "takuya",
- "email": "user@example.com",
- "email_verified_at": null,
- "budget": 120000,
- "deleted": false,
- "ai_advice_mode": true,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}| name required | string <= 30 characters |
{- "name": "takuya"
}{- "success": true,
- "message": "ユーザー名を更新しました。",
- "data": null
}| current_password required | string <password> |
| new_password required | string <password> Laravel のデフォルトパスワードルール |
| new_password_confirmation required | string <password> |
{- "current_password": "CurrentPassword123!",
- "new_password": "NewPassword123!",
- "new_password_confirmation": "NewPassword123!"
}{- "success": true,
- "message": "パスワードを更新しました。",
- "data": null
}| email required | string <email> <= 255 characters |
{- "email": "next@example.com"
}{- "success": true,
- "message": "認証コードを送信しました。",
- "data": null
}| email required | string <email> <= 255 characters |
| code required | string^[0-9]{6}$ |
{- "email": "next@example.com",
- "code": "123456"
}{- "success": true,
- "message": "認証コードを確認しました。",
- "data": null
}| email required | string <email> <= 255 characters |
| code required | string^[0-9]{6}$ |
{- "email": "next@example.com",
- "code": "123456"
}{- "success": true,
- "message": "メールアドレスを更新しました。",
- "data": {
- "id": 1,
- "name": "takuya",
- "email": "user@example.com",
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
}| budget required | integer [ 1 .. 999999999 ] 現行バリデーションでは 1 以上の整数のみ受け付ける |
{- "budget": 120000
}{- "success": true,
- "message": "予算を更新しました。",
- "data": null
}| ai_advice_mode required | boolean |
{- "ai_advice_mode": true
}{- "success": true,
- "message": "AIアドバイスモードのフラグを更新しました。",
- "data": {
- "ai_advice_mode": true
}
}{- "success": true,
- "message": "カテゴリ一覧を取得しました。",
- "data": [
- {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
]
}| name required | string <= 30 characters |
| transaction_type_id required | integer (TransactionTypeId) Enum: 1 2 1 = 収入, 2 = 支出 |
| sort_no | integer or null 新規作成時はサーバー側で自動採番される |
{- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 1
}{- "success": true,
- "message": "カテゴリを登録しました。",
- "data": {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
}| id required | integer >= 1 Example: 1 対象リソースの ID |
| name required | string <= 30 characters |
| transaction_type_id required | integer (TransactionTypeId) Enum: 1 2 1 = 収入, 2 = 支出 |
| sort_no | integer or null 新規作成時はサーバー側で自動採番される |
{- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 1
}{- "success": true,
- "message": "カテゴリを更新しました。",
- "data": {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
}| sorted_category_ids required | Array of integers[ items >= 1 ] |
{- "sorted_category_ids": [
- 8,
- 10,
- 9
]
}{- "success": true,
- "message": "カテゴリの並び順を更新しました。",
- "data": null
}{- "success": true,
- "message": "取引一覧を取得しました。",
- "data": [
- {
- "transaction_id": 24,
- "user_id": 1,
- "transaction_date": "2026-04-05T00:00:00.000000Z",
- "transaction_type_id": 2,
- "category": {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "payment_method": {
- "payment_method_id": 2,
- "name": "クレジットカード",
- "transaction_type_id": 2,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "amount": "2258.00",
- "memo": "スーパーでまとめ買い",
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
]
}| transaction_date required | string 入力は Laravel の |
| transaction_type_id required | integer (TransactionTypeId) Enum: 1 2 1 = 収入, 2 = 支出 |
| category_id required | integer >= 1 |
| amount required | number >= 0 |
| payment_method_id required | integer >= 1 |
| memo | string or null <= 255 characters |
{- "transaction_date": "2026-04-05 00:00:00",
- "transaction_type_id": 2,
- "category_id": 8,
- "amount": 2258,
- "payment_method_id": 2,
- "memo": "スーパーでまとめ買い"
}{- "success": true,
- "message": "取引を登録しました。",
- "data": {
- "transaction_id": 24,
- "user_id": 1,
- "transaction_date": "2026-04-05T00:00:00.000000Z",
- "transaction_type_id": 2,
- "category": {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "payment_method": {
- "payment_method_id": 2,
- "name": "クレジットカード",
- "transaction_type_id": 2,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "amount": "2258.00",
- "memo": "スーパーでまとめ買い",
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
}| id required | integer >= 1 Example: 1 対象リソースの ID |
| transaction_date required | string 入力は Laravel の |
| transaction_type_id required | integer (TransactionTypeId) Enum: 1 2 1 = 収入, 2 = 支出 |
| category_id required | integer >= 1 |
| amount required | number >= 0 |
| payment_method_id required | integer >= 1 |
| memo | string or null <= 255 characters |
{- "transaction_date": "2026-04-05 00:00:00",
- "transaction_type_id": 2,
- "category_id": 8,
- "amount": 2258,
- "payment_method_id": 2,
- "memo": "スーパーでまとめ買い"
}{- "success": true,
- "message": "取引を更新しました。",
- "data": {
- "transaction_id": 24,
- "user_id": 1,
- "transaction_date": "2026-04-05T00:00:00.000000Z",
- "transaction_type_id": 2,
- "category": {
- "category_id": 8,
- "user_id": 1,
- "name": "食費",
- "transaction_type_id": 2,
- "sort_no": 2,
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "payment_method": {
- "payment_method_id": 2,
- "name": "クレジットカード",
- "transaction_type_id": 2,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}, - "amount": "2258.00",
- "memo": "スーパーでまとめ買い",
- "deleted": false,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
}{- "success": true,
- "message": "支払方法一覧を取得しました。",
- "data": [
- {
- "payment_method_id": 2,
- "name": "クレジットカード",
- "transaction_type_id": 2,
- "created_at": "2026-04-05T09:00:00.000000Z",
- "updated_at": "2026-04-05T09:00:00.000000Z"
}
]
}今月の収支サマリ、過去 6 か月の支出推移、最近 5 件の取引、ユーザー設定を返します。
このエンドポイントは共通の success / message / data ラッパーを使いません。
{- "user": {
- "id": 1,
- "name": "takuya",
- "email": "user@example.com",
- "budget": 120000,
- "ai_advice_mode": true
}, - "monthly_summary": {
- "income": "600000.00",
- "expense": "2258.00",
- "balance": 597742
}, - "expense_trend": [
- {
- "year": 2026,
- "month": 4,
- "total_expense": 2258
}
], - "recent_transactions": [
- {
- "id": 24,
- "user_id": 1,
- "transaction_date": "2026-04-05 00:00:00",
- "transaction_type_id": 2,
- "category_id": 8,
- "category_name": "食費",
- "amount": "2258.00",
- "payment_method_id": 2,
- "memo": "スーパーでまとめ買い",
- "deleted": 0,
- "created_at": "2026-04-05 09:00:00",
- "updated_at": "2026-04-05 09:00:00"
}
]
}{- "success": true,
- "message": "AIアドバイスを取得しました。",
- "data": {
- "risk_level": "warning",
- "analysis": {
- "budget_gap": 32000,
- "daily_safe_limit": 3800,
- "main_issue_category": "食費",
- "analysis_reason": "月前半で食費への支出が集中しています。"
}, - "pattern": "週末に食費が増えやすい傾向です。",
- "advice": {
- "micro_action": "今週はコンビニ利用を 2 回以内に抑えましょう。",
- "daily_budget_target": 3500,
- "focus_category": "食費"
}, - "motivation": "小さな調整でも今月の着地は十分改善できます。"
}
}