# LiveDoc API

Create knowledge bases, manage resources, and run semantic retrieval and routing.

This page documents the existing `/v2` Felo APIs, using **Felo account entitlements and Pro-credit rules**. Whether credits are deducted depends on the [operation](https://openapi.felo.ai/docs/faq/billing-and-credits.md#credit-rules-by-v2-capability). For platform-balance calls, choose a supported [Felo OpenAPI endpoint](https://openapi.felo.ai/docs/api-reference/openapi/overview.md); request and response shapes can differ.

LiveDoc web URLs use `https://felo.ai/livedoc/{short_id}`. A browser session with access to the LiveDoc may be required. Keep the API's field names for each endpoint: SuperAgent returns `live_doc_short_id`, while mindmap and PPT creation return `livedoc_short_id`.

The LiveDoc API provides full CRUD operations for LiveDocs and their resources, including document creation, file upload, URL import, and semantic retrieval.

## Use with AI Agents

Install the complete `felo-ai` package to give an Agent LiveDoc support and all other available Felo Skills. The installer dynamically discovers every package directory containing `SKILL.md`, including future package additions. Install all discovered Skills in the Agent's native directory: Codex `~/.codex/skills`, Claude Code `~/.claude/skills`, OpenClaw `~/.agents/skills`, or Hermes Agent `~/.hermes/skills`. The [manual AI Agent setup guide](https://openapi.felo.ai/docs/felo-skills.md) covers the distinct API key and verification steps for each platform.


## Authentication

All requests require an API Key in the `Authorization` header:

```
Authorization: Bearer YOUR_API_KEY
```

---

## 1. Create LiveDoc

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | LiveDoc name |
| `description` | string | No | LiveDoc description |
| `icon` | string | No | LiveDoc icon |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "AI Research Notes",
    "description": "Collection of AI research materials"
  }'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "short_id": "PvyKouzJirXjFdst4uKRK3",
    "name": "AI Research Notes",
    "description": "Collection of AI research materials",
    "icon": null,
    "created_at": "2026-03-09T10:00:00Z",
    "modified_at": "2026-03-09T10:00:00Z"
  }
}
```
### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `short_id` | string | LiveDoc ID |
| `name` | string | LiveDoc name |
| `description` | string | LiveDoc description |
| `icon` | string | LiveDoc icon |
| `created_at` | string | Creation timestamp (ISO 8601) |
| `modified_at` | string | Last modification timestamp (ISO 8601) |
| `is_shared` | boolean | Whether this LiveDoc is shared with the current user (not owned by them) |

---

## 2. List LiveDocs

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs
```

### Query Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `keyword` | string | No | Filter by keyword |
| `page` | integer | No | Page number (1-based) |
| `size` | integer | No | Page size |

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs?keyword=AI&page=1&size=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "total": 2,
    "page": 1,
    "size": 20,
    "items": [
      {
        "short_id": "PvyKouzJirXjFdst4uKRK3",
        "name": "AI Research Notes",
        "description": "Collection of AI research materials",
        "icon": null,
        "created_at": "2026-03-09T10:00:00Z",
        "modified_at": "2026-03-09T10:05:00Z",
        "is_shared": false,
        "readme": {
          "summary": "AI research notes and papers collection",
          "content": "# AI Research Notes\n\nThis LiveDoc contains..."
        }
      }
    ]
  }
}
```
### Response Fields

Each item in `items` contains the same fields as the [Create LiveDoc response](#response-fields), plus:

| Field | Type | Description |
|-------|------|-------------|
| `readme` | object \| null | README information. `null` if no README exists. |
| `readme.summary` | string \| null | One-line project description |
| `readme.content` | string \| null | README content (Markdown) |

---

### Endpoint

```
PUT https://openapi.felo.ai/v2/livedocs/{short_id}
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | New LiveDoc name |
| `description` | string | No | New LiveDoc description |

### Example

```bash
curl -X PUT 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Updated Research Notes"
  }'
```

### Success Response (200)

Returns the updated LiveDoc object (same structure as Create).

---

## 4. Delete LiveDoc

### Endpoint

```
DELETE https://openapi.felo.ai/v2/livedocs/{short_id}
```

### Example

```bash
curl -X DELETE 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": null
}
```
---

