Dify Cloud Knowledge API returns HTTP 403 / error 1010 from Google Cloud Shell
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
Dify Cloud (hosted at cloud.dify.ai), Pro plan. Deployed version number unknown.
Cloud or Self Hosted
Cloud
Steps to reproduce
- In Dify Cloud, open Knowledge → Service API → API Key.
- Create a new API key scoped to the intended knowledge base and copy it immediately.
- In Google Cloud Shell, store the key in an environment variable named DIFY_KNOWLEDGE_API_KEY.
- Using Python 3 and urllib.request, send a read-only GET request to: https://api.dify.ai/v1/datasets/<DATASET_ID>
- Include the request header: Authorization: Bearer <API_KEY>
- Observe HTTP 403 with the response body: error code: 1010.
The request was made on September 30, 2026, at approximately 2:19 p.m. CDT (19:19 UTC).
The newly created key was captured as a 32-character value. No API secret is included in this report.
✔️ Expected Behavior
An authenticated request with a valid Knowledge API key should return the requested knowledge base details.
If the key or request is invalid, we expect a structured API error explaining the authentication, permission, or request problem.
❌ Actual Behavior
The request returns:
HTTP status: 403 Response body: error code: 1010
This appears to be a Cloudflare block, but we cannot determine whether the request reaches Dify’s API authentication layer. We have therefore been unable to validate the newly created key or proceed with our approval-to-ingestion integration.
All requests so far have been read-only. No document uploads or modifications have been attempted.
Please investigate this block and confirm the supported configuration for server-side Knowledge API requests from Google Cloud Shell using Python urllib.request.
A potentially related report is: https://github.com/langgenius/dify/discussions/28093
That report also describes a Cloudflare 403 from a Python client, but uses a different endpoint and does not establish the same 1010 error.
Source: langgenius/dify