Automation Blog

How to Pass Data Through for an API Request Using Webhooks by Zapier

How to use Webhooks by Zapier to send API requests with data from previous Zap steps — mapping trigger and action output fields into URL query parameters, request headers, and JSON body fields without writing any code.

ZapierWebhooksAPI

By Troy Tessalone · · 5 minutes

Automation Guide

A practical field guide from Automation Ace.

How to Pass Data Through for an API Request Using Webhooks by Zapier

Webhooks by Zapier is the no-code way to make HTTP requests — GET, POST, PUT, PATCH, DELETE — from inside a Zap. Fields from any previous step can be mapped directly into the URL, query parameters, request headers, and request body. Understanding exactly how Webhooks by Zapier structures each request type, and where to put each piece of data, is the key skill for connecting APIs in Zapier without writing a Code step. This guide covers the most common data-passing patterns.

Webhooks by Zapier: Action Events

The Webhooks by Zapier app offers several action events:

  • GET: Send an HTTP GET request. Data passed via URL query parameters.
  • POST: Send an HTTP POST request. Data passed via request body (form-encoded or JSON).
  • PUT: Send an HTTP PUT request. Same body options as POST.
  • PATCH: Send an HTTP PATCH request. Same body options as POST.
  • Custom Request: Full control over method, URL, headers, and body — the most flexible option.

Passing Data via URL Query Parameters (GET Requests)

For a GET request, map Zap field values into the URL directly. Webhooks by Zapier's GET action has a "Query String Params" section where you add key-value pairs — Zapier URL-encodes them automatically and appends them to the URL:

  1. Choose Webhooks by Zapier → GET as the action.
  2. Enter the base URL: https://api.example.com/contacts
  3. In the Query String Params section, add rows:
    • Key: email → Value: map from trigger field (e.g., "Email" from a form trigger)
    • Key: status → Value: active (static value)
  4. In Headers, add: Authorization → Bearer [api_token]

Zapier constructs the final URL as https://api.example.com/contacts?email=user%40example.com&status=active and fires the GET request. The response fields become available in subsequent Zap steps.

Passing Data via POST JSON Body

For a POST request with a JSON body:

  1. Choose Webhooks by Zapier → POST
  2. Enter the endpoint URL
  3. Set Payload Type to JSON — this sets Content-Type: application/json automatically
  4. In the Data section, add key-value rows:
    • Key: name → Value: map from previous step
    • Key: email → Value: map from previous step
    • Key: source → Value: zapier (static)
  5. Add authentication in Headers: Authorization → Bearer [token]

Zapier serializes the Data key-value pairs as a flat JSON object: {"name": "...", "email": "...", "source": "zapier"}. If the API requires a nested JSON structure (e.g., {"contact": {"name": "...", "email": "..."}}), you cannot express this in Webhooks by Zapier's key-value UI — use a Code step instead. See HTTP POST requests in a Zapier Code step for nested body patterns.

Passing Data via Form-Encoded Body

For APIs that expect application/x-www-form-urlencoded (OAuth token endpoints, legacy systems):

  1. Choose Webhooks by Zapier → POST
  2. Set Payload Type to Form
  3. Add key-value rows in Data — Zapier sends them as URL-encoded form data

Passing Data in Request Headers

Custom headers are configured in the Headers section of any Webhooks action. Each row is a key-value pair:

  • Authorization → Bearer [token] — map [token] from a previous step or enter as a static value
  • X-Api-Key → map an API key field
  • X-Request-Source → zapier
  • Accept → application/json

Header values can be a mix of static text and mapped Zap fields — type static text and insert the dynamic field from the field picker inline.

Basic Authentication

For APIs using HTTP Basic Auth (username:password), Webhooks by Zapier has dedicated Basic Auth fields — Username and Password — separate from the headers section. Enter the credentials directly; Zapier encodes them as the Authorization header automatically. This is cleaner than manually constructing the Base64-encoded header string.

Passing a Path Parameter in the URL

For REST APIs with IDs in the URL path (e.g., /records/{id}), map the ID directly into the URL field:

  • URL field: https://api.example.com/records/ then insert the record ID field from the field picker

Zapier concatenates the mapped value into the URL. If the ID might contain special characters, use a Code step with encodeURIComponent() to ensure safe encoding — Webhooks by Zapier does not automatically encode path segments.

When Webhooks by Zapier Isn't Enough

Use a Code step instead of Webhooks by Zapier when:

  • The request body requires nested JSON structures (arrays, nested objects)
  • Multiple API calls need to be made in sequence using each response to build the next request
  • Conditional logic determines which fields to include in the request body
  • The response is paginated and you need all pages before proceeding
  • Custom error handling beyond "fail the Zap on non-2xx" is required
Webhooks by Zapier handles the vast majority of API integrations without code — GET with query params, POST with flat JSON body, custom headers, Basic Auth. The key is knowing which field maps where: Query String Params for GET parameters, Data for POST body fields, and Headers for authentication. When the API's requirements exceed what the key-value UI can express, that's the signal to move to a Code step.

For more complex API calls, see HTTP GET requests in a Zapier Code step and HTTP POST requests in a Zapier Code step. For a broader overview of API usage in Zapier, see how to use APIs in Zapier steps and API authentication for automation. For help mapping data into an API integration, talk to Automation Ace.

ZapierWebhooksAPI

Disclaimer: This article may include links to apps, products, or services. Some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.

Build Better Systems

Ready to automate with confidence?

Share your tools, process, and goals. Automation Ace can design the workflow, integration, AI assist, or code bridge that fits your business.

Start a Project →