From 2786c2d14dff9d0109b7bcf559d782cbd8f782e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 14:50:40 +0000 Subject: [PATCH 1/4] fix(openapi): add the raw query parameter to the Actor build log endpoint Error: Request OpenAPI validation error GET /v2/actor-builds/{buildId}/log?raw=false: Unknown query parameter 'raw' Files: apify-api/openapi/components/objects/logs/log.yaml:86 Root cause: The build log operation referenced only the stream and download parameters, while the run log and the generic log operations also reference raw. The API handles the build log by rewriting the request to /v2/logs/{buildId} with the original query string, so raw is accepted there, and both the JavaScript and the Python API clients send it. Reference: https://github.com/apify/apify-core/tree/8440e7910c359526f013ea7b42394e386ecccc95/src/api/src/routes/actor_builds/build_log.ts#L23 Co-Authored-By: Claude Fable 5.1 --- apify-api/openapi/components/objects/logs/log.yaml | 1 + .../users/{users@me@limits.yaml => users@{userId}@limits.yaml} | 0 ...s@me@usage@monthly.yaml => users@{userId}@usage@monthly.yaml} | 0 3 files changed, 1 insertion(+) rename apify-api/openapi/paths/users/{users@me@limits.yaml => users@{userId}@limits.yaml} (100%) rename apify-api/openapi/paths/users/{users@me@usage@monthly.yaml => users@{userId}@usage@monthly.yaml} (100%) diff --git a/apify-api/openapi/components/objects/logs/log.yaml b/apify-api/openapi/components/objects/logs/log.yaml index 3ea383c262..62611b3ad2 100644 --- a/apify-api/openapi/components/objects/logs/log.yaml +++ b/apify-api/openapi/components/objects/logs/log.yaml @@ -83,6 +83,7 @@ getByBuildId: - $ref: "../../parameters/runAndBuildParameters.yaml#/buildId" - $ref: "../../parameters/logParameters.yaml#/stream" - $ref: "../../parameters/logParameters.yaml#/download" + - $ref: "../../parameters/logParameters.yaml#/raw" x-legacy-doc-urls: - https://docs.apify.com/api/v2#/reference/actor-builds/build-log/get-log - https://docs.apify.com/api/v2#/reference/actor-builds/get-log diff --git a/apify-api/openapi/paths/users/users@me@limits.yaml b/apify-api/openapi/paths/users/users@{userId}@limits.yaml similarity index 100% rename from apify-api/openapi/paths/users/users@me@limits.yaml rename to apify-api/openapi/paths/users/users@{userId}@limits.yaml diff --git a/apify-api/openapi/paths/users/users@me@usage@monthly.yaml b/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml similarity index 100% rename from apify-api/openapi/paths/users/users@me@usage@monthly.yaml rename to apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml From 744bb58ac311e79d1893b755f6f3455f30ad7f43 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 14:50:40 +0000 Subject: [PATCH 2/4] fix(openapi): accept any JSON value as a key-value store record body Error: Request OpenAPI validation error PUT /v2/key-value-stores/{storeId}/records/{recordKey}: /body: must be object Files: apify-api/openapi/components/schemas/key-value-stores/PutRecordRequest.yaml:5 Root cause: PutRecordRequest restricted the application/json body to an object, but the API stores whatever body arrives under the given content type, so a JSON array, string, or number is a valid record. The API clients send such values as JSON. The schema now accepts any JSON value, as the */* media type already does. Reference: https://github.com/apify/apify-core/tree/8440e7910c359526f013ea7b42394e386ecccc95/src/api/src/routes/key_value_stores/record.ts#L99 Co-Authored-By: Claude Fable 5.1 --- .../schemas/key-value-stores/PutRecordRequest.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apify-api/openapi/components/schemas/key-value-stores/PutRecordRequest.yaml b/apify-api/openapi/components/schemas/key-value-stores/PutRecordRequest.yaml index 5c13d61aa3..9e0931e4a4 100644 --- a/apify-api/openapi/components/schemas/key-value-stores/PutRecordRequest.yaml +++ b/apify-api/openapi/components/schemas/key-value-stores/PutRecordRequest.yaml @@ -1,9 +1,8 @@ title: PutRecordRequest description: | The request body contains the value to store in the record. The content type - should be specified in the Content-Type header. -type: object -additionalProperties: true + should be specified in the Content-Type header. Under `application/json`, any + JSON value is accepted, not only an object. example: message: Hello, world! count: 42 From 789370a176c8a30337f5e87adbb8453cf1b7fe56 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 14:50:40 +0000 Subject: [PATCH 3/4] fix(openapi): document user limits and monthly usage for any accessible user ID Error: Request OpenAPI validation error GET /v2/users/{userId}/limits: not found Error: Request OpenAPI validation error GET /v2/users/{userId}/usage/monthly: not found Files: apify-api/openapi/openapi.yaml:778, apify-api/openapi/paths/users/users@{userId}@limits.yaml:11, apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml:15, apify-api/openapi/components/parameters/userParameters.yaml:1 Root cause: The specification defined these operations only under the literal path segment me. The API routes are /users/:username/limits and /users/:username/usage/monthly, and the handlers accept me, the token's own user ID or username, or an organization the token's user is a member of. The API clients build the URL from any ID. The paths are now templated with a shared userId parameter whose description explains the me alias and the access rule. The operation IDs are unchanged, so the documentation URLs stay the same. Reference: https://github.com/apify/apify-core/tree/8440e7910c359526f013ea7b42394e386ecccc95/src/packages/consts/src/api_server_routes.ts#L9 Reference: https://github.com/apify/apify-core/tree/8440e7910c359526f013ea7b42394e386ecccc95/src/api/src/lib/users.ts#L99 Reference: https://github.com/apify/apify-core/tree/8440e7910c359526f013ea7b42394e386ecccc95/src/api/src/routes/users/limits.ts#L49 Co-Authored-By: Claude Fable 5.1 --- .../components/parameters/userParameters.yaml | 13 +++++++++++++ apify-api/openapi/openapi.yaml | 8 ++++---- .../openapi/paths/users/users@{userId}@limits.yaml | 4 ++++ .../paths/users/users@{userId}@usage@monthly.yaml | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 apify-api/openapi/components/parameters/userParameters.yaml diff --git a/apify-api/openapi/components/parameters/userParameters.yaml b/apify-api/openapi/components/parameters/userParameters.yaml new file mode 100644 index 0000000000..7195915bc2 --- /dev/null +++ b/apify-api/openapi/components/parameters/userParameters.yaml @@ -0,0 +1,13 @@ +userId: + name: userId + in: path + description: | + User ID or username of the account to return the data for. Use `me` for the + account the API token belongs to. Apart from `me`, only the token's own + account and an organization the token's account is a member of are + accessible. API tokens with limited permissions cannot access this data. + required: true + style: simple + schema: + type: string + example: me diff --git a/apify-api/openapi/openapi.yaml b/apify-api/openapi/openapi.yaml index 2c2796f50d..9c3146fc12 100644 --- a/apify-api/openapi/openapi.yaml +++ b/apify-api/openapi/openapi.yaml @@ -775,10 +775,10 @@ paths: $ref: "paths/users/users@{userId}.yaml" /v2/users/me: $ref: paths/users/users@me.yaml - /v2/users/me/usage/monthly: - $ref: paths/users/users@me@usage@monthly.yaml - /v2/users/me/limits: - $ref: paths/users/users@me@limits.yaml + "/v2/users/{userId}/usage/monthly": + $ref: "paths/users/users@{userId}@usage@monthly.yaml" + "/v2/users/{userId}/limits": + $ref: "paths/users/users@{userId}@limits.yaml" /v2/browser-info: $ref: paths/tools/tools@browser-info.yaml /v2/tools/encode-and-sign: diff --git a/apify-api/openapi/paths/users/users@{userId}@limits.yaml b/apify-api/openapi/paths/users/users@{userId}@limits.yaml index 355e8f4f6e..ae1f96f7e4 100644 --- a/apify-api/openapi/paths/users/users@{userId}@limits.yaml +++ b/apify-api/openapi/paths/users/users@{userId}@limits.yaml @@ -7,6 +7,8 @@ get: information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data includes the current usage cycle, a summary of your limits, and your current usage. operationId: users_me_limits_get + parameters: + - $ref: "../../components/parameters/userParameters.yaml#/userId" responses: "200": description: "" @@ -38,6 +40,8 @@ put: Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). operationId: users_me_limits_put + parameters: + - $ref: "../../components/parameters/userParameters.yaml#/userId" requestBody: description: "" content: diff --git a/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml b/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml index d08fda14a1..5f48dc82b3 100644 --- a/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml +++ b/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml @@ -12,6 +12,7 @@ get: includes that date. operationId: users_me_usage_monthly_get parameters: + - $ref: "../../components/parameters/userParameters.yaml#/userId" - name: date in: query description: Date in the YYYY-MM-DD format. From d8fd45dc9342a82729a6599344168193b7911fdd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 14:59:22 +0000 Subject: [PATCH 4/4] Revert "fix(openapi): document user limits and monthly usage for any accessible user ID" This reverts commit 789370a176c8a30337f5e87adbb8453cf1b7fe56. --- .../components/parameters/userParameters.yaml | 13 ------------- apify-api/openapi/openapi.yaml | 8 ++++---- .../openapi/paths/users/users@{userId}@limits.yaml | 4 ---- .../paths/users/users@{userId}@usage@monthly.yaml | 1 - 4 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 apify-api/openapi/components/parameters/userParameters.yaml diff --git a/apify-api/openapi/components/parameters/userParameters.yaml b/apify-api/openapi/components/parameters/userParameters.yaml deleted file mode 100644 index 7195915bc2..0000000000 --- a/apify-api/openapi/components/parameters/userParameters.yaml +++ /dev/null @@ -1,13 +0,0 @@ -userId: - name: userId - in: path - description: | - User ID or username of the account to return the data for. Use `me` for the - account the API token belongs to. Apart from `me`, only the token's own - account and an organization the token's account is a member of are - accessible. API tokens with limited permissions cannot access this data. - required: true - style: simple - schema: - type: string - example: me diff --git a/apify-api/openapi/openapi.yaml b/apify-api/openapi/openapi.yaml index 9c3146fc12..2c2796f50d 100644 --- a/apify-api/openapi/openapi.yaml +++ b/apify-api/openapi/openapi.yaml @@ -775,10 +775,10 @@ paths: $ref: "paths/users/users@{userId}.yaml" /v2/users/me: $ref: paths/users/users@me.yaml - "/v2/users/{userId}/usage/monthly": - $ref: "paths/users/users@{userId}@usage@monthly.yaml" - "/v2/users/{userId}/limits": - $ref: "paths/users/users@{userId}@limits.yaml" + /v2/users/me/usage/monthly: + $ref: paths/users/users@me@usage@monthly.yaml + /v2/users/me/limits: + $ref: paths/users/users@me@limits.yaml /v2/browser-info: $ref: paths/tools/tools@browser-info.yaml /v2/tools/encode-and-sign: diff --git a/apify-api/openapi/paths/users/users@{userId}@limits.yaml b/apify-api/openapi/paths/users/users@{userId}@limits.yaml index ae1f96f7e4..355e8f4f6e 100644 --- a/apify-api/openapi/paths/users/users@{userId}@limits.yaml +++ b/apify-api/openapi/paths/users/users@{userId}@limits.yaml @@ -7,8 +7,6 @@ get: information you will see on your account's [Limits page](https://console.apify.com/billing#/limits). The returned data includes the current usage cycle, a summary of your limits, and your current usage. operationId: users_me_limits_get - parameters: - - $ref: "../../components/parameters/userParameters.yaml#/userId" responses: "200": description: "" @@ -40,8 +38,6 @@ put: Updates the account's limits manageable on your account's [Limits page](https://console.apify.com/billing#/limits). Specifically the: `maxMonthlyUsageUsd` and `dataRetentionDays` limits (see request body schema for more details). operationId: users_me_limits_put - parameters: - - $ref: "../../components/parameters/userParameters.yaml#/userId" requestBody: description: "" content: diff --git a/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml b/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml index 5f48dc82b3..d08fda14a1 100644 --- a/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml +++ b/apify-api/openapi/paths/users/users@{userId}@usage@monthly.yaml @@ -12,7 +12,6 @@ get: includes that date. operationId: users_me_usage_monthly_get parameters: - - $ref: "../../components/parameters/userParameters.yaml#/userId" - name: date in: query description: Date in the YYYY-MM-DD format.