API requests
The Request section of an API source defines what is sent: the HTTP method, the URL, headers, query parameters and, for writes, a body. Placeholders let one definition serve many calls — the city, the record id or the email come from whoever calls the API.
API requests
The Request section of an API source defines what is sent: the HTTP method, the URL, headers, query parameters and, for writes, a body. Placeholders let one definition serve many calls — the city, the record id or the email come from whoever calls the API.
When to use
GETto read data (lists, lookups).POSTto create something or trigger an action in the other system.PUT/PATCHto update,DELETEto remove.
The request fields
| Field | What to enter |
|---|---|
| Method | GET, POST, PUT, PATCH or DELETE |
| URL | The full address, e.g. https://api.example.com/v1/items/{{params.id}} |
| Headers | Name / value pairs such as Accept: application/json (up to 30) |
| Query parameters | Name / value pairs appended to the URL as ?name=value (up to 30) |
| Body | Text sent with non-GET requests, usually JSON (up to 20,000 characters) |
A JSON body (starting with { or [) automatically gets Content-Type: application/json unless you set that header yourself; other bodies are sent as plain text.
Placeholders
Three kinds of placeholders work in the URL, headers, query values and body:
{{params.name}}— a value passed by whoever calls the API: the Parameters of a Call API action or step, or a test value. In the URL the value is encoded for safety; elsewhere it is inserted as is. Nested values work too ({{params.customer.email}}), and objects are inserted as JSON.{{env.KEY}}— a plain environment variable from Settings → Environment & secrets (for example a base URL that differs between staging and production).{{secret.KEY}}— a secret, inserted on the server only (Authentication).
The editor detects every {{params.…}} placeholder and lists them as parameters in actions, workflow steps and the test panel.
How to set up a request
- In APIs, select or create the API source.
- Choose the method and paste the URL from the service's documentation, replacing variable parts with
{{params.…}}. - Add required headers (
Accept,Content-Type, custom headers). Put secrets in the Authentication section, not here. - Add query parameters for
GETfilters (limit = 20,city = {{params.city}}). - For
POST/PUT/PATCH, write the body. - Use Test request to try it with sample parameter values.
POST https://api.example-crm.com/v1/contacts
Headers: Accept: application/json
Body:
{
"email": "{{params.email}}",
"name": "{{params.name}}",
"source": "{{env.APP_NAME}}"
}Passing parameters
- Call API action: under Parameters, add
email= Form › email,name= Record › Name, and so on. - Call API workflow step: the Parameters list is pre-filled with the placeholders found in the request; bind each to record fields, results or templates.
- Component bindings (Data tab) pass no parameters; use them for requests that need none.
Common mistakes
- Spaces inside placeholders.
{{ params.id }}is accepted, but{{params id}}is not. - Quoting numbers in JSON bodies.
"qty": "{{params.qty}}"sends a string; write"qty": {{params.qty}}to send a number. - URL-encoding twice. Values in the URL are already encoded; do not pre-encode them.
- Relying on the
Content-Typeof aGET. Bodies are ignored forGETrequests.
Related
- APIs overview · Authentication · Response mapping
- Test request · Call API action · Environment variables
Advanced
fillParams replaces {{params.path}} with encodeURIComponent in the URL and raw text elsewhere; interpolateSecrets then resolves {{secret.NAME}} and {{env.NAME}} (names in capitals, digits and underscores). Headers always include Accept: application/json, text/plain;q=0.8, */*;q=0.5 and User-Agent: MyAppBuilder-Runtime/1.0.