Automation

Designing an API Request Builder for Embedded SaaS Automation

What a request builder must handle when the same API call runs for many connected users.

3 min read
On this page
  1. Why prebuilt connectors aren't enough
  2. What a request is made of
  3. Authentication per user
  4. Dynamic values
  5. Testing
  6. Using the response
  7. Error handling
  8. Reuse
  9. Where Pathfix fits
  10. Frequently asked questions

Every embedded automation platform eventually needs a way for builders to call an API that isn't covered by a prebuilt connector. That's the job of an API request builder: a structured interface for defining an HTTP request, testing it and using its response in later workflow steps.

This article looks at what a good request builder needs to handle in a SaaS automation context, where requests run on behalf of many different connected users.

Why prebuilt connectors aren't enough#

Prebuilt connectors cover common operations for popular services. But customers' needs quickly go beyond them:

  • An endpoint the connector doesn't expose.
  • A newer API version.
  • A niche or internal API.
  • A parameter or header the connector doesn't support.

Without a request builder, each of these becomes a feature request or a reason to leave the platform. With one, builders can call the API directly.

What a request is made of#

A request builder needs to represent every part of an HTTP request:

PartWhat the builder needs
MethodGET, POST, PUT, PATCH, DELETE
URLBase URL, path, and path parameters filled from data
Query parametersKey-value pairs, including values from earlier steps
HeadersCustom headers, content type, accept
AuthenticationHow credentials are applied, per connected user
BodyJSON, form data or raw, with values from earlier steps

The builder's job is to make each part explicit and editable, without hiding what's actually sent.

Authentication per user#

In an embedded automation platform, the same request definition runs for many users. Each run must use the credentials of the user it's running for.

That means the builder shouldn't ask for a token. It should ask *which connection* to use, and the platform applies that user's current credentials at execution time. Builders define the request once; authorization is resolved per run.

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTphYzZjZTUwMS1hYTFiLTQ1ODgtYTQ3ZC02NGZmYTA5YjA2NmUAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaK6qSv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goLg/W/2yiaINsW2hs3i9JEhnEXEPvdnF+CIGHkKl89InKPCAdD5NnJD+TTtSxyglJjM4h0AkBl89s5wkKw38=Embedded automation workflowFor a connected user, a trigger such as a webhook or schedule starts a workflow that transforms data, calls an API in that user’s context and records the execution.ConnecteduserTriggerwebhook, scheduleTransformmap, filterAPI callin user’s contextExecutionlog
The request is defined once. At run time, it executes in the context of the specific connected user.

Dynamic values#

Requests are rarely static. A builder needs a way to insert values from:

  • The workflow's trigger, such as a webhook payload.
  • Earlier steps' responses.
  • Constants and configuration.
  • The connected user's context.

The interface should show clearly which values are dynamic and where they come from, and let builders preview the resolved request with sample data.

Testing#

Builders need to run a request and see the result before relying on it in a workflow:

  • The fully resolved request that was sent.
  • The response status, headers and body.
  • Timing.
  • Errors explained in plain language where possible.

Testing should use a real connection, so the result reflects actual provider behaviour.

Using the response#

The response is only useful if later steps can use it. A request builder should:

  • Parse JSON responses into a structure builders can browse.
  • Let builders pick fields to pass to the next step.
  • Handle arrays, so later steps can loop over results.
  • Make errors available for conditions, so workflows can branch on failure.

Error handling#

Requests fail for many reasons: expired credentials, rate limits, invalid input, provider outages. The builder and runtime should distinguish them, so workflows can retry temporary failures, stop on permanent ones and surface authorization problems clearly.

Reuse#

Once a request works, builders want to reuse it. Saving request definitions, with their parameters, lets teams build a library of API calls specific to their product and use them across workflows.

Where Pathfix fits#

Pathfix Automation includes an API Builder for configuring custom API requests and using available API definitions, alongside a visual workflow builder, dynamic data between steps, data transformation, conditions and loops. Workflows run in the context of each connected user. Connections for supported OAuth providers rely on Pathfix OAuth.

See the Automation documentation for how API requests are configured.

Frequently asked questions#

Is a request builder only for developers?#

It's most useful for people who understand APIs, but a clear interface and good testing make it approachable for technical product and solutions staff too.

How is this different from a tool like Postman?#

API clients are for testing and exploring. A request builder in an automation platform defines requests that run inside workflows, for many users, with their own credentials.

Can a request builder replace connectors?#

It complements them. Connectors make common operations easy; the builder handles everything else.