Document Versions
View document version history. When a document is updated, the previous content is automatically saved as a version. You can view the content of past versions.
|
Endpoints
| GET | /api/v1/docs/documents/{id}/versions | List document versions |
| GET | /api/v1/docs/documents/{id}/versions/{versionId} | Get a document version |
GET
/api/v1/docs/documents/{id}/versionsList document versions
Retrieve the version history of the specified document.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Version[] | Optional | List of versions | |
total | integer | Optional | Total count |
limit | integer | Optional | Number of items returned |
offset | integer | Optional | Number of items skipped |
Code Examples
curl "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000/versions" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"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}Get a document version
Retrieve details of a specific version of the document, including the content.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
versionId | string | Optional | Version ID |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Version | Optional | Version |
Code Examples
curl "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000/versions/:versionId" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"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"
}
}