バージョン(Document Versions)
ドキュメントのバージョン履歴を参照します。ドキュメントを更新すると更新前の内容が自動的にバージョンとして保存されます。過去のバージョンの内容を閲覧できます。
|
エンドポイント
| GET | /api/v1/docs/documents/{id}/versions | バージョン一覧を取得 |
| GET | /api/v1/docs/documents/{id}/versions/{versionId} | バージョンを取得 |
GET
/api/v1/docs/documents/{id}/versionsバージョン一覧を取得
指定したドキュメントのバージョン履歴を取得します。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | ドキュメント ID |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| Version[] | 任意 | バージョン一覧 | |
total | integer | 任意 | 総件数 |
limit | integer | 任意 | 取得件数 |
offset | integer | 任意 | スキップ件数 |
コード例
curl "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000/versions" \
-H "Cookie: better-auth.session_token=<token>"レスポンス例
{
"items": [
{
"id": "ver_01JQ3KVRS",
"document_id": "doc_01JQ3KXYZ",
"version": 2,
"content": "{\"type\":\"doc\",\"content\":[]}",
"created_by": "usr_01HZABC",
"created_at": "2026-02-18T12:00:00Z"
},
{
"id": "ver_02JQ3KVTU",
"document_id": "doc_01JQ3KXYZ",
"version": 1,
"content": "{\"type\":\"doc\",\"content\":[]}",
"created_by": "usr_01HZABC",
"created_at": "2026-02-15T10:00:00Z"
}
],
"total": 2,
"limit": 2,
"offset": 0
}GET
/api/v1/docs/documents/{id}/versions/{versionId}バージョンを取得
指定したドキュメントの特定バージョンの詳細(本文含む)を取得します。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | ドキュメント ID |
versionId | string | 任意 | バージョン ID |
レスポンスフィールド
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| Version | 任意 | バージョン |
コード例
curl "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000/versions/:versionId" \
-H "Cookie: better-auth.session_token=<token>"レスポンス例
{
"version": {
"id": "ver_01JQ3KVRS",
"document_id": "doc_01JQ3KXYZ",
"version": 2,
"content": "{\"type\":\"doc\",\"content\":[]}",
"created_by": "usr_01HZABC",
"created_at": "2026-02-18T12:00:00Z"
}
}