## 5. List Resources

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/resources
```

### Query Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource_types` | string[] | No | Filter by resource types |
| `page` | integer | No | Page number (1-based) |
| `size` | integer | No | Page size |

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources?page=1&size=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "total": 2,
    "page": 1,
    "size": 20,
    "items": [
      {
        "id": "res_001",
        "title": "OpenAI Blog Post",
        "link": "https://openai.com/blog/...",
        "snippet": "Summary of the article...",
        "thumbnail": null,
        "resource_type": "web",
        "resource_key": "key_001",
        "status": "completed",
        "source": "url",
        "created_at": "2026-03-09T10:00:10Z",
        "modified_at": "2026-03-09T10:00:15Z"
      }
    ]
  }
}
```
### Resource Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Resource ID |
| `title` | string | Resource title |
| `link` | string | Resource link/URL |
| `snippet` | string | Resource summary |
| `thumbnail` | string | Thumbnail URL |
| `resource_type` | string | Resource type (e.g. `web`, `ai_doc`, `file`) |
| `resource_key` | string | Resource association key |
| `status` | string | Resource status |
| `source` | string | Resource source |
| `created_at` | string | Creation timestamp (ISO 8601) |
| `modified_at` | string | Last modification timestamp (ISO 8601) |

---

## 6. Get Single Resource

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}
```

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

Returns a single resource object (same structure as items in List Resources).

---

## 7. Update Resource

Update a resource's `title`, `snippet`, or `thumbnail`. Only provided fields are updated; omitted fields retain their current values.

### Endpoint

```
PUT https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}
```

### Request Body

All fields are optional.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | New resource title (max 500 characters) |
| `snippet` | string | No | New resource summary (max 2000 characters) |
| `thumbnail` | string | No | New thumbnail URL (max 2000 characters) |

### Example

```bash
curl -X PUT 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Updated Title",
    "snippet": "Updated summary of the resource."
  }'
```

### Success Response (200)

Returns the updated resource object (same structure as items in List Resources).

---

## 8. Update Resource Content

Update the Markdown content of an `ai_doc` resource. Only supported for resources with `resource_type == ai_doc`. The `snippet` field is automatically updated from the first 2000 bytes of the new content.

### Endpoint

```
PUT https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}/content
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `content` | string | Yes | New Markdown content for the resource |

### Example

```bash
curl -X PUT 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001/content' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "content": "# Updated Document\n\nThis is the new content."
  }'
```

### Success Response (200)

Returns the updated resource object (same structure as items in List Resources).

---

## 9. Create Document Resource

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/doc
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | Document title (defaults to "New Document") |
| `content` | string | Yes | Markdown document content; plain text is also valid Markdown |

This creates an `ai_doc` resource. Send headings, lists, and links as Markdown in a JSON string, with newlines escaped as `\n`. Use Markdown for formatted document content.

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/doc' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "My Research Notes",
    "content": "# Research Notes\n\n## Key findings\n\n- First finding\n- Second finding"
  }'
```

### Success Response (200)

Returns the created resource object.
---

## 10. Upload File as Document

Upload a file and convert it to a document resource (`ai_doc` type).

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/upload-doc
```

### Content-Type

`multipart/form-data`

### Request Parts

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | file | Yes | The file to upload |
| `title` | string | No | Document title |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/upload-doc' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'file=@document.pdf' \
  -F 'title=My PDF Document'
```

### Success Response (200)

Returns the created resource object.

---

## 11. Upload File Resource

Upload a file and keep its original format.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/upload
```

### Content-Type

`multipart/form-data`

### Request Parts

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file` | file | Yes | The file to upload |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/upload' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'file=@report.xlsx'
```

### Success Response (200)

Returns the created resource object.
---

## 12. Add URL Resources

Add one or more URLs as resources to a LiveDoc.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/urls
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `urls` | array | Yes | List of URL items to add (1–10). Each item can be a plain string or an object with `url` and optional `title`. |

#### URL Item Formats

Each entry in `urls` can be either:

- A plain string: `"https://example.com/article"`
- An object: `{"url": "https://example.com/article", "title": "Custom Title"}`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | The URL to add (5–2000 characters) |
| `title` | string | No | Custom title for the resource (max 1000 characters). If omitted, the title is auto-generated from the page. |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/urls' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "urls": [
      "https://example.com/article-1",
      {"url": "https://example.com/article-2", "title": "My Custom Title"}
    ]
  }'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": [
    {
      "url": "https://example.com/article-1",
      "status": "success",
      "fail_reason": null,
      "resource_id": "res_003"
    },
    {
      "url": "https://example.com/article-2",
      "status": "existed",
      "fail_reason": null,
      "resource_id": "res_004"
    }
  ]
}
```

