Documents
Create, update, list, and delete documents. Documents have statuses (draft / review / published / archived) and versions are automatically saved on update.
|
Endpoints
| GET | /api/v1/docs/documents | List documents |
| POST | /api/v1/docs/documents | Create a document |
| GET | /api/v1/docs/documents/{id} | Get a document |
| PATCH | /api/v1/docs/documents/{id} | Update a document |
| DELETE | /api/v1/docs/documents/{id} | Delete a document |
GET
/api/v1/docs/documentsList documents
Retrieve a list of documents in the organization. Use folder_id to filter documents within a specific folder.
Authentication required— Include session cookie or Bearer token
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
folder_id | string | Optional | Filter by folder ID |
status | string | Optional | Filter by status (draft / review / published / archived) |
limit | integer | Optional | Number of items to return (default: 50, max: 200) |
offset | integer | Optional | Number of items to skip |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Document[] | Optional | List of documents | |
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" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"items": [
{
"id": "doc_01JQ3KXYZ",
"organization_id": "org_01HZXYZ",
"title": "Product Requirements Document",
"content": null,
"status": "draft",
"folder_id": "folder_01JQ3KABC",
"category": "engineering",
"tags": "product,requirements",
"version": 3,
"created_by": "usr_01HZABC",
"updated_by": "usr_01HZDEF",
"created_at": "2026-02-10T09:00:00Z",
"updated_at": "2026-02-20T15:30:00Z"
}
],
"total": 12,
"limit": 50,
"offset": 0
}POST
/api/v1/docs/documentsCreate a document
Create a new document. If status is omitted, the document is created as draft.
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
title | string | Required | Title |
content | string | Optional | Content (JSON format) |
status | string | Optional | Status (default: draft) |
folderId | string | Optional | Folder ID (omit for root) |
category | string | Optional | Category |
tags | string | Optional | Tags (comma-separated) |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Document | Optional | Created document |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/docs/documents" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Requirements Document",
"status": "draft",
"folderId": "folder_01JQ3KABC",
"category": "engineering",
"tags": "product,requirements"
}'Response Example
{
"document": {
"id": "doc_01JQ3KXYZ",
"organization_id": "org_01HZXYZ",
"title": "Product Requirements Document",
"content": null,
"status": "draft",
"folder_id": "folder_01JQ3KABC",
"category": "engineering",
"tags": "product,requirements",
"version": 3,
"created_by": "usr_01HZABC",
"updated_by": "usr_01HZDEF",
"created_at": "2026-02-10T09:00:00Z",
"updated_at": "2026-02-20T15:30:00Z"
}
}GET
/api/v1/docs/documents/{id}Get a document
Retrieve detailed information for 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 |
|---|---|---|---|
| Document | Optional | Document |
Code Examples
curl "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"document": {
"id": "doc_01JQ3KXYZ",
"organization_id": "org_01HZXYZ",
"title": "Product Requirements Document",
"content": null,
"status": "draft",
"folder_id": "folder_01JQ3KABC",
"category": "engineering",
"tags": "product,requirements",
"version": 3,
"created_by": "usr_01HZABC",
"updated_by": "usr_01HZDEF",
"created_at": "2026-02-10T09:00:00Z",
"updated_at": "2026-02-20T15:30:00Z"
}
}PATCH
/api/v1/docs/documents/{id}Update a document
Update a document. The previous content is automatically saved as a version before the update.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
title | string | Optional | Title |
content | string | Optional | Content (JSON format) |
status | string | Optional | Status (draft / review / published / archived) |
folderId | string | null | Optional | Folder ID (null to move to root) |
category | string | null | Optional | Category |
tags | string | null | Optional | Tags (comma-separated) |
Response Fields
| Name | Type | Required | Description |
|---|---|---|---|
| Document | Optional | Updated document |
Code Examples
curl -X PATCH "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Requirements Document v2",
"status": "review"
}'Response Example
{
"document": {
"id": "doc_01JQ3KXYZ",
"organization_id": "org_01HZXYZ",
"title": "Product Requirements Document v2",
"content": null,
"status": "review",
"folder_id": "folder_01JQ3KABC",
"category": "engineering",
"tags": "product,requirements",
"version": 4,
"created_by": "usr_01HZABC",
"updated_by": "usr_01HZDEF",
"created_at": "2026-02-10T09:00:00Z",
"updated_at": "2026-02-20T15:30:00Z"
}
}DELETE
/api/v1/docs/documents/{id}Delete a document
Delete the specified document. Associated version history is also deleted.
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 |
|---|---|---|---|
success | boolean | Optional | Deletion success flag |
Code Examples
curl -X DELETE "https://api.blueai.jp/api/v1/docs/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"Response Example
{
"success": true
}