An API request fails
API calls are made from MyAppBuilder's server, never from the visitor's browser, so most failures are about the URL, the credentials for the current environment, or the other service's answer. The Test request panel in APIs shows the HTTP status and the response, which is the fas
API calls are made from MyAppBuilder's server, never from the visitor's browser, so most failures are about the URL, the credentials for the current environment, or the other service's answer. The Test request panel in APIs shows the HTTP status and the response, which is the fastest way to see what the service said.
Symptoms
- The Test request shows a red badge such as HTTP 401, 403, 404 or 500, or "The request could not be sent."
- A toast in the app:
API "Weather" needs the secret WEATHER_KEY in production. - A toast: "Requests to private network addresses are not allowed." or "Only http and https URLs are allowed."
- A workflow API step fails in Run history.
- The publish checklist says
API "…" has an invalid URLorneeds secret … in production.
Likely causes and fixes
1. The secret is missing for this environment
Each environment has its own secrets. Preview uses Development, staging uses Staging, the live app uses Production. Open Settings › Environment & secrets, select the environment named in the message and add the secret with exactly the name the API source references.
2. Wrong authentication
Open the API in APIs and check the authentication type (none, bearer, basic, API key header) and the header name expected by the service. A 401 means the credentials were rejected; a 403 means they are valid but not allowed for that call. Replace the secret value if the key was rotated.
3. The URL is invalid or blocked
- Must start with
http://orhttps://(or an{{env.NAME}}template that resolves to one). - Credentials inside the URL (
https://user:pass@…) are refused: "Put credentials in a secret header, not in the URL." - Addresses on private networks,
localhostor.internalhosts are refused by the safety guard: "Requests to internal hosts are not allowed." / "Requests to private network addresses are not allowed." Use a public endpoint. - "Could not resolve <host>" means the hostname does not exist; check for typos.
- "Too many redirects" means the service bounced the request more than four times.
4. The service answered with an error
Read the response in the Test request: a 404 usually means a wrong path or id, a 400 a wrong body or query, a 500 a problem on their side. Compare with the service's documentation.
5. Timeout or oversized response
Requests stop after the API's timeout setting; responses over 2 MB are rejected ("returned more than 2 MB"). Ask for fewer records (pagination, filters) or raise the timeout.
6. The response path is wrong
The request succeeds but components show nothing: the response path (where the list lives in the JSON, for example data.items) does not match. Inspect the response in the Test panel and adjust the path and the inferred fields.
7. Called from the app but not allowed
"This API can only be used from workflows." means the API source is not marked as callable from the client. Enable it in the API settings or call it from a workflow step.
8. Rate limits
App-side API calls are limited per user (60 per minute). Bursts from a loop action can hit the limit.
Quick diagnosis
Test request in APIs view (uses Development secrets) works → check Staging / Production secrets, then publish 401 / 403 → authentication type, header name, key value blocked → URL safety guard (private address, credentials in URL) no data → response path and field mapping
Common mistakes
- Testing with the Development key and publishing without the Production key. The checklist catches APIs with a missing secret; fix it before going live.
- Pointing at a server on your office network. The platform cannot reach private addresses.
- Storing the API key as a plain variable. It would be exposed to editors and the browser; use a secret.