Skip to content

Commit 8c7e259

Browse files
authored
feat(api): added openapi endpoints (#1422)
Recently, we introduced two new endpoints that return the OpenAPI specification: - `/acts/<actorId>/builds/<buildId>/openapi-specification` - `/actor-builds/<buildId>/openapi-specification` **This PR updates the documentation to include these endpoints.** @TC-MO Let me, please, know if you think we should add any additional information 🙏
1 parent 5859871 commit 8c7e259

File tree

6 files changed

+442
-0
lines changed

6 files changed

+442
-0
lines changed
Lines changed: 348 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,348 @@
1+
title: GetOpenApiResponse
2+
type: object
3+
properties:
4+
openapi:
5+
type: string
6+
example: 3.0.1
7+
info:
8+
type: object
9+
properties:
10+
title:
11+
type: string
12+
example: Your Magic Actor
13+
version:
14+
type: string
15+
example: '1.0'
16+
x-build-id:
17+
type: string
18+
example: 'ID of build'
19+
servers:
20+
type: array
21+
items:
22+
type: object
23+
properties:
24+
url:
25+
type: string
26+
example: https://api.apify.com/v2
27+
paths:
28+
type: object
29+
properties:
30+
/acts/<username>~<actor>/run-sync-get-dataset-items:
31+
type: object
32+
properties:
33+
post:
34+
type: object
35+
properties:
36+
operationId:
37+
type: string
38+
example: run-sync-get-dataset-items
39+
x-openai-isConsequential:
40+
type: boolean
41+
example: false
42+
summary:
43+
type: string
44+
example: Executes an Actor, waits for its completion, and returns Actor's dataset items in response.
45+
tags:
46+
type: array
47+
items:
48+
type: string
49+
example: ['Run Actor']
50+
requestBody:
51+
type: object
52+
properties:
53+
required:
54+
type: boolean
55+
example: true
56+
content:
57+
type: object
58+
properties:
59+
application/json:
60+
type: object
61+
properties:
62+
schema:
63+
type: object
64+
properties:
65+
$ref:
66+
type: string
67+
example: '#/components/schemas/inputSchema'
68+
parameters:
69+
type: array
70+
items:
71+
type: object
72+
properties:
73+
name:
74+
type: string
75+
example: token
76+
in:
77+
type: string
78+
example: query
79+
required:
80+
type: boolean
81+
example: true
82+
schema:
83+
type: object
84+
properties:
85+
type:
86+
type: string
87+
example: string
88+
description:
89+
type: string
90+
example: Enter your Apify token here
91+
responses:
92+
type: object
93+
properties:
94+
'200':
95+
type: object
96+
properties:
97+
description:
98+
type: string
99+
example: OK
100+
/acts/<username>~<actor>/runs:
101+
type: object
102+
properties:
103+
post:
104+
type: object
105+
properties:
106+
operationId:
107+
type: string
108+
example: runs
109+
x-openai-isConsequential:
110+
type: boolean
111+
example: false
112+
summary:
113+
type: string
114+
example: Executes an Actor and returns information about the initiated run in response.
115+
tags:
116+
type: array
117+
items:
118+
type: string
119+
example: ['Run Actor']
120+
requestBody:
121+
type: object
122+
properties:
123+
required:
124+
type: boolean
125+
example: true
126+
content:
127+
type: object
128+
properties:
129+
application/json:
130+
type: object
131+
properties:
132+
schema:
133+
type: object
134+
properties:
135+
$ref:
136+
type: string
137+
example: '#/components/schemas/inputSchema'
138+
parameters:
139+
type: array
140+
items:
141+
type: object
142+
properties:
143+
name:
144+
type: string
145+
in:
146+
type: string
147+
example: query
148+
required:
149+
type: boolean
150+
schema:
151+
type: object
152+
properties:
153+
type:
154+
type: string
155+
description:
156+
type: string
157+
responses:
158+
type: object
159+
properties:
160+
'200':
161+
type: object
162+
properties:
163+
description:
164+
type: string
165+
example: OK
166+
content:
167+
type: object
168+
properties:
169+
application/json:
170+
type: object
171+
properties:
172+
schema:
173+
type: object
174+
properties:
175+
$ref:
176+
type: string
177+
example: '#/components/schemas/runsResponseSchema'
178+
/acts/<username>~<actor>/run-sync:
179+
type: object
180+
properties:
181+
post:
182+
type: object
183+
properties:
184+
operationId:
185+
type: string
186+
example: run-sync
187+
x-openai-isConsequential:
188+
type: boolean
189+
example: false
190+
summary:
191+
type: string
192+
example: Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.
193+
tags:
194+
type: array
195+
items:
196+
type: string
197+
example: ['Run Actor']
198+
requestBody:
199+
type: object
200+
properties:
201+
required:
202+
type: boolean
203+
example: true
204+
content:
205+
type: object
206+
properties:
207+
application/json:
208+
type: object
209+
properties:
210+
schema:
211+
type: object
212+
properties:
213+
$ref:
214+
type: string
215+
example: '#/components/schemas/inputSchema'
216+
parameters:
217+
type: array
218+
items:
219+
type: object
220+
properties:
221+
name:
222+
type: string
223+
in:
224+
type: string
225+
example: query
226+
required:
227+
type: boolean
228+
schema:
229+
type: object
230+
properties:
231+
type:
232+
type: string
233+
description:
234+
type: string
235+
responses:
236+
type: object
237+
properties:
238+
'200':
239+
type: object
240+
properties:
241+
description:
242+
type: string
243+
example: OK
244+
components:
245+
type: object
246+
properties:
247+
schemas:
248+
type: object
249+
properties:
250+
inputSchema:
251+
type: object
252+
properties:
253+
type:
254+
type: string
255+
example: object
256+
runsResponseSchema:
257+
type: object
258+
properties:
259+
type:
260+
type: string
261+
example: object
262+
properties:
263+
type: object
264+
properties:
265+
data:
266+
type: object
267+
properties:
268+
type:
269+
type: string
270+
example: object
271+
properties:
272+
type: object
273+
properties:
274+
id:
275+
type: object
276+
properties:
277+
type:
278+
type: string
279+
example: string
280+
actId:
281+
type: object
282+
properties:
283+
type:
284+
type: string
285+
example: string
286+
userId:
287+
type: object
288+
properties:
289+
type:
290+
type: string
291+
example: string
292+
startedAt:
293+
type: object
294+
properties:
295+
type:
296+
type: string
297+
example: string
298+
format:
299+
type: string
300+
example: date-time
301+
example:
302+
type: string
303+
example: '2025-01-08T00:00:00.000Z'
304+
finishedAt:
305+
type: object
306+
properties:
307+
type:
308+
type: string
309+
example: string
310+
format:
311+
type: string
312+
example: date-time
313+
example:
314+
type: string
315+
example: '2025-01-08T00:00:00.000Z'
316+
status:
317+
type: object
318+
properties:
319+
type:
320+
type: string
321+
example: string
322+
example:
323+
type: string
324+
example: 'READY'
325+
meta:
326+
type: object
327+
properties:
328+
type:
329+
type: string
330+
example: object
331+
properties:
332+
type: object
333+
properties:
334+
origin:
335+
type: object
336+
properties:
337+
type:
338+
type: string
339+
example: string
340+
example:
341+
type: string
342+
example: 'API'
343+
userAgent:
344+
type: object
345+
properties:
346+
type:
347+
type: string
348+
example: string

apify-api/openapi/components/tags.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,15 @@
251251
```
252252
253253
In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL.
254+
- name: Actors/Get OpenAPI specification
255+
x-displayName: Get OpenAPI specification
256+
x-parent-tag-name: Actors
257+
x-trait: 'true'
258+
description: |
259+
Get the OpenAPI specification for Actor builds. Two similar endpoints are available:
260+
261+
- [First endpoint](/api/v2/act-openapi-specification-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build.
262+
- [Second endpoint](/api/v2/actor-build-openapi-specification-get): Requires only `buildId`.
254263
- name: Actor tasks
255264
x-displayName: Actor tasks
256265
x-legacy-doc-urls:
@@ -548,6 +557,15 @@
548557
- '#tag/Actor-buildsBuild-log'
549558
x-trait: 'true'
550559
description: Check out [Logs](#/reference/logs) for full reference.
560+
- name: Actor builds/Get OpenAPI specification
561+
x-displayName: Get OpenAPI specification
562+
x-parent-tag-name: Actor builds
563+
x-trait: 'true'
564+
description: |
565+
Get the OpenAPI specification for Actor builds. Two similar endpoints are available:
566+
567+
- [First endpoint](/api/v2/act-openapi-specification-get): Requires both `actorId` and `buildId`. Use `default` as the `buildId` to get the OpenAPI schema for the default Actor build.
568+
- [Second endpoint](/api/v2/actor-build-openapi-specification-get): Requires only `buildId`.
551569
- name: Key-value stores
552570
x-displayName: Key-value stores
553571
x-legacy-doc-urls:

apify-api/openapi/components/x-tag-groups.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Actors/Metamorph run
2020
- Actors/Resurrect run
2121
- Actors/Last run object and its storages
22+
- Actors/Get OpenAPI specification
2223
- name: Actor tasks
2324
tags:
2425
- Actor tasks
@@ -50,6 +51,7 @@
5051
- Actor builds/Delete build
5152
- Actor builds/Abort build
5253
- Actor builds/Build log
54+
- Actor builds/Get OpenAPI specification
5355
- name: Key-value stores
5456
tags:
5557
- Key-value stores

0 commit comments

Comments
 (0)