Skip to content

Commit 7efbd5e

Browse files
Pijukatelclaude
andcommitted
docs: document runs/last redispatch sub-paths in OpenAPI spec
The `/v2/acts/{actorId}/runs/last` and `/v2/actor-tasks/{actorTaskId}/runs/last` endpoints redispatch to canonical storage and run-action endpoints after resolving the last run. Previously these sub-paths were only described in prose. This commit adds them as proper OpenAPI path entries for both Actor and actor task namespaces: - log - dataset, dataset/items - key-value-store, key-value-store/keys, key-value-store/records/{recordKey} - request-queue, request-queue/requests, request-queue/requests/{requestId}, request-queue/head - abort, metamorph, reboot Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d412156 commit 7efbd5e

29 files changed

Lines changed: 1927 additions & 0 deletions

File tree

apify-api/openapi/openapi.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,32 @@ paths:
514514
$ref: "paths/actors/acts@{actorId}@runs@{runId}@resurrect.yaml"
515515
"/v2/acts/{actorId}/runs/last":
516516
$ref: "paths/actors/acts@{actorId}@runs@last.yaml"
517+
"/v2/acts/{actorId}/runs/last/log":
518+
$ref: "paths/actors/acts@{actorId}@runs@last@log.yaml"
519+
"/v2/acts/{actorId}/runs/last/dataset":
520+
$ref: "paths/actors/acts@{actorId}@runs@last@dataset.yaml"
521+
"/v2/acts/{actorId}/runs/last/dataset/items":
522+
$ref: "paths/actors/acts@{actorId}@runs@last@dataset@items.yaml"
523+
"/v2/acts/{actorId}/runs/last/key-value-store":
524+
$ref: "paths/actors/acts@{actorId}@runs@last@key-value-store.yaml"
525+
"/v2/acts/{actorId}/runs/last/key-value-store/keys":
526+
$ref: "paths/actors/acts@{actorId}@runs@last@key-value-store@keys.yaml"
527+
"/v2/acts/{actorId}/runs/last/key-value-store/records/{recordKey}":
528+
$ref: "paths/actors/acts@{actorId}@runs@last@key-value-store@records@{recordKey}.yaml"
529+
"/v2/acts/{actorId}/runs/last/request-queue":
530+
$ref: "paths/actors/acts@{actorId}@runs@last@request-queue.yaml"
531+
"/v2/acts/{actorId}/runs/last/request-queue/requests":
532+
$ref: "paths/actors/acts@{actorId}@runs@last@request-queue@requests.yaml"
533+
"/v2/acts/{actorId}/runs/last/request-queue/requests/{requestId}":
534+
$ref: "paths/actors/acts@{actorId}@runs@last@request-queue@requests@{requestId}.yaml"
535+
"/v2/acts/{actorId}/runs/last/request-queue/head":
536+
$ref: "paths/actors/acts@{actorId}@runs@last@request-queue@head.yaml"
537+
"/v2/acts/{actorId}/runs/last/abort":
538+
$ref: "paths/actors/acts@{actorId}@runs@last@abort.yaml"
539+
"/v2/acts/{actorId}/runs/last/metamorph":
540+
$ref: "paths/actors/acts@{actorId}@runs@last@metamorph.yaml"
541+
"/v2/acts/{actorId}/runs/last/reboot":
542+
$ref: "paths/actors/acts@{actorId}@runs@last@reboot.yaml"
517543
"/v2/acts/{actorId}/runs/{runId}":
518544
$ref: "paths/actors/acts@{actorId}@runs@{runId}.yaml"
519545
"/v2/acts/{actorId}/runs/{runId}/abort":
@@ -536,6 +562,32 @@ paths:
536562
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@run-sync-get-dataset-items.yaml"
537563
"/v2/actor-tasks/{actorTaskId}/runs/last":
538564
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last.yaml"
565+
"/v2/actor-tasks/{actorTaskId}/runs/last/log":
566+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@log.yaml"
567+
"/v2/actor-tasks/{actorTaskId}/runs/last/dataset":
568+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@dataset.yaml"
569+
"/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items":
570+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@dataset@items.yaml"
571+
"/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store":
572+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@key-value-store.yaml"
573+
"/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/keys":
574+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@key-value-store@keys.yaml"
575+
"/v2/actor-tasks/{actorTaskId}/runs/last/key-value-store/records/{recordKey}":
576+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@key-value-store@records@{recordKey}.yaml"
577+
"/v2/actor-tasks/{actorTaskId}/runs/last/request-queue":
578+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@request-queue.yaml"
579+
"/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests":
580+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@request-queue@requests.yaml"
581+
"/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/requests/{requestId}":
582+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@request-queue@requests@{requestId}.yaml"
583+
"/v2/actor-tasks/{actorTaskId}/runs/last/request-queue/head":
584+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@request-queue@head.yaml"
585+
"/v2/actor-tasks/{actorTaskId}/runs/last/abort":
586+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml"
587+
"/v2/actor-tasks/{actorTaskId}/runs/last/metamorph":
588+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml"
589+
"/v2/actor-tasks/{actorTaskId}/runs/last/reboot":
590+
$ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml"
539591
/v2/actor-runs:
540592
$ref: paths/actor-runs/actor-runs.yaml
541593
"/v2/actor-runs/{runId}":

apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ get:
6767
schema:
6868
type: string
6969
example: SUCCEEDED
70+
- name: waitForFinish
71+
in: query
72+
description: |
73+
The maximum number of seconds the server waits for the run to finish. By
74+
default it is `0`, the maximum value is `60`. <!--
75+
MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
76+
If the run finishes in time then the returned run object will have a terminal status (e.g. `SUCCEEDED`),
77+
otherwise it will have a transitional status (e.g. `RUNNING`).
78+
style: form
79+
explode: true
80+
schema:
81+
type: number
82+
format: double
7083
responses:
7184
"200":
7285
description: ""
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
post:
2+
tags:
3+
- Actor tasks
4+
summary: Abort last run
5+
description: |
6+
Aborts the last actor task run. Redispatches to [Abort run](/api/v2/actor-run-abort-post).
7+
8+
Using the `status` query parameter you can ensure to only get a run with a certain status
9+
(e.g. `status=SUCCEEDED`). Only the most recent run with that status is used.
10+
operationId: actorTask_runs_last_abort_post
11+
parameters:
12+
- name: actorTaskId
13+
in: path
14+
description: Task ID or a tilde-separated owner's username and Actor task name.
15+
required: true
16+
style: simple
17+
schema:
18+
type: string
19+
example: janedoe~my-task
20+
- name: status
21+
in: query
22+
description: Filter for the run status. Only the most recent run with this status is used.
23+
style: form
24+
explode: true
25+
schema:
26+
type: string
27+
example: SUCCEEDED
28+
- name: gracefully
29+
in: query
30+
description: |
31+
If true passed, the Actor run will abort gracefully.
32+
It will send `aborting` and `persistState` event into run and force-stop the run after 30 seconds.
33+
It is helpful in cases where you plan to resurrect the run later.
34+
style: form
35+
explode: true
36+
schema:
37+
type: boolean
38+
responses:
39+
"200":
40+
description: ""
41+
headers: {}
42+
content:
43+
application/json:
44+
schema:
45+
$ref: ../../components/schemas/actor-runs/RunResponse.yaml
46+
example:
47+
data:
48+
id: HG7ML7M8z78YcAPEB
49+
actId: HDSasDasz78YcAPEB
50+
userId: 7sT5jcggjjA9fNcxF
51+
startedAt: "2019-11-30T07:34:24.202Z"
52+
finishedAt: "2019-12-12T09:30:12.202Z"
53+
status: RUNNING
54+
statusMessage: Actor is running
55+
isStatusMessageTerminal: false
56+
meta:
57+
origin: WEB
58+
clientIp: 172.234.12.34
59+
userAgent: Mozilla/5.0 (iPad)
60+
stats:
61+
inputBodyLen: 240
62+
migrationCount: 0
63+
restartCount: 0
64+
resurrectCount: 0
65+
durationMillis: 26239
66+
runTimeSecs: 26.239
67+
metamorph: 0
68+
computeUnits: 0.0072886
69+
options:
70+
build: latest
71+
timeoutSecs: 300
72+
memoryMbytes: 1024
73+
diskMbytes: 2048
74+
buildId: 7sT5jcggjjA9fNcxF
75+
exitCode: 0
76+
generalAccess: RESTRICTED
77+
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
78+
defaultDatasetId: wmKPijuyDnPZAPRMk
79+
defaultRequestQueueId: FL35cSF7jrxr3BY39
80+
"400":
81+
$ref: ../../components/responses/BadRequest.yaml
82+
deprecated: false
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
get:
2+
tags:
3+
- Actor tasks
4+
summary: Get dataset for last run
5+
description: |
6+
Returns the default dataset of the last actor task run. Redispatches to
7+
[Get dataset](/api/v2/dataset-get).
8+
9+
Using the `status` query parameter you can ensure to only get a run with a certain status
10+
(e.g. `status=SUCCEEDED`). Only the most recent run with that status is used.
11+
operationId: actorTask_runs_last_dataset_get
12+
parameters:
13+
- name: actorTaskId
14+
in: path
15+
description: Task ID or a tilde-separated owner's username and Actor task name.
16+
required: true
17+
style: simple
18+
schema:
19+
type: string
20+
example: janedoe~my-task
21+
- name: status
22+
in: query
23+
description: Filter for the run status. Only the most recent run with this status is used.
24+
style: form
25+
explode: true
26+
schema:
27+
type: string
28+
example: SUCCEEDED
29+
responses:
30+
"200":
31+
description: ""
32+
headers: {}
33+
content:
34+
application/json:
35+
schema:
36+
$ref: ../../components/schemas/datasets/DatasetResponse.yaml
37+
"400":
38+
$ref: ../../components/responses/BadRequest.yaml
39+
deprecated: false
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
get:
2+
tags:
3+
- Actor tasks
4+
summary: Get dataset items for last run
5+
description: |
6+
Returns items from the default dataset of the last actor task run. Redispatches to
7+
[Get dataset items](/api/v2/dataset-items-get). Supports the same query parameters.
8+
9+
Using the `status` query parameter you can ensure to only get a run with a certain status
10+
(e.g. `status=SUCCEEDED`). Only the most recent run with that status is used.
11+
operationId: actorTask_runs_last_dataset_items_get
12+
parameters:
13+
- name: actorTaskId
14+
in: path
15+
description: Task ID or a tilde-separated owner's username and Actor task name.
16+
required: true
17+
style: simple
18+
schema:
19+
type: string
20+
example: janedoe~my-task
21+
- name: status
22+
in: query
23+
description: Filter for the run status. Only the most recent run with this status is used.
24+
style: form
25+
explode: true
26+
schema:
27+
type: string
28+
example: SUCCEEDED
29+
- name: format
30+
in: query
31+
description: Format of the results, possible values are json, jsonl, csv, html, xlsx, xml and rss.
32+
style: form
33+
explode: true
34+
schema:
35+
type: string
36+
default: json
37+
- name: clean
38+
in: query
39+
description: If true, returns only non-empty items and skips hidden fields.
40+
style: form
41+
explode: true
42+
schema:
43+
type: boolean
44+
- name: offset
45+
in: query
46+
description: Number of items that should be skipped at the start.
47+
style: form
48+
explode: true
49+
schema:
50+
type: number
51+
- name: limit
52+
in: query
53+
description: Maximum number of items to return.
54+
style: form
55+
explode: true
56+
schema:
57+
type: number
58+
- name: fields
59+
in: query
60+
description: Comma-separated list of fields to include in the results.
61+
style: form
62+
explode: true
63+
schema:
64+
type: string
65+
- name: omit
66+
in: query
67+
description: Comma-separated list of fields to omit from the results.
68+
style: form
69+
explode: true
70+
schema:
71+
type: string
72+
- name: unwind
73+
in: query
74+
description: Name of a field to unwind. If the field is an array, each element becomes a separate record.
75+
style: form
76+
explode: true
77+
schema:
78+
type: string
79+
- name: flatten
80+
in: query
81+
description: Comma-separated list of fields to flatten. Nested objects are merged into the parent.
82+
style: form
83+
explode: true
84+
schema:
85+
type: string
86+
- name: desc
87+
in: query
88+
description: If true, results are returned in descending order.
89+
style: form
90+
explode: true
91+
schema:
92+
type: boolean
93+
- name: attachment
94+
in: query
95+
description: If true, the response will be returned as a file attachment.
96+
style: form
97+
explode: true
98+
schema:
99+
type: boolean
100+
responses:
101+
"200":
102+
description: ""
103+
headers: {}
104+
content:
105+
application/json:
106+
schema:
107+
type: array
108+
items:
109+
type: object
110+
"400":
111+
$ref: ../../components/responses/BadRequest.yaml
112+
deprecated: false
113+
post:
114+
tags:
115+
- Actor tasks
116+
summary: Push items to dataset for last run
117+
description: |
118+
Pushes items to the default dataset of the last actor task run. Redispatches to
119+
[Push items](/api/v2/dataset-items-post).
120+
121+
Using the `status` query parameter you can ensure to only get a run with a certain status
122+
(e.g. `status=SUCCEEDED`). Only the most recent run with that status is used.
123+
operationId: actorTask_runs_last_dataset_items_post
124+
parameters:
125+
- name: actorTaskId
126+
in: path
127+
description: Task ID or a tilde-separated owner's username and Actor task name.
128+
required: true
129+
style: simple
130+
schema:
131+
type: string
132+
example: janedoe~my-task
133+
- name: status
134+
in: query
135+
description: Filter for the run status. Only the most recent run with this status is used.
136+
style: form
137+
explode: true
138+
schema:
139+
type: string
140+
example: SUCCEEDED
141+
requestBody:
142+
required: true
143+
content:
144+
application/json:
145+
schema:
146+
type: array
147+
items:
148+
type: object
149+
responses:
150+
"201":
151+
description: Items were added.
152+
headers: {}
153+
"400":
154+
$ref: ../../components/responses/BadRequest.yaml
155+
deprecated: false

0 commit comments

Comments
 (0)