### URL Result Fields

| Field | Type | Description |
|-------|------|-------------|
| `url` | string | The processed URL |
| `status` | string | Result status: `success`, `failed`, or `existed` |
| `fail_reason` | string | Reason for failure (null if successful) |
| `resource_id` | string | Created resource ID |

---

## 13. Delete Resource

### Endpoint

```
DELETE https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}
```

### Example

```bash
curl -X DELETE 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": null
}
```

---

## 14. Retrieve (Semantic Search)

Perform semantic retrieval against resources in a LiveDoc.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/retrieve
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | Yes | Query content for semantic search |
| `resource_ids` | string[] | No | Specific resource IDs to search within (1-50). If omitted, relevant resources are auto-routed by query |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/retrieve' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "latest developments in large language models",
    "resource_ids": ["res_001", "res_002"]
  }'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": [
    {
      "id": "res_001",
      "title": "LLM Research Paper",
      "content": "Relevant content excerpt...",
      "score": 0.92,
      "metadata": {}
    }
  ]
}
```

### Retrieve Result Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Resource ID |
| `title` | string | Resource title |
| `content` | string | Matched content |
| `score` | number | Relevance score |
| `metadata` | object | Additional metadata |

---

## 15. Route Resources

Route relevant resources from a LiveDoc based on a query. Returns a list of resource IDs that can be passed to the retrieve endpoint.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/route
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | Yes | Query content for routing |
| `max_resources` | integer | No | Maximum number of resource IDs to return |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/route' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "latest developments in large language models",
    "max_resources": 5
  }'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": ["res_001", "res_003", "res_007"]
}
```

---

## 16. Download Resource Source File

Get the source file of a resource. Returns a `302` redirect to the presigned download URL.

Only supported for resources that have an associated source file (e.g. uploaded documents).

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}/download
```

### Query Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `expires_in` | integer | No | URL expiry in seconds (default: 3600) |

### Example

```bash
curl -L 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001/download' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Response

Returns `302 Found` with a `Location` header pointing to the presigned S3 download URL. HTTP clients with redirect support (e.g. `curl -L`) will follow the redirect and download the file directly.

---

## 17. Get Resource Content

