Appearance
HTTP Request
The HTTP Request action lets you call any HTTP endpoint from an API Endpoint. Configure method, URL, body/query params, headers, authentication, retries, and timeouts. Because this runs on the server, you can safely use Secure environment variables for API keys and secrets.
Method
GETPOSTPUTPATCHDELETEHEADOPTIONS
This is the “type” of request you’re making:
- Use
GETwhen you want to retrieve data (for example, get a list of products). - Use
POSTwhen you want to create something (for example, create an order). - Use
PUTorPATCHwhen you want to update something. - Use
DELETEwhen you want to remove something.
URL
This is the full address of the API endpoint you want to call.
- It’s required.
- You can bind it (for example, use an environment variable for the base URL).
URL params
Some APIs expect values inside the URL, like an ID:
- Example URL:
https://api.example.com/users/:id
When your URL contains /:something, WeWeb shows a URL Params section where you can fill in id.
Data
Query parameters
Use Query Parameters to add key/value pairs to the end of the URL.
- Example:
{ "search": "boots", "page": 1 } - The final URL becomes something like:
...?search=boots&page=1
This is commonly used for searching, filtering, sorting, and paging.
Body
Use Body to send data to the API (for example, the details of a new order).
- This is usually used with
POST,PUT, orPATCH. - By default, the body is sent as JSON (which is what most APIs expect).
Authentication (optional)
Authentication is how you prove to the API that your request is allowed.
In Auth, choose one of these:
None: The API is public or doesn’t require sign-in.Basic: You send a username + password (less common for modern APIs).Bearer: You send a token (very common). This usually looks likeBearer <token>.
USE ENVIRONMENT VARIABLES
Bind credentials from Secure environment variables so they don’t get exposed.
What to fill
- For
Basic, fillUsernameandPassword. - For
Bearer, fillToken.
Headers (optional)
Headers are extra settings you send with the request. Many APIs use headers for authentication and for telling the API what format you’re sending.
Add custom headers as an object. Common examples:
json
{
"Content-Type": "application/json",
"X-Api-Key": "{{env.API_KEY}}"
}You can bind Secure environment variables in headers to keep your API keys safe.
Retry configuration (optional)
Retries are helpful when an API sometimes fails temporarily (for example, a short network issue).
Max Attempts: How many extra tries to do after the first try. Use0to disable retries.Retry Type:Linear: Wait the same amount each time.Exponential: Wait longer and longer each time (useful when an API is rate-limiting you).
Delay (ms): How long to wait between tries (forLinear).Base Delay (ms)AndMax Delay (ms): How the wait time grows (forExponential).
Use retries for flaky networks or 429/5xx responses. Avoid retrying actions that could create duplicates (for example “create order”) unless the API explicitly says it’s safe to retry.
Advanced options
Throw on Error
When this is enabled, WeWeb treats non‑success responses (for example 401 or 500) as an error. This makes it easier to handle problems with Try/Catch.
Timeout (ms)
This is the maximum time WeWeb will wait before it stops the request.
If you set it too low, slow APIs may fail. If you set it too high, your workflow may feel slow when the API is down.
Result shape
On success, the action returns an object similar to:
json
{
"status": 200,
"headers": { "...": "..." },
"data": { /* parsed JSON or text */ }
}In later actions, you’ll usually bind:
result.dataFor the returned data, orresult.statusIf you need to check whether it worked.
Examples
GET with query params
- Method: GET
- URL:
https://api.example.com/search - Query Parameters: Bind
{ q: inputs.query, limit: 20 }
POST JSON with Bearer token from environment variable
- Method: POST
- URL:
https://api.example.com/orders - Body: Bind
{ items: inputs.items, customerId: inputs.userId } - Auth: Bearer → Token: Bind from Secure environment variable
env.API_TOKEN
Handle errors
Use Try/Catch to handle errors gracefully. In the Catch branch, you can log the error or send an error response back to the caller.
SECURE API KEYS
Always use Secure environment variables for API keys and secrets. Never hardcode them in your workflows.

