tr Skip to content
Black Friday FlowMattic for life, 12 payments of $33.25 Or $399 once. Nothing added for splitting Ends in --Days --Hrs --Min --Sec See the deal

WordPress HTTP Request Step: Call Any REST API From a Workflow

API by FlowMattic: a new WooCommerce order triggers a POST request to a fulfilment API, and the returned shipment ID is saved back to the order.

API by FlowMattic is the step you reach for when an app has a REST API but no ready-made integration. It sends a WordPress HTTP request from inside a workflow: pick the method, enter the endpoint, add authentication, parameters and headers, and the response comes back as fields the next steps can use.

It suits developers who want to skip writing a plugin for one API call, agencies wiring a client’s internal tools into WordPress, and anyone whose favourite service is not yet among FlowMattic’s nearly 900 integrations. This guide covers every field on the step, how parameters turn into JSON, how responses and errors are handled, and seven workflows to copy.

What is API by FlowMattic?

API by FlowMattic is a built-in action app in the workflow builder. Its events are the HTTP methods: GET, POST, PUT, PATCH and DELETE. You add it like any other step, between a trigger and the actions that need the API’s answer.

The request leaves from your own WordPress server, so it runs as part of your workflow with no per-task fee. The text fields accept dynamic data, so a URL, a token or a body value can come from the trigger or any earlier step.

How a WordPress HTTP request step works

The step’s settings are grouped into four sections: Request, Request data, Response and Error handling.

1. Request: where the call goes

  • API Endpoint URL (required): the full address, for example https://api.example.com/v1/contacts.
  • Content Type (required): how the body is encoded, from the table below.
  • Authentication: No Authentication, Basic Authentication (API Key / Username and API Secret / Password), Bearer Token, or FlowMattic Connect, which reuses a saved Connect chosen in Choose Connect Account.

With FlowMattic Connect, the step applies whatever the Connect holds: an OAuth access token, a bearer token, basic credentials, or an API key added as a header or a query parameter.

FlowMattic API by FlowMattic step showing the Request section with API Endpoint URL, Content Type and Authentication, followed by Parameters and Headers tabs.
An API by FlowMattic POST step with the endpoint, JSON content type and bearer-token authentication filled in.

2. Request data: parameters and headers

On the Parameters tab, tick Send parameters with this request and add key and value rows with Add parameter. On the Headers tab, tick Send headers with this request and add rows with Add header. Authentication headers are added for you, so you do not repeat them here.

With the Custom JSON – Use Your Code content type, you write the whole body yourself in the Custom JSON box instead, with dynamic tags inside it.

3. Response: what comes back

Response Format decides how the reply is turned into fields. Simple (the default) flattens nested objects into individual fields, so data.id becomes data_id. Advanced keeps nested values as JSON text and returns a top-level list whole, which is what you want to feed an Iterator or forward to another service. The raw body is always available too.

Show Response Headers adds a response_headers field, useful for APIs that return tokens, pagination links or rate-limit counters in headers.

4. Error handling: what counts as a failure

Any status code outside the 2xx range is an error. Treat Empty Response as Error (default No) also fails a call that returns nothing. When a call fails, the step can email someone (Send Email on Error and Email Recipient, which defaults to the admin email), post the error as JSON to an Error Webhook URL, and either carry on or stop the run with Continue Workflow on Error.

Then click Test. The test sends the real request and shows the response, and from then on every response field is available to later steps.

Content types and options

Content TypeWhat is sent
JSON – With ParametersYour parameter rows as a JSON body (application/json)
Custom JSON – Use Your CodeThe Custom JSON box as the body, as written
Form DataParameter rows as multipart/form-data
URL Encoded Form DataParameter rows as application/x-www-form-urlencoded
TextParameter rows sent as plain fields, with text as the content type
HTMLParameter rows with a text/html content type
OptionDefaultWhat it does
Response FormatSimpleSimple flattens nested fields; Advanced keeps them as JSON
Show Response HeadersNoAdds a response_headers field
Treat Empty Response as ErrorNoFails the step when the body is empty
Send Email on ErrorNoEmails the Email Recipient with the error type, code, endpoint and tips
Error Webhook URLEmptyPosts the error details as JSON to Slack, Discord or any webhook
Continue Workflow on ErrorYes – Continue workflowNo – Stop workflow ends the run at this step

How parameter rows become JSON

