You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-v2/pages/connect/api-proxy.mdx
+54-6Lines changed: 54 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,45 @@ You can send requests to the Connect proxy using the [Pipedream SDK](/connect/sd
33
33
34
34
Refer to the full Connect API [here](/connect/api).
35
35
36
-
### Using the Pipedream SDK (preferred)
36
+
### Authenticating on behalf of your user
37
+
38
+
Most API integrations that use OAuth to authenticate requests require that you pass a user's access token in the `Authorization` header with the `Bearer` prefix. For these apps, the Connect proxy will automatically handle that for you — you don't need to pass any reference to their OAuth access token in this case.
39
+
40
+
For apps that require a different authentication method, you should include the necessary headers with the value surrounded by `{{ }}` in your request to the proxy, and Pipedream will automatically replace the macro with the real values and forward to the downstream API. For example:
41
+
42
+
```javascript
43
+
/*
44
+
OpenAI requires that you pass the API key
45
+
in the `Authorization` header with the `Bearer` prefix:
46
+
*/
47
+
48
+
headers: {
49
+
authorization:"Bearer {{api_key}}",
50
+
}
51
+
52
+
// Pipedream will replace the `{{api_key}}` macro with the actual API key
53
+
```
54
+
55
+
```javascript
56
+
/*
57
+
Zoho apps require that you pass the OAuth access token
58
+
in the `Authorization` header with a custom `Zoho-oauthtoken` prefix:
You can also send a request to the Connect REST API with the below config:
82
120
@@ -97,9 +135,15 @@ You can also send a request to the Connect REST API with the below config:
97
135
98
136
- If using the REST API, include the `Authorization` header with your Pipedream OAuth access token (`Bearer {access_token}`)
99
137
- Headers that contain the prefix `x-pd-proxy` will get forwarded to the downstream API
138
+
- If the downstream API requires [custom authorization headers](#authenticating-on-behalf-of-your-user), make sure to prepend with `x-pd-proxy` and include the macro `{{ }}` that Pipedream will replace with the actual value. For example,
139
+
140
+
```javascript
141
+
"x-pd-proxy-apiKey: {{api_key}}"
142
+
```
100
143
101
144
```bash
102
-
# First, obtain an OAuth access token
145
+
# First, obtain an OAuth access token to authenticate to the Pipedream API
146
+
103
147
curl -X POST https://api.pipedream.com/v1/oauth/token \
104
148
-H "Content-Type: application/json" \
105
149
-d '{
@@ -119,4 +163,8 @@ curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/proxy/{url_
119
163
}'
120
164
121
165
# Parse and return the data you need
122
-
```
166
+
```
167
+
168
+
## Rate limits
169
+
170
+
The Connect proxy limits API requests to **100 per minute per project**. [Let us know](https://pipedream.com/support) if you need higher limits.
|`POST /tokens`| 100 requests per minute per `external_user_id`|
150
-
|`GET */accounts/*`| The sum of requests across all `*/accounts/*` endpoints must not exceed 100 requests per minute. This includes requests to `/accounts`, `/apps/:app_id/accounts`, `/accounts/:account_id`, and more — any request for account metadata and credentials is counted towards this total. |
150
+
|`GET /accounts`| 100 requests per minute per project <br /><br />The sum of requests across all `*/accounts/*` endpoints must not exceed 100 requests per minute. This includes requests to,<br />• `/accounts`<br />• `/apps/:app_id/accounts`<br />• `/accounts/:account_id`|
151
+
|`/proxy`| 100 requests per minute per project |
151
152
152
153
If you need higher rate limits, please [reach out](https://pipedream.com/support).
|[Retrieve credentials via API](/connect/api#accounts)| Fetch the credentials for your end user from Pipedream's API to use in your application. | ✅ `development`<br />❌ `production`|
25
-
|[Invoke workflows](/connect/workflows)| Trigger any Pipedream workflow and use the connected account of your end user | ✅ `development`<br />❌ `production`|
26
-
|[Run components via API](/connect/components)| Run any action and deploy any trigger directly from your application | ✅ `development`<br />✅ `production`|
24
+
| Retrieve user credentrials |[Fetch the credentials](/connect/api#accounts) for your end user from Pipedream's API to use in your app | ✅ `development`<br />❌ `production`|
25
+
| Invoke workflows |[Trigger any Pipedream workflow](/connect/workflows) and use the connected account of your end users | ✅ `development`<br />❌ `production`|
26
+
| Embed prebuilt tools |[Run any action and deploy any trigger](/connect/components) directly from your AI agent or app | ✅ `development`<br />✅ `production`|
27
+
| Proxy API requests |[Write custom code to interface with any integrated API](/connect/api-proxy) while avoiding dealing with user auth | ✅ `development`<br />✅ `production`|
0 commit comments