Overview

公式API

+
Official API

公式 API

TaskWorks のデータを外部クライアントから安全に読むためのエントリーポイントです。パーソナル API キーを付与すれば、自分のタスクや習慣をシンプルに取得できます。

llms.md

できること

  • ・タスク一覧や今日の予定を取得
  • ・習慣ダッシュボードの集計を取得
  • ・セッション不要で個人用クライアントを作成

前提

  • ・設定 > APIキー管理 でキーを発行済み
  • ・ヘッダーに Authorization: ApiKey <token> を付与
  • ・必要なら Cookie / Bearer でも認証可能
API使用による分析の例

このAPIを使うことでユーザは自分好みの分析をすることが可能になります。

クイックスタート

最短で動かすための手順です。キーは一度しか表示されないので安全に保管してください。

  1. 設定ページの「APIキー管理」で新しいキーを発行し、平文キーを控える。
  2. クライアントから Authorization: ApiKey <token> を送る。
  3. /api/v1/tasks/today を叩いて 200 が返るか確認する。

cURL

curl -X GET   -H "Authorization: ApiKey YOUR_TOKEN"   -H "Accept: application/json"   https://your-app.example.com/api/v1/tasks/today

fetch (フロントエンド)

const res = await fetch("/api/v1/tasks/today", {
  headers: { Authorization: `ApiKey ${yourKey}` },
});
const body = await res.json();

すべてのエンドポイント

各エンドポイントの認証方式を確認して使用してください。

