From 630d9ba3cc22c71158a8e348a523ff76c1c5d2b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 May 2026 01:09:33 +0000 Subject: [PATCH 1/4] fix(openapi): add missing error types and broaden builds/default 403 Error: Response OpenAPI validation error {"url":"/v2/acts/{actorId}/runs","method":"POST","statusCode":403,"errors":[{"message":"must be equal to one of the allowed values: ...","errorCode":"enum.openapi.validation","path":"/response/error/type"}]} Files: apify-api/openapi/components/schemas/common/ErrorType.yaml:129 Root cause: Error type "full-permission-actor-not-approved" is returned by the API for actors that require full account access but were not yet approved (HTTP 403), but the type was missing from the ErrorType enum. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/packages/errors/src/errors/actor.ts#L61 Error: Response OpenAPI validation error {"url":"/v2/schedules","method":"POST","statusCode":400,"errors":[{"message":"must be equal to one of the allowed values: ...","errorCode":"enum.openapi.validation","path":"/response/error/type"}]} Files: apify-api/openapi/components/schemas/common/ErrorType.yaml:301 Root cause: Error type "run-input-body-not-valid-json" is returned by the API when the schedule run input body contains invalid JSON (HTTP 400), but the type was missing from the ErrorType enum. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/packages/errors/src/errors/scheduling.ts#L40 Error: Response OpenAPI validation error {"url":"/v2/acts/{actorId}/builds/default","method":"GET","statusCode":403,"errors":[{"message":"must be equal to constant","errorCode":"const.openapi.validation","path":"/response/error/type"}]} Files: apify-api/openapi/paths/actors/acts@{actorId}@builds@default.yaml:28 Root cause: The 403 response schema only allowed "unknown-build-tag" as a const, but the endpoint can also return "insufficient-permissions" from IAM access checks plus "build-not-found", "build-outdated" and "invalid-build" from the build lookup. Replaced the narrow custom schema with the standard Forbidden response that uses the full ErrorType enum. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/api/src/routes/actors/build_default.ts#L30 --- apify-api/openapi/components/schemas/common/ErrorType.yaml | 2 ++ .../openapi/paths/actors/acts@{actorId}@builds@default.yaml | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apify-api/openapi/components/schemas/common/ErrorType.yaml b/apify-api/openapi/components/schemas/common/ErrorType.yaml index 7d18ec687c..90259633db 100644 --- a/apify-api/openapi/components/schemas/common/ErrorType.yaml +++ b/apify-api/openapi/components/schemas/common/ErrorType.yaml @@ -126,6 +126,7 @@ enum: - expired-conference-token - failed-to-charge-user - final-invoice-negative + - full-permission-actor-not-approved - github-branch-empty - github-issue-already-exists - github-public-key-not-found @@ -297,6 +298,7 @@ enum: - requested-dataset-view-does-not-exist - resume-token-expired - run-failed + - run-input-body-not-valid-json - run-timeout-exceeded - russia-is-evil - same-user diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@builds@default.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@builds@default.yaml index a6664423b7..9a642e2e92 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@builds@default.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@builds@default.yaml @@ -27,11 +27,7 @@ get: $ref: ../../components/responses/BadRequest.yaml "403": # It should be 404, but is 403 for backwards compatibility. https://github.com/apify/apify-core/pull/17414 - description: Not found - the requested resource was not found. - content: - application/json: - schema: - $ref: "../../components/schemas/common/errors/BuildErrors.yaml#/UnknownBuildTagError" + $ref: ../../components/responses/Forbidden.yaml "404": $ref: ../../components/responses/NotFound.yaml "405": From 88d93ca77810f43b16e1c5f3253952bcbf8ed5dd Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 May 2026 04:35:00 +0000 Subject: [PATCH 2/4] fix(openapi): document runs/last/{abort,metamorph,reboot} endpoints Error: Request OpenAPI validation error {"url":"/v2/actor-tasks/{actorTaskId}/runs/last/abort","method":"POST","errors":[{"message":"not found","path":"/actor-runs/{runId}/abort/"}]} Files: apify-api/openapi/components/objects/actor-runs/abort.yaml, apify-api/openapi/paths/actors/acts@{actorId}@runs@last@abort.yaml, apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml, apify-api/openapi/openapi.yaml Root cause: The runs/last/abort endpoint was missing from the OpenAPI spec for both Actors and Actor tasks. The API rewrites runs/last/{action} to /v2/actor-runs/{runId}/{action}/ via middleware, so the validator did not match either the original URL or the rewritten one. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/api/src/lib/controllers.ts#L38 Error: Request OpenAPI validation error {"url":"/v2/actor-tasks/{actorTaskId}/runs/last/metamorph","method":"POST","errors":[{"message":"not found","path":"/actor-runs/{runId}/metamorph/"}]} Files: apify-api/openapi/components/objects/actor-runs/metamorph.yaml, apify-api/openapi/paths/actors/acts@{actorId}@runs@last@metamorph.yaml, apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml, apify-api/openapi/openapi.yaml Root cause: The runs/last/metamorph endpoint was missing from the OpenAPI spec for both Actors and Actor tasks. The API rewrites runs/last/{action} to /v2/actor-runs/{runId}/{action}/ via middleware, so the validator did not match either the original URL or the rewritten one. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/api/src/lib/controllers.ts#L39 Error: Request OpenAPI validation error {"url":"/v2/acts/{actorId}/runs/last/reboot","method":"POST","errors":[{"message":"not found","path":"/actor-runs/{runId}/reboot/"}]} Files: apify-api/openapi/components/objects/actor-runs/reboot.yaml, apify-api/openapi/paths/actors/acts@{actorId}@runs@last@reboot.yaml, apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml, apify-api/openapi/openapi.yaml Root cause: The runs/last/reboot endpoint was missing from the OpenAPI spec for both Actors and Actor tasks. The API rewrites runs/last/{action} to /v2/actor-runs/{runId}/{action}/ via middleware, so the validator did not match either the original URL or the rewritten one. Reference: https://github.com/apify/apify-core/tree/19160bcbc2da9e8e242227fea757c953a37ee797/src/api/src/lib/controllers.ts#L40 The new endpoints follow the same shared-component pattern as components/objects/logs/log.yaml: a YAML anchor for the common response shape and named operations merged via "<<: *anchor", referenced from each path file. --- .../components/objects/actor-runs/abort.yaml | 62 ++++++++++++++++ .../objects/actor-runs/metamorph.yaml | 73 +++++++++++++++++++ .../components/objects/actor-runs/reboot.yaml | 58 +++++++++++++++ apify-api/openapi/openapi.yaml | 12 +++ ...r-tasks@{actorTaskId}@runs@last@abort.yaml | 2 + ...sks@{actorTaskId}@runs@last@metamorph.yaml | 2 + ...-tasks@{actorTaskId}@runs@last@reboot.yaml | 2 + .../acts@{actorId}@runs@last@abort.yaml | 2 + .../acts@{actorId}@runs@last@metamorph.yaml | 2 + .../acts@{actorId}@runs@last@reboot.yaml | 2 + 10 files changed, 217 insertions(+) create mode 100644 apify-api/openapi/components/objects/actor-runs/abort.yaml create mode 100644 apify-api/openapi/components/objects/actor-runs/metamorph.yaml create mode 100644 apify-api/openapi/components/objects/actor-runs/reboot.yaml create mode 100644 apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml create mode 100644 apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml create mode 100644 apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml create mode 100644 apify-api/openapi/paths/actors/acts@{actorId}@runs@last@abort.yaml create mode 100644 apify-api/openapi/paths/actors/acts@{actorId}@runs@last@metamorph.yaml create mode 100644 apify-api/openapi/paths/actors/acts@{actorId}@runs@last@reboot.yaml diff --git a/apify-api/openapi/components/objects/actor-runs/abort.yaml b/apify-api/openapi/components/objects/actor-runs/abort.yaml new file mode 100644 index 0000000000..8c60d1085b --- /dev/null +++ b/apify-api/openapi/components/objects/actor-runs/abort.yaml @@ -0,0 +1,62 @@ +sharedAbort: &sharedAbort + responses: + "200": + description: "" + headers: {} + content: + application/json: + schema: + $ref: ../../schemas/actor-runs/RunResponse.yaml + example: + $ref: ../../examples/AbortedRunExample.yaml + "400": + $ref: ../../responses/BadRequest.yaml + "401": + $ref: ../../responses/Unauthorized.yaml + "403": + $ref: ../../responses/Forbidden.yaml + "404": + $ref: ../../responses/NotFound.yaml + "405": + $ref: ../../responses/MethodNotAllowed.yaml + "429": + $ref: ../../responses/TooManyRequests.yaml + deprecated: false + +lastRunByActor: + <<: *sharedAbort + tags: + - Actors/Last run + summary: Abort Actor's last run + description: | + Aborts the last run of the specified Actor and returns an object that + contains all the details about the run. + + This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) + on the Actor's last run. Only runs that are starting or running are aborted. + For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call + does nothing. + operationId: act_runs_last_abort_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" + - $ref: "../../parameters/runAndBuildParameters.yaml#/gracefully" + +lastRunByActorTask: + <<: *sharedAbort + tags: + - Actor tasks/Last run + summary: Abort Actor task's last run + description: | + Aborts the last run of the specified Actor task and returns an object that + contains all the details about the run. + + This endpoint is a shortcut for [Abort run](#/reference/actor-runs/abort-run/abort-run) + on the Actor task's last run. Only runs that are starting or running are aborted. + For runs with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call + does nothing. + operationId: actorTask_runs_last_abort_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorTaskId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" + - $ref: "../../parameters/runAndBuildParameters.yaml#/gracefully" diff --git a/apify-api/openapi/components/objects/actor-runs/metamorph.yaml b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml new file mode 100644 index 0000000000..1ec787c8fc --- /dev/null +++ b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml @@ -0,0 +1,73 @@ +sharedMetamorph: &sharedMetamorph + responses: + "200": + description: "" + headers: {} + content: + application/json: + schema: + $ref: ../../schemas/actor-runs/RunResponse.yaml + "400": + $ref: ../../responses/BadRequest.yaml + "401": + $ref: ../../responses/Unauthorized.yaml + "403": + $ref: ../../responses/Forbidden.yaml + "404": + $ref: ../../responses/NotFound.yaml + "405": + $ref: ../../responses/MethodNotAllowed.yaml + "429": + $ref: ../../responses/TooManyRequests.yaml + deprecated: false + +buildQueryParameter: &buildQueryParameter + name: build + in: query + description: | + Optional build of the target Actor. + + It can be either a build tag or build number. By default, the run uses + the build specified in the default run configuration for the target + Actor (typically `latest`). + style: form + explode: true + schema: + type: string + example: beta + +lastRunByActor: + <<: *sharedMetamorph + tags: + - Actors/Last run + summary: Metamorph Actor's last run + description: | + Transforms the last run of the specified Actor into a run of another Actor with + a new input. + + This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) + on the Actor's last run. + operationId: act_runs_last_metamorph_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" + - $ref: "../../parameters/runAndBuildParameters.yaml#/targetActorId" + - *buildQueryParameter + +lastRunByActorTask: + <<: *sharedMetamorph + tags: + - Actor tasks/Last run + summary: Metamorph Actor task's last run + description: | + Transforms the last run of the specified Actor task into a run of another Actor with + a new input. + + This endpoint is a shortcut for [Metamorph run](#/reference/actor-runs/metamorph-run/metamorph-run) + on the Actor task's last run. + operationId: actorTask_runs_last_metamorph_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorTaskId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" + - $ref: "../../parameters/runAndBuildParameters.yaml#/targetActorId" + - *buildQueryParameter diff --git a/apify-api/openapi/components/objects/actor-runs/reboot.yaml b/apify-api/openapi/components/objects/actor-runs/reboot.yaml new file mode 100644 index 0000000000..16cea820d2 --- /dev/null +++ b/apify-api/openapi/components/objects/actor-runs/reboot.yaml @@ -0,0 +1,58 @@ +sharedReboot: &sharedReboot + responses: + "200": + description: "" + headers: {} + content: + application/json: + schema: + $ref: ../../schemas/actor-runs/RunResponse.yaml + "400": + $ref: ../../responses/BadRequest.yaml + "401": + $ref: ../../responses/Unauthorized.yaml + "403": + $ref: ../../responses/Forbidden.yaml + "404": + $ref: ../../responses/NotFound.yaml + "405": + $ref: ../../responses/MethodNotAllowed.yaml + "429": + $ref: ../../responses/TooManyRequests.yaml + deprecated: false + +lastRunByActor: + <<: *sharedReboot + tags: + - Actors/Last run + summary: Reboot Actor's last run + description: | + Reboots the last run of the specified Actor and returns an object that + contains all the details about the rebooted run. + + This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) + on the Actor's last run. Only runs with status `RUNNING` can be rebooted. The run's + container will be restarted, so any data not persisted in the key-value store, dataset, + or request queue will be lost. + operationId: act_runs_last_reboot_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" + +lastRunByActorTask: + <<: *sharedReboot + tags: + - Actor tasks/Last run + summary: Reboot Actor task's last run + description: | + Reboots the last run of the specified Actor task and returns an object that + contains all the details about the rebooted run. + + This endpoint is a shortcut for [Reboot run](#/reference/actor-runs/reboot-run/reboot-run) + on the Actor task's last run. Only runs with status `RUNNING` can be rebooted. The run's + container will be restarted, so any data not persisted in the key-value store, dataset, + or request queue will be lost. + operationId: actorTask_runs_last_reboot_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorTaskId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/statusLastRun" diff --git a/apify-api/openapi/openapi.yaml b/apify-api/openapi/openapi.yaml index 54e44f9e9b..9d2e88b96c 100644 --- a/apify-api/openapi/openapi.yaml +++ b/apify-api/openapi/openapi.yaml @@ -548,6 +548,12 @@ paths: $ref: "paths/actors/acts@{actorId}@runs@last@request-queue@head@lock.yaml" "/v2/acts/{actorId}/runs/last/log": $ref: "paths/actors/acts@{actorId}@runs@last@log.yaml" + "/v2/acts/{actorId}/runs/last/abort": + $ref: "paths/actors/acts@{actorId}@runs@last@abort.yaml" + "/v2/acts/{actorId}/runs/last/metamorph": + $ref: "paths/actors/acts@{actorId}@runs@last@metamorph.yaml" + "/v2/acts/{actorId}/runs/last/reboot": + $ref: "paths/actors/acts@{actorId}@runs@last@reboot.yaml" "/v2/acts/{actorId}/runs/{runId}": $ref: "paths/actors/acts@{actorId}@runs@{runId}.yaml" "/v2/acts/{actorId}/runs/{runId}/abort": @@ -572,6 +578,12 @@ paths: $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last.yaml" "/v2/actor-tasks/{actorTaskId}/runs/last/log": $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@log.yaml" + "/v2/actor-tasks/{actorTaskId}/runs/last/abort": + $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml" + "/v2/actor-tasks/{actorTaskId}/runs/last/metamorph": + $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml" + "/v2/actor-tasks/{actorTaskId}/runs/last/reboot": + $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml" "/v2/actor-tasks/{actorTaskId}/runs/last/dataset": $ref: "paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@dataset.yaml" "/v2/actor-tasks/{actorTaskId}/runs/last/dataset/items": diff --git a/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml new file mode 100644 index 0000000000..b54a5f6223 --- /dev/null +++ b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@abort.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/abort.yaml#/lastRunByActorTask" diff --git a/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml new file mode 100644 index 0000000000..478bf3a197 --- /dev/null +++ b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@metamorph.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/metamorph.yaml#/lastRunByActorTask" diff --git a/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml new file mode 100644 index 0000000000..8019770677 --- /dev/null +++ b/apify-api/openapi/paths/actor-tasks/actor-tasks@{actorTaskId}@runs@last@reboot.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/reboot.yaml#/lastRunByActorTask" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@abort.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@abort.yaml new file mode 100644 index 0000000000..da4a719e45 --- /dev/null +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@abort.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/abort.yaml#/lastRunByActor" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@metamorph.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@metamorph.yaml new file mode 100644 index 0000000000..38bbdd7c43 --- /dev/null +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@metamorph.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/metamorph.yaml#/lastRunByActor" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@reboot.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@reboot.yaml new file mode 100644 index 0000000000..e5ba2efee4 --- /dev/null +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@last@reboot.yaml @@ -0,0 +1,2 @@ +post: + $ref: "../../components/objects/actor-runs/reboot.yaml#/lastRunByActor" From 00c233ed70b98d309f096cf45a33f49d4e4dd805 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 May 2026 05:13:31 +0000 Subject: [PATCH 3/4] docs(openapi): register tags for new runs/last/{abort,metamorph,reboot} endpoints The previous commit introduced operation tags "Actors/Last run" and "Actor tasks/Last run" without declaring them in components/tags.yaml, which triggered the spectral "operation-tag-defined" warning. Switched to the existing "Last Actor run's X" / "Last Actor task run's X" naming convention used by all other runs/last/* convenience endpoints, added six new top-level tag definitions in components/tags.yaml, and listed them in components/x-tag-groups.yaml under "Convenience endpoints" right next to the matching "log", "default dataset", "default key-value store", and "default request queue" tags. No spec semantics change; this only fixes the lint warning. --- .../components/objects/actor-runs/abort.yaml | 4 +-- .../objects/actor-runs/metamorph.yaml | 4 +-- .../components/objects/actor-runs/reboot.yaml | 4 +-- apify-api/openapi/components/tags.yaml | 36 +++++++++++++++++++ .../openapi/components/x-tag-groups.yaml | 6 ++++ 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/apify-api/openapi/components/objects/actor-runs/abort.yaml b/apify-api/openapi/components/objects/actor-runs/abort.yaml index 8c60d1085b..849920747e 100644 --- a/apify-api/openapi/components/objects/actor-runs/abort.yaml +++ b/apify-api/openapi/components/objects/actor-runs/abort.yaml @@ -26,7 +26,7 @@ sharedAbort: &sharedAbort lastRunByActor: <<: *sharedAbort tags: - - Actors/Last run + - Last Actor run's abort summary: Abort Actor's last run description: | Aborts the last run of the specified Actor and returns an object that @@ -45,7 +45,7 @@ lastRunByActor: lastRunByActorTask: <<: *sharedAbort tags: - - Actor tasks/Last run + - Last Actor task run's abort summary: Abort Actor task's last run description: | Aborts the last run of the specified Actor task and returns an object that diff --git a/apify-api/openapi/components/objects/actor-runs/metamorph.yaml b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml index 1ec787c8fc..d06251cbbb 100644 --- a/apify-api/openapi/components/objects/actor-runs/metamorph.yaml +++ b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml @@ -39,7 +39,7 @@ buildQueryParameter: &buildQueryParameter lastRunByActor: <<: *sharedMetamorph tags: - - Actors/Last run + - Last Actor run's metamorph summary: Metamorph Actor's last run description: | Transforms the last run of the specified Actor into a run of another Actor with @@ -57,7 +57,7 @@ lastRunByActor: lastRunByActorTask: <<: *sharedMetamorph tags: - - Actor tasks/Last run + - Last Actor task run's metamorph summary: Metamorph Actor task's last run description: | Transforms the last run of the specified Actor task into a run of another Actor with diff --git a/apify-api/openapi/components/objects/actor-runs/reboot.yaml b/apify-api/openapi/components/objects/actor-runs/reboot.yaml index 16cea820d2..ddacb5192c 100644 --- a/apify-api/openapi/components/objects/actor-runs/reboot.yaml +++ b/apify-api/openapi/components/objects/actor-runs/reboot.yaml @@ -24,7 +24,7 @@ sharedReboot: &sharedReboot lastRunByActor: <<: *sharedReboot tags: - - Actors/Last run + - Last Actor run's reboot summary: Reboot Actor's last run description: | Reboots the last run of the specified Actor and returns an object that @@ -42,7 +42,7 @@ lastRunByActor: lastRunByActorTask: <<: *sharedReboot tags: - - Actor tasks/Last run + - Last Actor task run's reboot summary: Reboot Actor task's last run description: | Reboots the last run of the specified Actor task and returns an object that diff --git a/apify-api/openapi/components/tags.yaml b/apify-api/openapi/components/tags.yaml index 44d3c3e109..2f89d6ab97 100644 --- a/apify-api/openapi/components/tags.yaml +++ b/apify-api/openapi/components/tags.yaml @@ -469,12 +469,48 @@ The API endpoint described in this section is convenience endpoint that provides access to last Actor run's log. Same as of functionality described in: [Logs](/api/v2/logs) +- name: Last Actor run's abort + x-displayName: Last Actor run's abort - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that aborts the Actor's last run. + + Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) +- name: Last Actor run's metamorph + x-displayName: Last Actor run's metamorph - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that metamorphs the Actor's last run into a run of another Actor. + + Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) +- name: Last Actor run's reboot + x-displayName: Last Actor run's reboot - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that reboots the Actor's last run. + + Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) - name: Last Actor task run's log x-displayName: Last Actor task run's log - Introduction description: | The API endpoint described in this section is convenience endpoint that provides access to last Actor task run's log. Same as of functionality described in: [Logs](/api/v2/logs) +- name: Last Actor task run's abort + x-displayName: Last Actor task run's abort - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that aborts the Actor task's last run. + + Same as of functionality described in: [Abort run](/api/v2/actor-run-abort-post) +- name: Last Actor task run's metamorph + x-displayName: Last Actor task run's metamorph - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that metamorphs the Actor task's last run into a run of another Actor. + + Same as of functionality described in: [Metamorph run](/api/v2/actor-run-metamorph-post) +- name: Last Actor task run's reboot + x-displayName: Last Actor task run's reboot - Introduction + description: | + The API endpoint described in this section is a convenience endpoint that reboots the Actor task's last run. + + Same as of functionality described in: [Reboot run](/api/v2/actor-run-reboot-post) - name: Last Actor task run's default dataset x-displayName: Last Actor task run's default dataset - Introduction description: | diff --git a/apify-api/openapi/components/x-tag-groups.yaml b/apify-api/openapi/components/x-tag-groups.yaml index 7b6a4da627..965604fe1b 100644 --- a/apify-api/openapi/components/x-tag-groups.yaml +++ b/apify-api/openapi/components/x-tag-groups.yaml @@ -50,7 +50,13 @@ - Last Actor run's default key-value store - Last Actor run's default request queue - Last Actor run's log + - Last Actor run's abort + - Last Actor run's metamorph + - Last Actor run's reboot - Last Actor task run's default dataset - Last Actor task run's default key-value store - Last Actor task run's default request queue - Last Actor task run's log + - Last Actor task run's abort + - Last Actor task run's metamorph + - Last Actor task run's reboot From 5c34ced3771b7a1bcd4a902239711cfc81773bee Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 May 2026 05:35:01 +0000 Subject: [PATCH 4/4] refactor(openapi): consolidate actor-run action endpoints into shared components Refactored actor-runs@{runId}@{abort,metamorph,reboot,resurrect,charge}.yaml and acts@{actorId}@runs@{runId}@{abort,metamorph,resurrect}.yaml path files into thin "$ref" wrappers that point to operations defined in components/objects/actor-runs/{abort,metamorph,reboot,resurrect,charge}.yaml. Pattern follows the existing components/objects/logs/log.yaml example: - Each shared file declares a "&sharedX" YAML anchor for the common response shape. - Named operations ("byRunId", "byActorRunId", "lastRunByActor", "lastRunByActorTask") merge the anchor and add their own metadata. - charge.yaml has only "byRunId" because /v2/actor-runs/{runId}/charge is the only path the API exposes for charging. actor-tasks has no equivalent /actor-tasks/{actorTaskId}/runs/{runId}/X endpoints in apify-core (only the runs/last router), so nothing to refactor there. Net change: 437 lines deleted, 159 lines added; 278 lines of duplication removed. Bundle output is functionally unchanged for all 13 affected operations - only one cosmetic typo fix (missing space in the deprecated metamorph description) and one schema-shape consistency tweak (resurrect 200 now uses allOf wrapping in both variants). --- .../components/objects/actor-runs/abort.yaml | 49 +++++++++++ .../components/objects/actor-runs/charge.yaml | 69 +++++++++++++++ .../objects/actor-runs/metamorph.yaml | 75 ++++++++++++++++ .../components/objects/actor-runs/reboot.yaml | 27 ++++++ .../objects/actor-runs/resurrect.yaml | 87 +++++++++++++++++++ .../actor-runs/actor-runs@{runId}@abort.yaml | 47 +--------- .../actor-runs/actor-runs@{runId}@charge.yaml | 69 +-------------- .../actor-runs@{runId}@metamorph.yaml | 69 +-------------- .../actor-runs/actor-runs@{runId}@reboot.yaml | 46 +--------- .../actor-runs@{runId}@resurrect.yaml | 52 +---------- .../acts@{actorId}@runs@{runId}@abort.yaml | 43 +-------- ...acts@{actorId}@runs@{runId}@metamorph.yaml | 68 +-------------- ...acts@{actorId}@runs@{runId}@resurrect.yaml | 51 +---------- 13 files changed, 315 insertions(+), 437 deletions(-) create mode 100644 apify-api/openapi/components/objects/actor-runs/charge.yaml create mode 100644 apify-api/openapi/components/objects/actor-runs/resurrect.yaml diff --git a/apify-api/openapi/components/objects/actor-runs/abort.yaml b/apify-api/openapi/components/objects/actor-runs/abort.yaml index 849920747e..9c6ea44610 100644 --- a/apify-api/openapi/components/objects/actor-runs/abort.yaml +++ b/apify-api/openapi/components/objects/actor-runs/abort.yaml @@ -23,6 +23,55 @@ sharedAbort: &sharedAbort $ref: ../../responses/TooManyRequests.yaml deprecated: false +byRunId: + <<: *sharedAbort + tags: + - Actor runs + summary: Abort run + description: | + Aborts an Actor run and returns an object that contains all the details + about the run. + + Only runs that are starting or running are aborted. For runs with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: actorRun_abort_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/gracefully" + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run + - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run + - https://docs.apify.com/api/v2#tag/Actor-runsAbort-run/operation/actorRun_abort_post + x-js-parent: RunClient + x-js-name: abort + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#abort + x-py-parent: RunClientAsync + x-py-name: abort + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#abort + +byActorRunId: + <<: *sharedAbort + tags: + - Actors/Actor runs + summary: Abort run + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and + returns an object that contains all the details about the run. + + Only runs that are starting or running are aborted. For runs with status + `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. + operationId: act_run_abort_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/gracefully" + deprecated: true + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/abort-run/abort-run + - https://docs.apify.com/api/v2#/reference/actors/abort-run + - https://docs.apify.com/api/v2#tag/ActorsAbort-run/operation/act_run_abort_post + lastRunByActor: <<: *sharedAbort tags: diff --git a/apify-api/openapi/components/objects/actor-runs/charge.yaml b/apify-api/openapi/components/objects/actor-runs/charge.yaml new file mode 100644 index 0000000000..612f22da3c --- /dev/null +++ b/apify-api/openapi/components/objects/actor-runs/charge.yaml @@ -0,0 +1,69 @@ +byRunId: + tags: + - Actor runs + summary: Charge events in run + description: | + Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). + The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, + the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. + + :::info Learn more about pay-per-event pricing + + For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). + + ::: + + operationId: PostChargeRun + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - name: idempotency-key + in: header + required: false + schema: + type: string + example: 2024-12-09T01:23:45.000Z-random-uuid + description: Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. + requestBody: + description: "Define which event, and how many times, you want to charge for." + content: + application/json: + schema: + $ref: ../../schemas/actor-runs/ChargeRunRequest.yaml + example: + eventName: ANALYZE_PAGE + count: 1 + required: true + responses: + "201": + description: "The charge was successful. Note that you still have to make sure in your Actor that the total charge for the run respects the maximum value set by the user, as the API does not check this. Above the limit, the charges reported as successful in API will not be added to your payouts, but you will still bear the associated costs. Use the Apify charge manager or SDK to avoid having to deal with this manually." + content: + application/json: + schema: + type: object + additionalProperties: false + "400": + $ref: ../../responses/BadRequest.yaml + "401": + $ref: ../../responses/Unauthorized.yaml + "403": + $ref: ../../responses/Forbidden.yaml + "404": + $ref: ../../responses/NotFound.yaml + "405": + $ref: ../../responses/MethodNotAllowed.yaml + "413": + $ref: ../../responses/PayloadTooLarge.yaml + "415": + $ref: ../../responses/UnsupportedMediaType.yaml + "429": + $ref: ../../responses/TooManyRequests.yaml + deprecated: false + x-js-parent: RunClient + x-js-name: charge + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge + x-py-parent: RunClientAsync + x-py-name: charge + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run + - https://docs.apify.com/api/v2#tag/Actor-runsCharge-events-in-run/operation/PostChargeRun diff --git a/apify-api/openapi/components/objects/actor-runs/metamorph.yaml b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml index d06251cbbb..be3cffff4a 100644 --- a/apify-api/openapi/components/objects/actor-runs/metamorph.yaml +++ b/apify-api/openapi/components/objects/actor-runs/metamorph.yaml @@ -36,6 +36,81 @@ buildQueryParameter: &buildQueryParameter type: string example: beta +byRunId: + <<: *sharedMetamorph + tags: + - Actor runs + summary: Metamorph run + description: | + Transforms an Actor run into a run of another Actor with a new input. + + This is useful if you want to use another Actor to finish the work + of your current Actor run, without the need to create a completely new run + and waiting for its finish. + + For the users of your Actors, the metamorph operation is transparent, they + will just see your Actor got the work done. + + Internally, the system stops the Docker container corresponding to the Actor + run and starts a new container using a different Docker image. + + All the default storages are preserved and the new input is stored under the + `INPUT-METAMORPH-1` key in the same default key-value store. + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + operationId: actorRun_metamorph_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/targetActorId" + - *buildQueryParameter + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run + - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run + - https://docs.apify.com/api/v2#tag/Actor-runsMetamorph-run/operation/actorRun_metamorph_post + x-js-parent: RunClient + x-js-name: metamorph + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#metamorph + x-py-parent: RunClientAsync + x-py-name: metamorph + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#metamorph + +byActorRunId: + <<: *sharedMetamorph + tags: + - Actors/Actor runs + summary: Metamorph run + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs). Transforms an Actor run + into a run of another Actor with a new input. + + This is useful if you want to use another Actor to finish the work + of your current Actor run, without the need to create a completely new run + and waiting for its finish. + For the users of your Actors, the metamorph operation is transparent, they + will just see your Actor got the work done. + + There is a limit on how many times you can metamorph a single run. You can + check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). + + Internally, the system stops the Docker container corresponding to the Actor + run and starts a new container using a different Docker image. + All the default storages are preserved and the new input is stored under the + `INPUT-METAMORPH-1` key in the same default key-value store. + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). + operationId: act_run_metamorph_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/targetActorId" + - *buildQueryParameter + deprecated: true + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/metamorph-run/metamorph-run + - https://docs.apify.com/api/v2#/reference/actors/metamorph-run + - https://docs.apify.com/api/v2#tag/ActorsMetamorph-run/operation/act_run_metamorph_post + lastRunByActor: <<: *sharedMetamorph tags: diff --git a/apify-api/openapi/components/objects/actor-runs/reboot.yaml b/apify-api/openapi/components/objects/actor-runs/reboot.yaml index ddacb5192c..1928d0145f 100644 --- a/apify-api/openapi/components/objects/actor-runs/reboot.yaml +++ b/apify-api/openapi/components/objects/actor-runs/reboot.yaml @@ -21,6 +21,33 @@ sharedReboot: &sharedReboot $ref: ../../responses/TooManyRequests.yaml deprecated: false +byRunId: + <<: *sharedReboot + tags: + - Actor runs + summary: Reboot run + description: | + Reboots an Actor run and returns an object that contains all the details + about the rebooted run. + + Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. + + The run's container will be restarted, so any data not persisted in the + key-value store, dataset, or request queue will be lost. + operationId: actorRun_reboot_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run + - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run + - https://docs.apify.com/api/v2#tag/Actor-runsReboot-run/operation/actorRun_reboot_post + x-js-parent: RunClient + x-js-name: reboot + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#reboot + x-py-parent: RunClientAsync + x-py-name: reboot + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#reboot + lastRunByActor: <<: *sharedReboot tags: diff --git a/apify-api/openapi/components/objects/actor-runs/resurrect.yaml b/apify-api/openapi/components/objects/actor-runs/resurrect.yaml new file mode 100644 index 0000000000..ffc76f0d0f --- /dev/null +++ b/apify-api/openapi/components/objects/actor-runs/resurrect.yaml @@ -0,0 +1,87 @@ +sharedResurrect: &sharedResurrect + responses: + "200": + description: "" + headers: {} + content: + application/json: + schema: + allOf: + - $ref: ../../schemas/actor-runs/RunResponse.yaml + "400": + $ref: ../../responses/BadRequest.yaml + "401": + $ref: ../../responses/Unauthorized.yaml + "403": + $ref: ../../responses/Forbidden.yaml + "404": + $ref: ../../responses/NotFound.yaml + "405": + $ref: ../../responses/MethodNotAllowed.yaml + "429": + $ref: ../../responses/TooManyRequests.yaml + deprecated: false + +byRunId: + <<: *sharedResurrect + tags: + - Actor runs + summary: Resurrect run + description: | + Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. + Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. + Run status will be updated to RUNNING and its container will be restarted with the same storages + (the same behaviour as when the run gets migrated to the new server). + + For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + operationId: PostResurrectRun + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/buildResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/timeoutResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/memoryResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/maxItems" + - $ref: "../../parameters/runAndBuildParameters.yaml#/maxTotalChargeUsd" + - $ref: "../../parameters/runAndBuildParameters.yaml#/restartOnErrorResurrect" + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run + - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run + - https://docs.apify.com/api/v2#tag/Actor-runsResurrect-run/operation/PostResurrectRun + x-js-parent: RunClient + x-js-name: resurrect + x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#resurrect + x-py-parent: RunClientAsync + x-py-name: resurrect + x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#resurrect + +byActorRunId: + <<: *sharedResurrect + tags: + - Actors/Actor runs + summary: Resurrect run + description: | + **[DEPRECATED]** API endpoints related to run of the Actor were moved under + new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished + Actor run and returns an object that contains all the details about the + resurrected run. + + Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` + and `TIMED-OUT` can be resurrected. + Run status will be updated to RUNNING and its container will be restarted + with the same storages + (the same behaviour as when the run gets migrated to the new server). + + For more information, see the [Actor + docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). + operationId: act_run_resurrect_post + parameters: + - $ref: "../../parameters/runAndBuildParameters.yaml#/actorId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/runId" + - $ref: "../../parameters/runAndBuildParameters.yaml#/buildResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/timeoutResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/memoryResurrect" + - $ref: "../../parameters/runAndBuildParameters.yaml#/restartOnErrorResurrect" + x-legacy-doc-urls: + - https://docs.apify.com/api/v2#/reference/actors/resurrect-run/resurrect-run + - https://docs.apify.com/api/v2#/reference/actors/resurrect-run + - https://docs.apify.com/api/v2#tag/ActorsResurrect-run/operation/act_run_resurrect_post diff --git a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@abort.yaml b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@abort.yaml index d06b77985a..59a085a8d8 100644 --- a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@abort.yaml +++ b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@abort.yaml @@ -1,47 +1,2 @@ post: - tags: - - Actor runs - summary: Abort run - description: | - Aborts an Actor run and returns an object that contains all the details - about the run. - - Only runs that are starting or running are aborted. For runs with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: actorRun_abort_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/gracefully" - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - example: - $ref: ../../components/examples/AbortedRunExample.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run/abort-run - - https://docs.apify.com/api/v2#/reference/actor-runs/abort-run - - https://docs.apify.com/api/v2#tag/Actor-runsAbort-run/operation/actorRun_abort_post - x-js-parent: RunClient - x-js-name: abort - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#abort - x-py-parent: RunClientAsync - x-py-name: abort - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#abort + $ref: "../../components/objects/actor-runs/abort.yaml#/byRunId" diff --git a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml index 6f9902454b..8b557a574a 100644 --- a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml +++ b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml @@ -1,69 +1,2 @@ post: - tags: - - Actor runs - summary: Charge events in run - description: | - Charge for events in the run of your [pay per event Actor](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event). - The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured, - the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with. - - :::info Learn more about pay-per-event pricing - - For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event). - - ::: - - operationId: PostChargeRun - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - name: idempotency-key - in: header - required: false - schema: - type: string - example: 2024-12-09T01:23:45.000Z-random-uuid - description: Always pass a unique idempotency key (any unique string) for each charge to avoid double charging in case of retries or network errors. - requestBody: - description: "Define which event, and how many times, you want to charge for." - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/ChargeRunRequest.yaml - example: - eventName: ANALYZE_PAGE - count: 1 - required: true - responses: - "201": - description: "The charge was successful. Note that you still have to make sure in your Actor that the total charge for the run respects the maximum value set by the user, as the API does not check this. Above the limit, the charges reported as successful in API will not be added to your payouts, but you will still bear the associated costs. Use the Apify charge manager or SDK to avoid having to deal with this manually." - content: - application/json: - schema: - type: object - additionalProperties: false - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "413": - $ref: ../../components/responses/PayloadTooLarge.yaml - "415": - $ref: ../../components/responses/UnsupportedMediaType.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-js-parent: RunClient - x-js-name: charge - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#charge - x-py-parent: RunClientAsync - x-py-name: charge - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#charge - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/charge-events-in-run - - https://docs.apify.com/api/v2#tag/Actor-runsCharge-events-in-run/operation/PostChargeRun + $ref: "../../components/objects/actor-runs/charge.yaml#/byRunId" diff --git a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@metamorph.yaml b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@metamorph.yaml index deed646c11..8e24a3ab30 100644 --- a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@metamorph.yaml +++ b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@metamorph.yaml @@ -1,69 +1,2 @@ post: - tags: - - Actor runs - summary: Metamorph run - description: | - Transforms an Actor run into a run of another Actor with a new input. - - This is useful if you want to use another Actor to finish the work - of your current Actor run, without the need to create a completely new run - and waiting for its finish. - - For the users of your Actors, the metamorph operation is transparent, they - will just see your Actor got the work done. - - Internally, the system stops the Docker container corresponding to the Actor - run and starts a new container using a different Docker image. - - All the default storages are preserved and the new input is stored under the - `INPUT-METAMORPH-1` key in the same default key-value store. - - For more information, see the [Actor docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - operationId: actorRun_metamorph_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/targetActorId" - - name: build - in: query - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - style: form - explode: true - schema: - type: string - example: beta - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run - - https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run - - https://docs.apify.com/api/v2#tag/Actor-runsMetamorph-run/operation/actorRun_metamorph_post - x-js-parent: RunClient - x-js-name: metamorph - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#metamorph - x-py-parent: RunClientAsync - x-py-name: metamorph - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#metamorph + $ref: "../../components/objects/actor-runs/metamorph.yaml#/byRunId" diff --git a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@reboot.yaml b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@reboot.yaml index 31ced4eb9a..5e71248d4b 100644 --- a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@reboot.yaml +++ b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@reboot.yaml @@ -1,46 +1,2 @@ post: - tags: - - Actor runs - summary: Reboot run - description: | - Reboots an Actor run and returns an object that contains all the details - about the rebooted run. - - Only runs that are running, i.e. runs with status `RUNNING` can be rebooted. - - The run's container will be restarted, so any data not persisted in the - key-value store, dataset, or request queue will be lost. - operationId: actorRun_reboot_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run/reboot-run - - https://docs.apify.com/api/v2#/reference/actor-runs/reboot-run - - https://docs.apify.com/api/v2#tag/Actor-runsReboot-run/operation/actorRun_reboot_post - x-js-parent: RunClient - x-js-name: reboot - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#reboot - x-py-parent: RunClientAsync - x-py-name: reboot - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#reboot + $ref: "../../components/objects/actor-runs/reboot.yaml#/byRunId" diff --git a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@resurrect.yaml b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@resurrect.yaml index c3a1d996b3..838edab527 100644 --- a/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@resurrect.yaml +++ b/apify-api/openapi/paths/actor-runs/actor-runs@{runId}@resurrect.yaml @@ -1,52 +1,2 @@ post: - tags: - - Actor runs - summary: Resurrect run - description: | - Resurrects a finished Actor run and returns an object that contains all the details about the resurrected run. - Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` and `TIMED-OUT` can be resurrected. - Run status will be updated to RUNNING and its container will be restarted with the same storages - (the same behaviour as when the run gets migrated to the new server). - - For more information, see the [Actor docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - operationId: PostResurrectRun - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/buildResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/timeoutResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/memoryResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/maxItems" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/maxTotalChargeUsd" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/restartOnErrorResurrect" - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - allOf: - - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run - - https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run - - https://docs.apify.com/api/v2#tag/Actor-runsResurrect-run/operation/PostResurrectRun - x-js-parent: RunClient - x-js-name: resurrect - x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RunClient#resurrect - x-py-parent: RunClientAsync - x-py-name: resurrect - x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RunClientAsync#resurrect + $ref: "../../components/objects/actor-runs/resurrect.yaml#/byRunId" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@abort.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@abort.yaml index da58067506..bf2aee4646 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@abort.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@abort.yaml @@ -1,43 +1,2 @@ post: - tags: - - Actors/Actor runs - summary: Abort run - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs). Aborts an Actor run and - returns an object that contains all the details about the run. - - Only runs that are starting or running are aborted. For runs with status - `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing. - operationId: act_run_abort_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/actorId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/gracefully" - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - example: - $ref: ../../components/examples/AbortedRunExample.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: true - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/abort-run/abort-run - - https://docs.apify.com/api/v2#/reference/actors/abort-run - - https://docs.apify.com/api/v2#tag/ActorsAbort-run/operation/act_run_abort_post + $ref: "../../components/objects/actor-runs/abort.yaml#/byActorRunId" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@metamorph.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@metamorph.yaml index 0e2c4002a0..efed960884 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@metamorph.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@metamorph.yaml @@ -1,68 +1,2 @@ post: - tags: - - Actors/Actor runs - summary: Metamorph run - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs).Transforms an Actor run - into a run of another Actor with a new input. - - This is useful if you want to use another Actor to finish the work - of your current Actor run, without the need to create a completely new run - and waiting for its finish. - For the users of your Actors, the metamorph operation is transparent, they - will just see your Actor got the work done. - - There is a limit on how many times you can metamorph a single run. You can - check the limit in [the Actor runtime limits](https://docs.apify.com/platform/limits#actor-limits). - - Internally, the system stops the Docker container corresponding to the Actor - run and starts a new container using a different Docker image. - All the default storages are preserved and the new input is stored under the - `INPUT-METAMORPH-1` key in the same default key-value store. - - For more information, see the [Actor - docs](https://docs.apify.com/platform/actors/development/programming-interface/metamorph). - operationId: act_run_metamorph_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/actorId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/targetActorId" - - name: build - in: query - description: | - Optional build of the target Actor. - - It can be either a build tag or build number. By default, the run uses - the build specified in the default run configuration for the target - Actor (typically `latest`). - style: form - explode: true - schema: - type: string - example: beta - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: true - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/metamorph-run/metamorph-run - - https://docs.apify.com/api/v2#/reference/actors/metamorph-run - - https://docs.apify.com/api/v2#tag/ActorsMetamorph-run/operation/act_run_metamorph_post + $ref: "../../components/objects/actor-runs/metamorph.yaml#/byActorRunId" diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@resurrect.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@resurrect.yaml index af7c2fa1a1..3e1a747af5 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@resurrect.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@runs@{runId}@resurrect.yaml @@ -1,51 +1,2 @@ post: - tags: - - Actors/Actor runs - summary: Resurrect run - description: | - **[DEPRECATED]** API endpoints related to run of the Actor were moved under - new namespace [`actor-runs`](#/reference/actor-runs).Resurrects a finished - Actor run and returns an object that contains all the details about the - resurrected run. - - Only finished runs, i.e. runs with status `FINISHED`, `FAILED`, `ABORTED` - and `TIMED-OUT` can be resurrected. - Run status will be updated to RUNNING and its container will be restarted - with the same storages - (the same behaviour as when the run gets migrated to the new server). - - For more information, see the [Actor - docs](https://docs.apify.com/platform/actors/running/runs-and-builds#resurrection-of-finished-run). - operationId: act_run_resurrect_post - parameters: - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/actorId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/runId" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/buildResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/timeoutResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/memoryResurrect" - - $ref: "../../components/parameters/runAndBuildParameters.yaml#/restartOnErrorResurrect" - responses: - "200": - description: "" - headers: {} - content: - application/json: - schema: - $ref: ../../components/schemas/actor-runs/RunResponse.yaml - "400": - $ref: ../../components/responses/BadRequest.yaml - "401": - $ref: ../../components/responses/Unauthorized.yaml - "403": - $ref: ../../components/responses/Forbidden.yaml - "404": - $ref: ../../components/responses/NotFound.yaml - "405": - $ref: ../../components/responses/MethodNotAllowed.yaml - "429": - $ref: ../../components/responses/TooManyRequests.yaml - deprecated: false - x-legacy-doc-urls: - - https://docs.apify.com/api/v2#/reference/actors/resurrect-run/resurrect-run - - https://docs.apify.com/api/v2#/reference/actors/resurrect-run - - https://docs.apify.com/api/v2#tag/ActorsResurrect-run/operation/act_run_resurrect_post + $ref: "../../components/objects/actor-runs/resurrect.yaml#/byActorRunId"