Skip to content

Commit fb56b9b

Browse files
authored
feat: added default build endpoint (#1423)
Recently we released endpoint to get default actor build: `/v2/acts/:actorId/builds/default` **This PR updates the documentation to include this endpoint.** <img width="338" alt="Screenshot 2025-01-22 at 11 22 34" src="https://github.com/user-attachments/assets/2f55917a-6196-4d47-ba65-805699c0a385" /> We already had this endpoint: `/v2/acts/:actorId/builds/:buildId` I was considering just adding information, that instead of `buildId` `default` can be passed. But since this endpoint is deprecated it does not make sense to me. @TC-MO Let me know what do you think?
1 parent 8c7e259 commit fb56b9b

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

apify-api/openapi/components/tags.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
x-trait: 'true'
128128
description: '**[DEPRECATED]** API endpoints related to build of the actor were
129129
moved under new namespace [`actor-builds`](#/reference/actor-builds).'
130+
- name: Actors/Default build object
131+
x-displayName: Default build object
132+
x-parent-tag-name: Actor builds
133+
x-trait: 'true'
130134
- name: Actors/Abort build
131135
x-displayName: Abort build
132136
x-parent-tag-name: Actors

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Actors/Webhook collection
1111
- Actors/Build collection
1212
- Actors/Build object
13+
- Actors/Default build object
1314
- Actors/Abort build
1415
- Actors/Run collection
1516
- Actors/Run actor synchronously

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ paths:
499499
$ref: 'paths/actors/acts@{actorId}@builds.yaml'
500500
'/v2/acts/{actorId}/builds/{buildId}':
501501
$ref: 'paths/actors/acts@{actorId}@builds@{buildId}.yaml'
502+
'/v2/acts/{actorId}/builds/default':
503+
$ref: 'paths/actors/acts@{actorId}@[email protected]'
502504
'/v2/acts/{actorId}/builds/{buildId}/abort':
503505
$ref: 'paths/actors/acts@{actorId}@builds@{buildId}@abort.yaml'
504506
'/v2/acts/{actorId}/builds/{buildId}/openapi-specification':
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
get:
2+
tags:
3+
- Actors/Default build object
4+
summary: Get default build
5+
description: |
6+
Get the default build for an Actor.
7+
8+
Use the optional `waitForFinish` parameter to synchronously wait for the build to finish.
9+
This avoids the need for periodic polling when waiting for the build to complete.
10+
11+
This endpoint does not require an authentication token. Instead, calls are authenticated using the build's unique ID.
12+
However, if you access the endpoint without a token, certain attributes (e.g., `usageUsd` and `usageTotalUsd`) will be hidden.
13+
operationId: act_build_default_get
14+
security:
15+
- apiKeyActorBuilds: []
16+
- httpBearerActorBuilds: []
17+
parameters:
18+
- name: actorId
19+
in: path
20+
description: Actor ID or a tilde-separated owner's username and Actor name.
21+
required: true
22+
style: simple
23+
schema:
24+
type: string
25+
example: janedoe~my-actor
26+
- name: waitForFinish
27+
in: query
28+
description: |
29+
The maximum number of seconds the server waits for the build to finish.
30+
If the build finishes within this time, the returned build object will have a terminal status (e.g. `SUCCEEDED`),
31+
otherwise it will have a transitional status (e.g. `RUNNING`).
32+
33+
By default it is `0`, the maximum value is `60`. <!-- MAX_ACTOR_JOB_ASYNC_WAIT_SECS -->
34+
style: form
35+
explode: true
36+
schema:
37+
type: number
38+
format: double
39+
example: 60
40+
responses:
41+
'200':
42+
description: ''
43+
headers: {}
44+
content:
45+
application/json:
46+
schema:
47+
$ref: '../../components/schemas/actor-builds/GetBuildResponse.yaml'
48+
example:
49+
data:
50+
id: HG7ML7M8z78YcAPEB
51+
actId: janedoe~my-actor
52+
userId: klmdEpoiojmdEMlk3
53+
startedAt: '2019-11-30T07:34:24.202Z'
54+
finishedAt: '2019-12-12T09:30:12.202Z'
55+
status: SUCCEEDED
56+
meta:
57+
origin: WEB
58+
clientIp: 172.234.12.34
59+
userAgent: Mozilla/5.0 (iPad)
60+
stats:
61+
durationMillis: 1000
62+
runTimeSecs: 45.718
63+
computeUnits: 0.012699444444444444
64+
options:
65+
useCache: false
66+
betaPackages: false
67+
memoryMbytes: 1024
68+
diskMbytes: 2048
69+
usage:
70+
ACTOR_COMPUTE_UNITS: 0.08
71+
usageTotalUsd: 0.02
72+
usageUsd:
73+
ACTOR_COMPUTE_UNITS: 0.02
74+
inputSchema: '{\n \"title\": \"Schema for ... }'
75+
readme: '# Magic Actor\nThis Actor is magic.'
76+
buildNumber: 0.1.1

0 commit comments

Comments
 (0)