Making a Passthrough Request

Make API requests directly to any of Merge's supported integrations.

This feature is only available to customers on our Professional or Enterprise plans. View the Merge Plans to learn more.


API endpoint

Send POST requests to the URL below with the required body parameters to create a Passthrough Requests.

https://api.merge.dev/api/{CATEGORY}/passthrough

Replace CATEGORY in the URL with hris, ats, accounting, ticketing, crm, mktg, or filestorage depending on the relevant category you’re making an API request to.


Body Parameters

Reference the integration’s API documentation to accurately fill out the body parameters for the specific Passthrough Request you’re looking to make.

methodenumRequired
* `GET` - GET * `OPTIONS` - OPTIONS * `HEAD` - HEAD * `POST` - POST * `PUT` - PUT * `PATCH` - PATCH * `DELETE` - DELETE
pathstringRequired>=1 character
The path of the request in the third party's platform.
base_url_overridestring or nullOptional>=1 character
An optional override of the third party's base url for the request.
datastring or nullOptional>=1 character

The data with the request. You must include a request_format parameter matching the data’s format

multipart_form_datalist of objects or nullOptional

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

headersmap from strings to any or nullOptional

The headers to use for the request (Merge will handle the account’s authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

request_formatenum or nullOptional
* `JSON` - JSON * `XML` - XML * `MULTIPART` - MULTIPART
Allowed values:
normalize_responsebooleanOptional

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.


Accessing Linked Account Credentials

Some third-party APIs require you to include credentials directly in the path or request body (data) when making Passthrough Requests to the third-party API on behalf of a linked account. You can securely access a linked account’s stored credentials programmatically by including variables in double brackets (e.g. {{USERNAME}}).

Below is the full list of variables available for use in Passthrough Requests:

VariableDescription
API_URL_SUBDOMAINThird-party API URL subdomain.
API_KEYThird-party API Key.
USERNAMEBasic auth username for third-party API.
PASSWORDBasic auth password for third-party API.
LINKED_ACCOUNT_ATTR.field_nameIf an account-specific credential is needed to make a request to a third-party API, and is not otherwise covered in the other variables, you can access it using this format. field_name represents the name of the field in the third-party API and should be replaced with that field name when using this in practice.

Example - Paylocity

This is an example request body that demonstrates how the API_URL_SUBDOMAIN variable can be used for Passthrough Requests to Paylocity’s API.

Example request body
1{
2 "method": "GET",
3 "path": "/v2/companies/{{API_URL_SUBDOMAIN}}/employees/"
4}

Some third-party APIs require you to encode credentials using Base64 encoding. You can specify what needs to be encoded into Base64 format in your third-party request by wrapping that content between {BASE-64} tags in the passthrough request body.

Example - Workday

This is an example request body that demonstrates how the BASE-64 method can be used for Passthrough Requests to Workday’s API.

Example request body
1{
2 "method": "GET",
3 "path": "/service/customreport2/{{API_URL_SUBDOMAIN}}/100814/Demographic_Report?format=json",
4 "headers": {
5 "Authorization": "Basic {BASE-64}{{USERNAME}}:{{PASSWORD}}{BASE-64}"
6 }
7}

Fetching with the Merge SDK

See below for an example of how to create an authenticated Passthrough Request with Merge’s SDK:

1import merge
2from merge.client import Merge
3
4
5client = Merge(
6 api_key="API_KEY",
7 account_token="ACCOUNT_TOKEN",
8)
9
10
11passthrough_result = client.crm.passthrough.create(
12 request=merge.resources.crm.types.DataPassthroughRequest(
13 method="GET",
14 path="/contacts/lists",
15 request_format="JSON",
16 base_url_override="https://override.baseurl.com",
17 )
18)

Response

The response to your query will look like the following:

Sample Response to Passthrough Request
1{
2 "method": "GET",
3 "path": "/unique-data",
4 "status": 200,
5 "response": {
6 "id": 23454,
7 "value": "ABC"
8 },
9 "headers": {
10 ...
11 "Authorization": "<redacted>"
12 }
13}

The Passthrough Request endpoint will return a 408 status if there is a timeout in getting the response. If you have experienced delays or timeouts with normal Passthrough Requests we recommend switching to use Merge’s Async Passthrough requests.