With the JSON – With Parameters content type, values are typed for you:

  • Numbers are sent as numbers, and true and false as booleans. The word null sends a JSON null.
  • A value that is itself JSON, such as {"city":"Leeds"}, is sent as a nested object.
  • Keys in bracket notation build nested data: customer[name] nests, items[0][sku] indexes and tags[] appends. Bracket values keep leading zeros, a leading plus and very long IDs as text.

Use cases

Send new orders to a fulfilment service

Acme Supplies ships through a warehouse with its own REST API. Each new order is posted as JSON with a bearer token, and the shipment ID that comes back is stored for support.

Flow: WooCommerce New Order Created → API by FlowMattic POST → WooCommerce Add Order Note

Enrich leads before they reach the CRM

A marketing team looks up each new lead’s company details with a GET request to an enrichment API, then creates the CRM contact with the extra fields already filled in.

Flow: Form Builder New Form Submission → API by FlowMattic GET → HubSpot Create Contact

Weekly client reports for an agency

An agency pulls each client’s figures from a reporting API every Monday through a saved FlowMattic Connect, so the credentials live in one place and every report workflow reuses them.

Flow: Schedule Every Week → API by FlowMattic GET (FlowMattic Connect) → Send Email

Open helpdesk tickets from support emails

A support desk without a native integration still has an API. Each parsed email becomes a ticket through a POST request, and the team gets the new ticket number in Slack.

Flow: Email Parser Email Received → API by FlowMattic POST → Slack Send Channel Message

Provision accounts in an internal tool

When Amelia Okafor registers on the site, an internal staff portal that only accepts form-encoded requests gets her account through a URL Encoded Form Data POST.

Flow: WordPress New User → API by FlowMattic POST (URL Encoded Form Data) → Send Email

Loop through a list the API returns

Set Response Format to Advanced and the array comes back whole, ready for an Iterator to process one item at a time, here writing each record to a sheet.

Flow: Schedule Every Day → API by FlowMattic GET (Advanced) → Iterator Loop Through Array → Google Sheets Add New Row

Call a model endpoint and answer the caller

A SaaS team runs a classification model behind its own endpoint. Incoming requests are forwarded with a Custom JSON body, and the model’s answer goes straight back to the caller.

Flow: Webhook → API by FlowMattic POST (Custom JSON) → Webhook Response Set Webhook Response

Tips and gotchas

  • Testing is live. Test sends the real request. A POST test creates a real record, so point it at a sandbox when the API has one.
  • GET has no body. Custom JSON is ignored on GET requests; put query values in the URL.
  • Watch leading zeros. A plain key with a value such as 01234 is sent as the number 1234. Use a bracket key or Custom JSON to keep it as text.
  • “Continue” still counts as failed. With Continue Workflow on Error set to Yes, later steps run, but the step is recorded as an error and the run as failed or partially failed.
  • One word trap. A reply that contains both “invalid” and “json” is treated as an invalid-JSON error, even with a 2xx status.
  • Time limit. Each call waits up to 60 seconds for an answer.
  • Rate limits are retried. If the API answers 429 (too many requests), the step waits and tries again, up to three times. Between tries it waits as long as the API’s Retry-After header asks, up to 60 seconds, or 30 seconds when there is none; a POST always waits 30 seconds before its first retry.
  • Defaults you get for free. Every request sends a FlowMattic/<version> user agent and Accept: application/json; your own headers are added on top.

Related features

  • Custom Apps: turn calls you repeat into a reusable app with its own triggers and actions.
  • Connects: save credentials once and pick them in the Authentication field.
  • JSON Parser: pull values out of an Advanced response by path.
  • Workflow error handling: alerts and recovery when a call fails.

FAQ

How do I make an HTTP request from WordPress without code?

Add an API by FlowMattic step to a workflow, choose the method, and fill in the endpoint, content type, authentication, parameters and headers. The response becomes fields you can map into later steps, so each WordPress HTTP request feeds the rest of the workflow.

Which HTTP methods and body formats are supported?

GET, POST, PUT, PATCH and DELETE. Bodies can be JSON built from rows, your own Custom JSON, multipart form data, URL-encoded form data, text or HTML.

Can the step use OAuth?

Yes, through a FlowMattic Connect. Choose FlowMattic Connect under Authentication and pick the account; the step adds the Connect’s access token to the request.

What happens when the API returns an error?

Any non-2xx status marks the step as an error. Depending on your settings it emails a recipient, posts to an error webhook, and continues or stops the run. Fix the cause and re-execute the run from Task History.

API by FlowMattic sits alongside the other modules in the visual workflow builder. See FlowMattic pricing and send your first WordPress HTTP request to any REST API.

More from the blog