Fetch the extracted text content of a resource. Supported for most resource types (document, web, video, ai_doc, ai_ppt, text, voice, mindmap, etc.). Returns 400 for unsupported types such as `image`.

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/resources/{resource_id}/content
```

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/res_001/content' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "title": "Q4 Financial Report",
    "type": "document",
    "content": "Full extracted text content of the resource..."
  }
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `title` | string | Resource title |
| `type` | string | Resource type |
| `content` | string | Resource content; interpretation depends on `type`, as described below |

### Resource content formats

`data.content` is a string. Use `data.type` to choose how to read it:

| Resource type | Content format | Reading steps |
|---|---|---|
| `ai_doc` | Markdown | Render or store the string as a document; this includes SuperAgent research reports |
| `mindmap` | JSON-encoded object | Decode once to read `layout` and the Markdown heading outline in `text` |
| `ai_ppt` | JSON-encoded object with `slides` | Decode once, then decode each slide's `content` string if it contains JSON |
| Other text-bearing types | Extracted text | Display the text according to your application's needs |

Mindmap content example after decoding:

```json
{
  "layout": "mindMap",
  "text": "# Topic\n## Branch\n### Leaf"
}
```

PPT content example after decoding:

```json
{
  "slides": [
    {
      "page": 1,
      "title": "Introduction",
      "content": "{\"coreIdea\":\"Introduce the topic\",\"slideOverview\":\"Overview of key points\",\"themeDescription\":\"Light background\"}",
      "theme": "light",
      "url": "https://example.com/slide-preview?signature=..."
    }
  ]
}
```

Slide fields depend on the generator and can be absent or contain additional information. Treat `coreIdea`, `slideOverview`, and `themeDescription` as optional presentation metadata. If a slide's `content` is plain text, display it directly.

Slide `url` values are temporary signed links. Their lifetime is determined when issued; retrieve fresh resource content when a link expires. For PPTX downloads, use the separate [PPT export workflow](https://openapi.felo.ai/docs/api-reference/ppt-tasks.md#export-pptx), whose response includes `expires_at`.

---

## 18. PPT Page Retrieve

Perform deep content retrieval on a specific page of a PPT resource. Scrapes the slide page and returns ranked content chunks. The response format is identical to the [Retrieve](#14-retrieve-semantic-search) endpoint.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/resources/ppt-retrieve
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource_id` | string | Yes | PPT resource ID |
| `page_number` | integer | Yes | Page number to retrieve (starts from 1) |
| `query` | string | Yes | Query content describing what to look for |
| `max_chunk` | integer | No | Maximum number of chunks to return (default: 3) |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/resources/ppt-retrieve' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "resource_id": "res_001",
    "page_number": 3,
    "query": "product pricing information",
    "max_chunk": 3
  }'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": [
    {
      "id": "res_001_page_3_chunk_1",
      "title": "Q4 Product Deck",
      "content": "Relevant slide content excerpt...",
      "score": null,
      "metadata": {
        "resource_id": "res_001",
        "page_number": 3,
        "index": 1
      }
    }
  ]
}
```

### Response Fields

Same as [Retrieve Result Fields](#retrieve-result-fields).

---

## Error Codes


| Code | HTTP Status | Description |
|------|-------------|-------------|
| `INVALID_API_KEY` | 401 | API Key is invalid or revoked |
| `LIVEDOC_CREATE_FAILED` | 502 | Failed to create LiveDoc |
| `LIVEDOC_UPDATE_FAILED` | 502 | Failed to update LiveDoc |
| `LIVEDOC_DELETE_FAILED` | 502 | Failed to delete LiveDoc |
| `LIVEDOC_NOT_FOUND` | 404 | LiveDoc not found |
| `LIVEDOC_LIST_FAILED` | 502 | Failed to list LiveDocs |
| `LIVEDOC_RESOURCE_CREATE_FAILED` | 502 | Failed to create resource |
| `LIVEDOC_RESOURCE_UPLOAD_FAILED` | 502 | Failed to upload resource |
| `LIVEDOC_RESOURCE_DELETE_FAILED` | 502 | Failed to delete resource |
| `LIVEDOC_RESOURCE_NOT_FOUND` | 404 | Resource not found |
| `LIVEDOC_RESOURCE_LIST_FAILED` | 502 | Failed to list resources |
| `LIVEDOC_RESOURCE_RETRIEVE_FAILED` | 502 | Failed to retrieve resources |
| `LIVEDOC_RESOURCE_ADD_URLS_FAILED` | 502 | Failed to add URL resources |

---

## 19. Get README

Get the README content of a LiveDoc. Returns an empty string if no README has been set.

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/readme
```

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/readme' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "summary": "A brief one-line description of the project.",
    "content": "# My LiveDoc\n\nThis is the README content in Markdown."
  }
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `summary` | string \| null | One-line project description. Max 2000 characters. |
| `content` | string | README content (Markdown). Empty string if not set. |

---

## 20. Create or Update README

Create or update the README of a LiveDoc (upsert semantics).

### Endpoint

```
PUT https://openapi.felo.ai/v2/livedocs/{short_id}/readme
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `summary` | string | No | One-line project description (max 2000 characters) |
| `content` | string | No | README content (Markdown) |

> **Note:** At least one of `summary` or `content` must be provided.

### Example

```bash
curl -X PUT 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/readme' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "summary": "A brief one-line description of the project.",
    "content": "# My LiveDoc\n\nThis is the README content in Markdown."
  }'
```

### Success Response (200)

Returns the updated README object (same structure as Get README).

---

## 21. Append to README

Append content to the end of an existing README. If no README exists, creates a new one with the provided content.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/readme/append
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `content` | string | Yes | Content to append (Markdown) |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/readme/append' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "content": "\n\n## New Section\n\nAdditional content appended to README."
  }'
```

### Success Response (200)

Returns the complete README object after appending (same structure as Get README).

---

## 22. Delete README

