Pipedream Connect provides a proxy API that you can use to send authenticated requests to any integrated API on behalf of your users. This is useful in a few scenarios:
The Connect proxy enables you to interface with any integrated API and make authenticated requests on behalf of your users, without dealing with OAuth or storing end user credentials.
You send a request to the proxy and identify the end user you want to act on behalf of
The proxy sends the request to the upstream API and dynamically inserts your end user’s auth credentials
The proxy returns the response from the upstream API back to you
Before getting started with the Connect proxy, make sure you’ve already gone through the managed auth quickstart for Pipedream Connect.
One of the core benefits of using the Connect API Proxy is not having to deal with storing or retrieving sensitive credentials for your end users.Since Pipedream has 3,000+ integrated apps, we know how the upstream APIs are expecting to receive access tokens or API keys. When you send a request to the proxy, Pipedream will look up the corresponding connected account for the relevant user, and automatically insert the authorization credentials in the appropriate header or URL param.
When making requests to the Connect Proxy, you must provide the following parameters:URL
The URL of the API you want to call (ex, https://slack.com/api/chat.postMessage)
If using the REST API directly, this should be a URL-safe Base64 encoded string (ex, aHR0cHM6Ly9zbGFjay5jb20vYXBpL2NoYXQucG9zdE1lc3NhZ2U)
For apps with dynamic domains (like Zendesk, Zoho, GitLab), you should use relative paths in your proxy requests. Pipedream automatically resolves the correct domain based on the user’s connected account. See When to use relative vs full URLs for details.
HTTP method
Use the HTTP method required by the upstream API
Body
Optionally include a body to send to the upstream API
Headers
If using the REST API, include the Authorization header with your Pipedream OAuth access token (Bearer {access_token})
Headers that contain the prefix x-pd-proxy- will get forwarded to the upstream API
import { PipedreamClient } from "@pipedream/sdk";const client = new PipedreamClient({ projectEnvironment: {development | production}, projectId: {your_pipedream_project_id}, clientId: {your_oauth_client_id}, clientSecret: {your_oauth_client_secret}});const resp = await client.proxy.post( { externalUserId: "{external_user_id}", // The external user ID for your end user accountId: "{account_id}", // The account ID for your end user (ex, apn_1234567) url: "https://slack.com/api/chat.postMessage", // Include any query params you need; no need to Base64 encode the URL if using the SDK headers: { "x-pd-proxy-hello": "world!" // Include any headers you need to send to the upstream API }, body: { text: "hello, world", channel: "C03NA8B4VA9" }, })// Parse and return the data you needconsole.log(resp);
from pipedream import Pipedreampd = Pipedream( project_environment="{development | production}", project_id="{your_pipedream_project_id}", client_id="{your_oauth_client_id}", client_secret="{your_oauth_client_secret}")response = pd.proxy.post( "https://slack.com/api/chat.postMessage", external_user_id="{external_user_id}", # The external user ID for your end user account_id="{account_id}", # The account ID for your end user (ex, apn_1234567) body={ "text": "hello, world", "channel": "C03NA8B4VA9", }, headers={ "x-pd-proxy-hello": "world!" # Include any headers you need to send to the upstream API })# Parse and return the data you needprint(response)
import com.pipedream.api.PipedreamClient;import com.pipedream.api.requests.ProxyPostRequest;import com.pipedream.api.requests.RequestOptions;import java.util.Map;PipedreamClient client = PipedreamClient.builder() .projectEnvironment("{development | production}") .projectId("{your_pipedream_project_id}") .clientId("{your_oauth_client_id}") .clientSecret("{your_oauth_client_secret}") .build();Map<String, Object> body = Map.of( "text", "hello, world", "channel", "C03NA8B4VA9");ProxyPostRequest request = ProxyPostRequest.builder() .externalUserId("{external_user_id}") // The external user ID for your end user .accountId("{account_id}") // The account ID for your end user (ex, apn_1234567) .body(body) .build();RequestOptions options = RequestOptions.builder() .addHeader("x-pd-proxy-hello", "world!") // Include any headers you need to send to the upstream API .build();Object response = client.proxy().post("https://slack.com/api/chat.postMessage", request, options);// Parse and return the data you needSystem.out.println(response);
# First, obtain an OAuth access token to authenticate to the Pipedream APIcurl -X POST https://api.pipedream.com/v1/oauth/token \ -H "Content-Type: application/json" \ -d '{ "grant_type": "client_credentials", "client_id": "{your_oauth_client_id}", "client_secret": "{your_oauth_client_secret}" }'# The response will include an access_token. Use it in the Authorization header below.curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/proxy/{url_safe_base64_encoded_url}?external_user_id={external_user_id}&account_id={apn_xxxxxxx}" \ -H "Authorization: Bearer {access_token}" \ -H "x-pd-environment: {development | production}" \ -H "x-pd-proxy-hello: world" \ -d '{ "text": "hello, world", "channel": "C03NA8B4VA9" }'# Parse and return the data you need
The vast majority of apps in Pipedream work with the Connect Proxy. To check if an app is supported and what domains are allowed, use pd.getApps() or the /apps REST API.
// Must use relative pathawait client.proxy.get({ accountId: "apn_1234567", externalUserId: "user-123", url: "/api/v4/projects", // Pipedream resolves to the end user's GitLab instance})
The maximum timeout for a request is 30 seconds. Requests that take longer than 30 seconds will be terminated, and Pipedream will return a 504 error to the caller.
The following headers are not allowed when making requests through the Connect API Proxy. Requests that include these headers will be rejected with a 400 error:
Accept-Encoding
Access-Control-Request-Headers
Access-Control-Request-Method
Connection
Content-Length
Cookie
Date
DNT
Expect
Host
Keep-Alive
Origin
Permissions-Policy
Referer
TE
Trailer
Transfer-Encoding
Upgrade
Via
Headers starting with Proxy-
Headers starting with Sec-
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.