auth (5 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/auth/me 現在のユーザー情報を取得 ApiKey / Bearer / Cookie
GET /api/v1/auth/api-keys APIキー一覧を取得 Cookie
POST /api/v1/auth/api-keys 新しいAPIキーを作成 Cookie
DELETE /api/v1/auth/api-keys APIキーを失効 Cookie
POST /api/v1/auth/api-keys/verify APIキーの有効性を検証 Cookie
tasks (12 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/tasks 全タスク一覧を取得 ApiKey / Bearer / Cookie
POST /api/v1/tasks 新しいタスクを作成 ApiKey / Bearer / Cookie
GET /api/v1/tasks/today 今日のタスクを時間帯付きで返す ApiKey / Bearer / Cookie
GET /api/v1/tasks/overview 達成率や残タスク数の概要 ApiKey / Bearer / Cookie
GET /api/v1/tasks/search?q=keyword&limit=8 タイトル全文検索 ApiKey / Bearer / Cookie
GET /api/v1/tasks/streak 現在の連続達成日数(未認証時は0) ApiKey / Bearer / Cookie
GET /api/v1/tasks/:id 特定のタスク詳細を取得 ApiKey / Bearer / Cookie
PUT /api/v1/tasks/:id タスクを更新 ApiKey / Bearer / Cookie
DELETE /api/v1/tasks/:id タスクを削除 ApiKey / Bearer / Cookie
POST /api/v1/tasks/:id/execute タスク実行を記録(報酬付与) ApiKey / Bearer / Cookie
POST /api/v1/tasks/:id/skip タスクをスキップ(理由付き) ApiKey / Bearer / Cookie
DELETE /api/v1/tasks/:id/skip タスクのスキップをキャンセル ApiKey / Bearer / Cookie
habits (1 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/habits/dashboard?year=2025&month=12 習慣ダッシュボード用の集計 ApiKey / Bearer / Cookie
evaluations (3 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
POST /api/v1/evaluations/submit ポモドーロ評価を提出(集中度・気分) ApiKey / Bearer / Cookie
GET /api/v1/evaluations/last-task 最後のタスクを取得(デフォルト選択用) ApiKey / Bearer / Cookie
POST /api/v1/evaluations/unanswered 未回答のポモドーロ評価を記録 ApiKey / Bearer / Cookie
analytics (5 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/analytics/monthly-comparison 月次データのトレンド比較 ApiKey / Bearer / Cookie
GET /api/v1/analytics/daily-averages 日別の集中度・気分の平均値 ApiKey / Bearer / Cookie
GET /api/v1/analytics/task-completion-grid タスク完了ヒートマップデータ ApiKey / Bearer / Cookie
GET /api/v1/analytics/task-day-detail 特定の日のタスク詳細データ ApiKey / Bearer / Cookie
GET /api/v1/analytics/daily-detail 日別詳細分析(RPC経由) ApiKey / Bearer / Cookie
pomodoro (4 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/pomodoro アクティブなポモドーロセッションを取得 ApiKey / Bearer / Cookie
POST /api/v1/pomodoro 新しいポモドーロセッションを開始 ApiKey / Bearer / Cookie
POST /api/v1/pomodoro/:id/complete ポモドーロセッションを完了 ApiKey / Bearer / Cookie
DELETE /api/v1/pomodoro/:id/cancel ポモドーロセッションをキャンセル ApiKey / Bearer / Cookie
ai (7 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
POST /api/v1/ai/chat AIアシスタントとチャット(LLM) ApiKey / Bearer / Cookie
GET /api/v1/ai/report 保存されたAI習慣レポートを取得 ApiKey / Bearer / Cookie
POST /api/v1/ai/report AI習慣分析レポートを生成 ApiKey / Bearer / Cookie
GET /api/v1/ai/providers LLMプロバイダー設定一覧 ApiKey / Bearer / Cookie
POST /api/v1/ai/providers LLMプロバイダー設定を作成/更新 ApiKey / Bearer / Cookie
DELETE /api/v1/ai/providers LLMプロバイダー設定を削除 ApiKey / Bearer / Cookie
POST /api/v1/ai/daily-reflection AIで日次リフレクションを生成 ApiKey / Bearer / Cookie
gacha (4 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
POST /api/v1/gacha/draw ガチャを引く(単独・10連) ApiKey / Bearer / Cookie
GET /api/v1/gacha/draw 最新のガチャ結果と残高を取得 ApiKey / Bearer / Cookie
GET /api/v1/gacha/inventory 所有アイテム一覧を取得 ApiKey / Bearer / Cookie
GET /api/v1/gacha/history ガチャ履歴を取得(ページネーション) ApiKey / Bearer / Cookie
notifications (4 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
POST /api/v1/notifications/send テスト通知をFCM経由で送信 Cookie
GET /api/v1/notifications/token ユーザーのアクティブFCMトークン取得 Cookie
POST /api/v1/notifications/token FCMプッシュトークンを登録/更新 Cookie
DELETE /api/v1/notifications/token FCMプッシュトークンを無効化 Cookie
communities (18 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/communities 全コミュニティ一覧(公開) なし
GET /api/v1/communities?communityId=:id 特定のコミュニティ詳細と投稿(公開) なし
POST /api/v1/communities 新しいコミュニティを作成 Cookie
DELETE /api/v1/communities/:id コミュニティを削除 Cookie + 管理者権限
GET /api/v1/communities/me/avatar ユーザーのコミュニティプロフィール取得 Cookie
PUT /api/v1/communities/me/avatar ユーザーのコミュニティプロフィール更新 Cookie
POST /api/v1/communities/:id/join コミュニティに参加 Cookie
DELETE /api/v1/communities/:id/join コミュニティを脱退 Cookie
POST /api/v1/communities/:id/follow コミュニティ内のユーザーをフォロー Cookie
DELETE /api/v1/communities/:id/follow コミュニティ内のユーザーをフォロー解除 Cookie
POST /api/v1/communities/:id/posts 新しい投稿を作成 Cookie
GET /api/v1/communities/:id/posts/:postId 特定の投稿と返信を取得(公開) なし
DELETE /api/v1/communities/:id/posts/:postId 投稿を削除 Cookie + 所有者/管理者
POST /api/v1/communities/:id/posts/:postId/reactions いいね/リポストリアクション追加 Cookie
DELETE /api/v1/communities/:id/posts/:postId/reactions いいね/リポストリアクション削除 Cookie
GET /api/v1/communities/:id/reports コミュニティ通報一覧(管理者限定) Cookie + 管理者権限
POST /api/v1/communities/:id/reports 投稿を通報 Cookie
PATCH /api/v1/communities/:id/reports/:reportId 通報ステータス更新(管理者限定) Cookie + 管理者権限
dm (6 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/dm/threads DMスレッド一覧を取得 Cookie
POST /api/v1/dm/threads 新しいDMスレッドを作成(フレンド) Cookie
GET /api/v1/dm/threads/:threadId スレッドのメッセージを取得 Cookie
POST /api/v1/dm/threads/:threadId/messages スレッドにメッセージ送信 Cookie
POST /api/v1/dm/threads/:threadId/read スレッドを既読にする Cookie
GET /api/v1/dm/messages/:messageId メッセージ詳細を取得(削除用) Cookie
friends (3 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/friends フレンド一覧とフレンド申請を取得 Cookie
POST /api/v1/friends/requests フレンド申請を送信 Cookie
PATCH /api/v1/friends/requests/:requestId フレンド申請を承認/拒否 Cookie
realtime (7 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
POST /api/v1/realtime/rooms 新しい音声/ビデオルームを作成 なし(WebRTCオファー使用)
POST /api/v1/realtime/rooms/:roomId/session 既存のルームに参加 なし(WebRTCオファー使用)
GET /api/v1/realtime/rooms/:roomId/state ルーム状態を取得 Cookie
POST /api/v1/realtime/rooms/:roomId/tracks/publish メディアトラックを公開 Cookie
POST /api/v1/realtime/rooms/:roomId/tracks/subscribe メディアトラックを購読 Cookie
POST /api/v1/realtime/rooms/:roomId/renegotiate WebRTC接続を再ネゴシエート Cookie
POST /api/v1/realtime/communities/:communityId/spaces コミュニティスペース一覧 Cookie
roomViewer (9 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/room-viewer/cats 3Dルームの猫一覧を取得 Cookie
POST /api/v1/room-viewer/cats 3Dルームに猫を追加 Cookie
PUT /api/v1/room-viewer/cats/:catId 猫の位置/回転/スケールを更新 Cookie
DELETE /api/v1/room-viewer/cats/:catId 3Dルームから猫を削除 Cookie
GET /api/v1/room-viewer/screenshots ユーザーのルームスクリーンショット一覧 Cookie
POST /api/v1/room-viewer/screenshots ルームスクリーンショットを保存 Cookie
DELETE /api/v1/room-viewer/screenshots/:id スクリーンショットを削除 Cookie
GET /api/v1/room-viewer/settings ルームビューア設定を取得 Cookie
PUT /api/v1/room-viewer/settings ルームビューア設定を更新 Cookie
blocks (1 エンドポイント)
詳細ドキュメント
Method Path 説明 認証
GET /api/v1/blocks/windows TaskWorks用タスクブロッキングウィンドウ ⚠️ Bearer / Session(ApiKey非対応)

認証方式の注記

  • ApiKey非対応: /api/v1/blocks/windows は Bearer または Session のみ対応
  • 管理者限定: /api/v1/communities/:id/reports などは管理者権限が必要
  • RLS保護: すべてのデータエンドポイントは本人のデータのみ返す

運用メモ

  • ・キーを再表示できないため、失った場合は再発行して旧キーを失効させる。
  • ・レスポンスはすべて本人のデータのみ。RLS で他ユーザーの行は返らない。
  • ・問い合わせ頻度が高いクライアントは expiresAt を設定して定期ローテーションする。
  • ・接続確認は /api/v1/auth/api-keys/verify を設定画面から呼び出すと安全にチェックできる。