Delete the README of a LiveDoc.

### Endpoint

```
DELETE https://openapi.felo.ai/v2/livedocs/{short_id}/readme
```

### Example

```bash
curl -X DELETE 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/readme' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": null
}
```

---

## 23. List Tasks

Get a paginated list of tasks in a LiveDoc. Results are sorted by `sort` asc, `status` asc, `created_at` desc.

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/tasks
```

### Query Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `status` | integer | No | Filter by status: `0`=TODO, `1`=IN_PROGRESS, `2`=DONE |
| `labels` | string[] | No | Filter by labels (tasks must contain all specified labels) |
| `page` | integer | No | Page number (1-based) |
| `size` | integer | No | Page size |

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks?status=0&page=1&size=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "total": 1,
    "page": 1,
    "size": 20,
    "items": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "title": "Write documentation",
        "description": "Write API documentation for the new endpoints",
        "status": 0,
        "sort": 0,
        "labels": ["docs", "priority-high"],
        "created_at": "2026-03-19T10:00:00Z",
        "modified_at": "2026-03-19T10:00:00Z"
      }
    ]
  }
}
```

### Task Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Task ID (UUID) |
| `title` | string | Task title |
| `description` | string | Task description |
| `status` | integer | Task status: `0`=TODO, `1`=IN_PROGRESS, `2`=DONE |
| `sort` | integer | Sort order (non-negative) |
| `labels` | string[] | Label list |
| `operated_by` | string | Operator signature, e.g. `claude-code`, `openclaw` |
| `created_at` | string | Creation timestamp (ISO 8601) |
| `modified_at` | string | Last modification timestamp (ISO 8601) |

---

## 24. Create Task

Create a new task in a LiveDoc.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/tasks
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | Yes | Task title |
| `description` | string | No | Task description |
| `status` | integer | Yes | Task status: `0`=TODO, `1`=IN_PROGRESS, `2`=DONE |
| `sort` | integer | Yes | Sort order (non-negative integer) |
| `labels` | string[] | No | Label list (max 10, each max 50 characters) |
| `operated_by` | string | No | Operator signature, e.g. `claude-code`, `openclaw` (max 100 characters) |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Write documentation",
    "description": "Write API documentation for the new endpoints",
    "status": 0,
    "sort": 0,
    "labels": ["docs", "priority-high"]
  }'
```

### Success Response (200)

Returns the created task object (same structure as items in List Tasks).

---

## 25. Update Task

Partially update a task. Only provided fields are updated; omitted fields retain their current values.

### Endpoint

```
PATCH https://openapi.felo.ai/v2/livedocs/{short_id}/tasks/{task_id}
```

### Request Body

All fields are optional.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `title` | string | No | New task title |
| `description` | string | No | New task description |
| `status` | integer | No | New status: `0`=TODO, `1`=IN_PROGRESS, `2`=DONE |
| `sort` | integer | No | New sort order (non-negative) |
| `labels` | string[] | No | New label list (max 10, each max 50 characters) |
| `operated_by` | string | No | Operator signature, e.g. `claude-code`, `openclaw` (max 100 characters) |

### Example

```bash
curl -X PATCH 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "status": 1
  }'
```

### Success Response (200)

Returns the updated task object (same structure as items in List Tasks).

---

## 26. Delete Task

Soft-delete a task.

### Endpoint

```
DELETE https://openapi.felo.ai/v2/livedocs/{short_id}/tasks/{task_id}
```

### Example

```bash
curl -X DELETE 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": null
}
```

---

## 27. List Task Records

Get a paginated list of records for a task (comments and change history), sorted by `created_at` ascending.

### Endpoint

```
GET https://openapi.felo.ai/v2/livedocs/{short_id}/tasks/{task_id}/records
```

### Query Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `record_type` | string | No | Filter by record type: `comment`, `edit`, `status_change` |
| `page` | integer | No | Page number (1-based) |
| `size` | integer | No | Page size |

### Example

```bash
curl 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks/550e8400-e29b-41d4-a716-446655440000/records' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Success Response (200)

