@@ -17,6 +17,8 @@ curl -H "Authorization: Bearer YOUR_TOKEN" \
1717 https://your-server.com/v2/datasets
1818```
1919
20+ All resource endpoints are user-scoped — authenticated users can only access their own resources.
21+
2022---
2123
2224## Datasets
@@ -42,6 +44,15 @@ curl -X POST \
4244 https://your-server.com/v2/datasets/{id}/items
4345```
4446
47+ ### Retrieve Items
48+
49+ Supports pagination with ` offset ` and ` limit ` query parameters (max limit: 1000).
50+
51+ ``` bash
52+ curl -H " Authorization: Bearer $TOKEN " \
53+ " https://your-server.com/v2/datasets/{id}/items?offset=0&limit=100"
54+ ```
55+
4556---
4657
4758## Key-Value Stores
@@ -53,6 +64,7 @@ Store arbitrary data by key.
5364| ` GET ` | ` /v2/key-value-stores ` | List all stores |
5465| ` POST ` | ` /v2/key-value-stores ` | Create a new store |
5566| ` GET ` | ` /v2/key-value-stores/{id} ` | Get store details |
67+ | ` DELETE ` | ` /v2/key-value-stores/{id} ` | Delete a store |
5668| ` PUT ` | ` /v2/key-value-stores/{id}/records/{key} ` | Set a record |
5769| ` GET ` | ` /v2/key-value-stores/{id}/records/{key} ` | Get a record |
5870| ` DELETE ` | ` /v2/key-value-stores/{id}/records/{key} ` | Delete a record |
@@ -68,19 +80,33 @@ Store arbitrary data by key.
6880
6981Manage URLs to crawl with automatic deduplication.
7082
71- | Method | Endpoint | Description |
72- | -------- | --------------------------------------------------- | ----------------------- |
73- | ` GET ` | ` /v2/request-queues ` | List all queues |
74- | ` POST ` | ` /v2/request-queues ` | Create a new queue |
75- | ` POST ` | ` /v2/request-queues/{id}/requests ` | Add requests to queue |
76- | ` POST ` | ` /v2/request-queues/{id}/head/lock ` | Lock and fetch requests |
77- | ` DELETE ` | ` /v2/request-queues/{id}/requests/{requestId}/lock ` | Release a lock |
78- | ` PUT ` | ` /v2/request-queues/{id}/requests/{requestId} ` | Update request status |
83+ | Method | Endpoint | Description |
84+ | -------- | --------------------------------------------------- | ------------------------ |
85+ | ` GET ` | ` /v2/request-queues ` | List all queues |
86+ | ` POST ` | ` /v2/request-queues ` | Create a new queue |
87+ | ` GET ` | ` /v2/request-queues/{id} ` | Get queue details |
88+ | ` DELETE ` | ` /v2/request-queues/{id} ` | Delete a queue |
89+ | ` GET ` | ` /v2/request-queues/{id}/head ` | Get next pending requests |
90+ | ` POST ` | ` /v2/request-queues/{id}/head/lock ` | Lock and fetch requests |
91+ | ` POST ` | ` /v2/request-queues/{id}/requests ` | Add request to queue |
92+ | ` POST ` | ` /v2/request-queues/{id}/requests/batch ` | Batch add requests |
93+ | ` GET ` | ` /v2/request-queues/{id}/requests/{requestId} ` | Get request details |
94+ | ` PUT ` | ` /v2/request-queues/{id}/requests/{requestId} ` | Update request status |
95+ | ` PUT ` | ` /v2/request-queues/{id}/requests/{requestId}/lock ` | Prolong request lock |
96+ | ` DELETE ` | ` /v2/request-queues/{id}/requests/{requestId}/lock ` | Release a lock |
7997
8098### Deduplication
8199
82100Requests are deduplicated by ` uniqueKey ` . Adding a request with an existing ` uniqueKey ` is a no-op.
83101
102+ ### Locking
103+
104+ The lock endpoint (` POST .../head/lock ` ) supports distributed crawling. Parameters:
105+
106+ - ` lockSecs ` — Lock duration in seconds (max 86400)
107+ - ` limit ` — Number of requests to fetch (max 1000)
108+ - ` clientKey ` — Unique identifier for the crawling client
109+
84110---
85111
86112## Actors
@@ -96,18 +122,31 @@ Manage Actor definitions.
96122| ` DELETE ` | ` /v2/acts/{id} ` | Delete an Actor |
97123| ` POST ` | ` /v2/acts/{id}/runs ` | Start a new run |
98124
125+ ### Input Validation
126+
127+ Actor create/update bodies are validated with the following constraints:
128+
129+ - ` name ` — 1-100 chars, alphanumeric with dots, dashes, underscores
130+ - ` timeout ` — Max 86400 seconds (24h)
131+ - ` memory ` — Max 16384 MB (16 GB)
132+
99133---
100134
101135## Runs
102136
103137Monitor Actor executions.
104138
105- | Method | Endpoint | Description |
106- | ------ | --------------------------- | --------------------- |
107- | ` GET ` | ` /v2/actor-runs ` | List all runs |
108- | ` GET ` | ` /v2/actor-runs/{id} ` | Get run status |
109- | ` POST ` | ` /v2/actor-runs/{id}/abort ` | Abort a running Actor |
110- | ` GET ` | ` /v2/actor-runs/{id}/log ` | Get run logs |
139+ | Method | Endpoint | Description |
140+ | ------ | --------------------------------------------------------- | ------------------------------- |
141+ | ` GET ` | ` /v2/actor-runs ` | List all runs |
142+ | ` GET ` | ` /v2/actor-runs/{id} ` | Get run status |
143+ | ` PUT ` | ` /v2/actor-runs/{id} ` | Update run status |
144+ | ` POST ` | ` /v2/actor-runs/{id}/abort ` | Abort a running Actor |
145+ | ` POST ` | ` /v2/actor-runs/{id}/resurrect ` | Resurrect a failed run |
146+ | ` GET ` | ` /v2/actor-runs/{id}/logs ` | Get run logs |
147+ | ` POST ` | ` /v2/actor-runs/{id}/logs ` | Append log entry |
148+ | ` GET ` | ` /v2/actor-runs/{id}/dataset/items ` | Get run's dataset items |
149+ | ` GET ` | ` /v2/actor-runs/{id}/key-value-store/records/{key} ` | Get run's KV store record |
111150
112151### Run Status Values
113152
@@ -136,6 +175,22 @@ All successful responses wrap data in a `data` field:
136175}
137176```
138177
178+ ### Validation Errors
179+
180+ Invalid request bodies return a 400 with Zod validation details:
181+
182+ ``` json
183+ {
184+ "error" : {
185+ "type" : " validation_error" ,
186+ "message" : " Validation failed" ,
187+ "details" : [
188+ { "path" : [" name" ], "message" : " String must contain at least 1 character(s)" }
189+ ]
190+ }
191+ }
192+ ```
193+
139194### Error Responses
140195
141196``` json
@@ -151,6 +206,6 @@ All successful responses wrap data in a `data` field:
151206| --------- | ------------------------------ |
152207| ` 400 ` | Bad request / validation error |
153208| ` 401 ` | Authentication required |
154- | ` 403 ` | Permission denied |
155209| ` 404 ` | Resource not found |
210+ | ` 409 ` | Conflict (e.g., locked request)|
156211| ` 500 ` | Internal server error |
0 commit comments