You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/http-api.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,9 @@ GET /v1/contexts
26
26
| Parameter | Type | Default | Description |
27
27
|-----------|------|---------|-------------|
28
28
|`limit`| int | 100 | Max contexts to return |
29
-
|`offset`| int | 0 | Pagination offset |
29
+
|`tag`| string | - | Filter by exact client tag |
30
+
|`include_provenance`| bool | false | Include provenance in each context |
31
+
|`include_lineage`| bool | false | Include parent/root/children lineage summary |
30
32
31
33
**Response:**
32
34
@@ -50,6 +52,13 @@ GET /v1/contexts
50
52
GET /v1/contexts/:context_id
51
53
```
52
54
55
+
**Query Parameters:**
56
+
57
+
| Parameter | Type | Default | Description |
58
+
|-----------|------|---------|-------------|
59
+
|`include_provenance`| bool | true | Include provenance block |
60
+
|`include_lineage`| bool | true | Include lineage block with parent/root/children |
61
+
53
62
**Response:**
54
63
55
64
```json
@@ -65,12 +74,33 @@ GET /v1/contexts/:context_id
65
74
66
75
-`404 Not Found` - Context doesn't exist
67
76
77
+
### List Child Contexts
78
+
79
+
```http
80
+
GET /v1/contexts/:context_id/children
81
+
```
82
+
83
+
**Query Parameters:**
84
+
85
+
| Parameter | Type | Default | Description |
86
+
|-----------|------|---------|-------------|
87
+
|`recursive`| bool | false | Include all descendants, not just direct children |
88
+
|`limit`| int | 256 | Max child contexts to return |
89
+
|`include_provenance`| bool | true | Include provenance in each child |
90
+
|`include_lineage`| bool | true | Include lineage in each child |
91
+
68
92
### Create Context
69
93
70
94
```http
71
95
POST /v1/contexts/create
72
96
```
73
97
98
+
Alias:
99
+
100
+
```http
101
+
POST /v1/contexts
102
+
```
103
+
74
104
**Request Body:**
75
105
76
106
```json
@@ -235,6 +265,12 @@ Use `next_before_turn_id` from the previous response to continue paging.
235
265
POST /v1/contexts/:context_id/append
236
266
```
237
267
268
+
Alias:
269
+
270
+
```http
271
+
POST /v1/contexts/:context_id/turns
272
+
```
273
+
238
274
**Request Body:**
239
275
240
276
```json
@@ -254,10 +290,13 @@ POST /v1/contexts/:context_id/append
254
290
|-------|------|----------|-------------|
255
291
|`type_id`| string | Yes | Type identifier |
256
292
|`type_version`| int | Yes | Type version |
257
-
|`data`| object | Yes | Turn payload (will be encoded as msgpack) |
293
+
|`data`| object | Yes*| Turn payload (will be encoded as msgpack) |
294
+
|`payload`| object | Yes*| Alias for `data` (for compatibility) |
258
295
|`parent_turn_id`| string | No | Parent turn (default: current head) |
259
296
|`idempotency_key`| string | No | For safe retries |
260
297
298
+
\*At least one of `data` or `payload` is required.
299
+
261
300
**Response:**
262
301
263
302
```json
@@ -275,7 +314,7 @@ POST /v1/contexts/:context_id/append
275
314
-`409 Conflict` - Invalid parent_turn_id
276
315
-`422 Unprocessable Entity` - Invalid data or missing type
277
316
278
-
**Note:** The HTTP API accepts JSON `data` and converts it to msgpack internally. Numeric field tags are derived from the type registry. For maximum control over msgpack encoding, use the binary protocol.
317
+
**Note:** The HTTP API accepts JSON payloads and converts them to msgpack internally. If a type descriptor exists, numeric tags are derived from the registry. If no descriptor exists, the JSON structure is still persisted as msgpack (string/numeric keys preserved). For maximum control over encoding, use the binary protocol.
0 commit comments