```json
{
  "status": 200,
  "code": "OK",
  "request_id": "req_example",
  "message": null,
  "data": {
    "total": 2,
    "page": 1,
    "size": 20,
    "items": [
      {
        "id": "rec_001",
        "record_type": "comment",
        "content": "This is a comment",
        "meta": null,
        "task_id": "550e8400-e29b-41d4-a716-446655440000",
        "created_at": "2026-03-19T10:05:00Z",
        "modified_at": "2026-03-19T10:05:00Z"
      },
      {
        "id": "rec_002",
        "record_type": "status_change",
        "content": null,
        "meta": {"from": 0, "to": 1},
        "task_id": "550e8400-e29b-41d4-a716-446655440000",
        "created_at": "2026-03-19T10:10:00Z",
        "modified_at": "2026-03-19T10:10:00Z"
      }
    ]
  }
}
```

### Task Record Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Record ID |
| `record_type` | string | Record type: `comment` / `edit` / `status_change` |
| `content` | string | Comment text (only for `comment` type) |
| `meta` | object | Change details (for `edit` and `status_change` types) |
| `task_id` | string | Parent task ID |
| `operated_by` | string | Operator signature, e.g. `claude-code`, `openclaw` |
| `created_at` | string | Creation timestamp (ISO 8601) |
| `modified_at` | string | Last modification timestamp (ISO 8601) |

---

## 28. Add Task Comment

Add a comment to a task.

### Endpoint

```
POST https://openapi.felo.ai/v2/livedocs/{short_id}/tasks/{task_id}/comments
```

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `content` | string | Yes | Comment content |
| `operated_by` | string | No | Operator signature, e.g. `claude-code`, `openclaw` (max 100 characters) |

### Example

```bash
curl -X POST 'https://openapi.felo.ai/v2/livedocs/PvyKouzJirXjFdst4uKRK3/tasks/550e8400-e29b-41d4-a716-446655440000/comments' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "content": "This task is now in progress."
  }'
```

### Success Response (200)

Returns the created record object (same structure as items in List Task Records).

---

## Error Codes (Updated)

| Code | HTTP Status | Description |
|------|-------------|-------------|
| `INVALID_API_KEY` | 401 | API Key is invalid or revoked |
| `LIVEDOC_CREATE_FAILED` | 502 | Failed to create LiveDoc |
| `LIVEDOC_UPDATE_FAILED` | 502 | Failed to update LiveDoc |
| `LIVEDOC_DELETE_FAILED` | 502 | Failed to delete LiveDoc |
| `LIVEDOC_NOT_FOUND` | 404 | LiveDoc not found |
| `LIVEDOC_LIST_FAILED` | 502 | Failed to list LiveDocs |
| `LIVEDOC_RESOURCE_CREATE_FAILED` | 502 | Failed to create resource |
| `LIVEDOC_RESOURCE_UPLOAD_FAILED` | 502 | Failed to upload resource |
| `LIVEDOC_RESOURCE_DELETE_FAILED` | 502 | Failed to delete resource |
| `LIVEDOC_RESOURCE_NOT_FOUND` | 404 | Resource not found |
| `LIVEDOC_RESOURCE_LIST_FAILED` | 502 | Failed to list resources |
| `LIVEDOC_RESOURCE_RETRIEVE_FAILED` | 502 | Failed to retrieve resources |
| `LIVEDOC_RESOURCE_ADD_URLS_FAILED` | 502 | Failed to add URL resources |
| `LIVEDOC_README_GET_FAILED` | 502 | Failed to get README |
| `LIVEDOC_README_UPDATE_FAILED` | 502 | Failed to create or update README |
| `LIVEDOC_README_DELETE_FAILED` | 502 | Failed to delete README |
| `LIVEDOC_README_NOT_FOUND` | 404 | README not found |
| `LIVEDOC_TASK_LIST_FAILED` | 502 | Failed to list tasks |
| `LIVEDOC_TASK_CREATE_FAILED` | 502 | Failed to create task |
| `LIVEDOC_TASK_UPDATE_FAILED` | 502 | Failed to update task |
| `LIVEDOC_TASK_DELETE_FAILED` | 502 | Failed to delete task |
| `LIVEDOC_TASK_NOT_FOUND` | 404 | Task not found |
| `LIVEDOC_TASK_RECORD_LIST_FAILED` | 502 | Failed to list task records |
| `LIVEDOC_TASK_COMMENT_CREATE_FAILED` | 502 | Failed to create task comment |
