Skip to content

Commit a051cdd

Browse files
update connect API docs (#13145)
* Update index.mdx * updating connect docs
1 parent 8776396 commit a051cdd

File tree

2 files changed

+202
-28
lines changed

2 files changed

+202
-28
lines changed

docs-v2/next.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ module.exports = withNextra({
4848
SERVICE_DB_SIZE_LIMIT: "60KB",
4949
TMP_SIZE_LIMIT: "2GB",
5050
DELAY_MIN_MAX_TIME:
51-
"You can pause your workflow for as little as one millisecond, or as long as one year",
52-
PUBLIC_APPS: "2,000",
51+
"You can pause your workflow for as little as one millisecond, or as long as one year",
52+
PUBLIC_APPS: "2,200",
5353
FREE_INSPECTOR_EVENT_LIMIT: "7 days of events",
5454
WARM_WORKERS_INTERVAL: "10 minutes",
5555
WARM_WORKERS_CREDITS_PER_INTERVAL: "5",

docs-v2/pages/connect/index.mdx

Lines changed: 200 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,70 @@ import { Steps } from 'nextra/components'
33

44
# Pipedream Connect
55

6+
## Overview
7+
8+
Pipedream Connect is the easiest way for your users to connect to any API, **right in your product**.
9+
10+
Connect enables you to easily integrate more than {process.env.PUBLIC_APPS}+ APIs directly into your application, letting you make authenticated requests on behalf of your end users, while not having to handle authorization grants or refresh tokens yourself, and it includes these features:
11+
1. [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) to initiate authorization for any one of the [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) available on Pipedream
12+
2. [REST API](#rest-api-overview) to retrieve credentials (access token, API key, etc.) for your end users
13+
3. The Pipedream platform, which includes [a serverless runtime](/), [thousands of pre-built source-available triggers and actions](https://github.com/PipedreamHQ/pipedream/tree/master/components), and a first-class developer experience to build, test, and deploy custom workflows
14+
15+
616
<Callout type="info">
7-
Pipedream Connect is currently in **preview** and we're looking for feedback!
17+
**Pipedream Connect is currently in preview and we're looking for feedback!**
818

919
**While in the preview phase, the API may change without notice. We'll do our best to communicate any changes, but please be aware that breaking changes may occur.**
1020

11-
Please [let us know](https://pipedream.com/support) how you're using it, what's not working, and what else you'd like to see!
21+
Please [let us know](mailto:connect@pipedream.com) how you're using it, what's not working, and what else you'd like to see!
1222
</Callout>
1323

14-
## Overview
15-
16-
Connect enables you to easily integrate more than {process.env.PUBLIC_APPS}+ APIs directly into your application, letting you make authenticated requests on behalf of your end users, while not having handle authorization grants or refresh tokens yourself, and it includes these features:
17-
1. [Client SDK](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk) to initiate authorization for any one of the [{process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps) available on Pipedream
18-
2. [REST API](/connected-accounts/api) to retrieve credentials (access token, API key, etc.) for your end users
19-
3. The rest of Pipedream, which includes [a serverless runtime platform](/), [thousands of pre-built source-available triggers and actions](https://github.com/PipedreamHQ/pipedream/tree/master/components), and a first-class developer experience to build, test, and deploy custom workflows
20-
2124
## Getting started
2225

2326
<Steps>
2427

2528
### Enable the feature flag
26-
Enable the feature flag for **Connect** in your Pipedream account: [https://pipedream.com/settings/alpha](https://pipedream.com/settings/alpha)
29+
- Enable the feature flag for **Pipedream Connect** in your [account settings here](https://pipedream.com/settings/alpha).
2730

2831
<Callout type="info">
29-
Please reach out to our team at [[email protected]]([email protected]) to enable your account for Connect, once you've enabled the feature flag.
32+
Please reach out to our team at [[email protected]](mailto:[email protected]) to activate your account for Connect once you've enabled the feature flag and send us your [workspace ID](https://pipedream.com/settings/account).
3033
</Callout>
3134

3235
### Verify your application's domain
33-
To integrate the Pipedream SDK on your site, you'll need to verify ownership of your web domain. [Check out the docs](workspaces/domain-verification#pipedream-connect) to get started.
36+
- To integrate the Pipedream SDK on your site, you'll need to verify ownership of your web domain. [Check out the docs](workspaces/domain-verification#pipedream-connect) to get started.
3437

3538
### Configure an OAuth client in Pipedream
36-
To use Pipedream Connect, you'll need to create an OAuth client in Pipedream, for whatever app you want to integrate. [Check out the docs](/connected-accounts/oauth-clients#configuring-custom-oauth-clients) to get started.
39+
- To use Pipedream Connect, you'll need to create an OAuth client in Pipedream for whatever app you want to integrate. [Check out the docs](/connected-accounts/oauth-clients#configuring-custom-oauth-clients) to get started.
40+
- Make sure to check the box to **Allow external user connections** in the OAuth client configuration in Pipedream
3741

3842
### Open your Pipedream project
39-
Open an existing Pipedream project or create a new one: [https://pipedream.com/projects](https://pipedream.com/projects)
40-
- Note your **Project Public Key** and **Project Secret Key** from the **Connect** tab within your project, you'll need these when configuring the SDK and making API requests
43+
- Open an existing Pipedream project or create a new one: [https://pipedream.com/projects](https://pipedream.com/projects)
44+
- Note your **Project Public Key** and **Project Secret Key** from the **Connect** tab within your project you'll need these when configuring the SDK and making API requests
4145

4246
### Run the example app
43-
The code for the Pipedream SDK can be found in our [public `pipedream` repo](https://github.com/PipedreamHQ/pipedream), in `/packages/sdk`. Check out the `README` there to get started.
47+
- Install the [SDK](https://www.npmjs.com/package/@pipedream/sdk) via npm: `npm install @pipedream/sdk`
48+
- The code for the Pipedream SDK lives in the [public pipedream repo](https://github.com/PipedreamHQ/pipedream/tree/master/packages/sdk)
49+
- Check out the example app and README there to get started
4450

4551
### Retrieve your user credentials from Pipedream's API
46-
Check out to the API reference below to retrieve your users' credentials from Pipedream's API after they've connected their account.
52+
- Check out to the API reference below to retrieve your users' credentials from Pipedream's API after they've connected their account.
4753

4854
</Steps>
4955

5056
## Retrieving account details and user credentials
5157
After your end users have connected their account using Pipedream Connect, you can retrieve their credentials using Pipedream's REST API, which enables you to make authenticated requests on their behalf.
5258

5359
### REST API Overview
54-
The base URL for all Connect requests is `https://api.pipedream.com/v1/connect`.
60+
<Callout type="warning">
61+
Note that both the Base URL and authentication method for the Connect REST API are different from the rest of Pipedream's REST API.
62+
</Callout>
63+
64+
**Base URL for all Connect requests**
65+
```
66+
https://api.pipedream.com/v1/connect
67+
```
68+
69+
**Authentication**
5570

5671
You authenticate to the Connect REST API using **Basic Auth**. Send your Pipedream [Project Public Key]() as the username and the [Project Secret Key]() as the password. When you make API requests, pass an
5772
`Authorization` header of the following format:
@@ -69,8 +84,12 @@ curl 'https://api.pipedream.com/v1/connect/accounts' \
6984

7085
### API Reference
7186

72-
#### List accounts
73-
List all connected accounts for end users within your project
87+
#### List all accounts
88+
List all connected accounts for all end users within your project
89+
90+
<Callout type="warning">
91+
This endpoint is not currently paginated, so we'll attempt to return all connected accounts for all users within your project. We intend to add pagination soon.
92+
</Callout>
7493

7594
```
7695
GET /accounts/
@@ -85,6 +104,7 @@ GET /accounts/
85104
{
86105
"id": "apn_XehyZPr",
87106
"name": null,
107+
"external_id": "user-abc-123",
88108
"healthy": true,
89109
"dead": false,
90110
"app": {
@@ -97,6 +117,8 @@ GET /accounts/
97117
{
98118
"id": "apn_b6h9QDK",
99119
"name": null,
120+
"external_id": "user-abc-123",
121+
"external_id": "user-abc-123",
100122
"healthy": true,
101123
"dead": false,
102124
"app": {
@@ -109,6 +131,7 @@ GET /accounts/
109131
{
110132
"id": "apn_0WhJYxv",
111133
"name": null,
134+
"external_id": "user-abc-123",
112135
"healthy": true,
113136
"dead": false,
114137
"app": {
@@ -121,6 +144,7 @@ GET /accounts/
121144
{
122145
"id": "apn_kVh9PJx",
123146
"name": null,
147+
"external_id": "user-abc-123",
124148
"healthy": true,
125149
"dead": false,
126150
"app": {
@@ -133,6 +157,7 @@ GET /accounts/
133157
{
134158
"id": "apn_WYhMlrz",
135159
"name": null,
160+
"external_id": "user-abc-123",
136161
"healthy": true,
137162
"dead": false,
138163
"app": {
@@ -162,6 +187,7 @@ GET /apps/:app_id/accounts
162187
{
163188
"id": "apn_WYhMlrz",
164189
"name": null,
190+
"external_id": "user-abc-123",
165191
"healthy": true,
166192
"dead": false,
167193
"app": {
@@ -180,8 +206,9 @@ GET /apps/:app_id/accounts
180206
]
181207
```
182208

183-
#### Retrieve account details
184-
Retrieve the account details for a specific account
209+
#### Retrieve account details for a specific auth provision
210+
211+
Retrieve the account details for a specific account based on the auth provision
185212

186213
```
187214
GET /accounts/:apn_id
@@ -196,6 +223,7 @@ GET /accounts/:apn_id
196223
"data": {
197224
"id": "apn_WYhMlrz",
198225
"name": null,
226+
"external_id": "user-abc-123",
199227
"healthy": true,
200228
"dead": false,
201229
"app": {
@@ -221,6 +249,7 @@ GET /accounts/:apn_id
221249
"data": {
222250
"id": "apn_WYhMlrz",
223251
"name": null,
252+
"external_id": "user-abc-123",
224253
"healthy": true,
225254
"dead": false,
226255
"app": {
@@ -245,25 +274,165 @@ GET /accounts/:apn_id
245274
}
246275
```
247276

277+
#### Retrieve account details for a specific external user
278+
279+
Retrieve the account details for a specific account based on the external user ID
280+
281+
```
282+
GET /users/:external_id/accounts
283+
```
284+
- `:external_id` is the end user's ID in the Connect Partner's system
285+
- Optionally include `?include_credentials=1` as a query-string parameter to include the account credentials in the response
286+
287+
##### Example response (without account credentials)
288+
289+
```json
290+
[
291+
{
292+
"id": "apn_WYhM5ov",
293+
"name": null,
294+
"external_id": "user-abc-123",
295+
"healthy": true,
296+
"dead": false,
297+
"app": {
298+
"id": "oa_aw4ib2",
299+
"name_slug": "airtable_oauth",
300+
"name": "Airtable",
301+
"auth_type": "oauth",
302+
"description": "Airtable is a low-code platform to build next-gen apps. Move beyond rigid tools, operationalize your critical data, and reimagine workflows with AI.",
303+
"img_src": "https://assets.pipedream.net/s.v0/app_XBxhAl/logo/orig",
304+
"custom_fields_json": "[]",
305+
"categories": [
306+
"Productivity"
307+
]
308+
},
309+
"created_at": "2024-08-06T21:51:30.000Z",
310+
"updated_at": "2024-08-06T21:51:30.000Z",
311+
"expires_at": "2024-08-06T22:51:30.000Z",
312+
"error": null,
313+
"last_refreshed_at": null,
314+
"next_refresh_at": "2024-08-06T22:04:41.000Z"
315+
},
316+
{
317+
"id": "apn_KAh7JwW",
318+
"name": null,
319+
"external_id": "user-abc-123",
320+
"healthy": true,
321+
"dead": false,
322+
"app": {
323+
"id": "oa_aPXiQd",
324+
"name_slug": "github",
325+
"name": "GitHub",
326+
"auth_type": "oauth",
327+
"description": "Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.",
328+
"img_src": "https://assets.pipedream.net/s.v0/app_OrZhaO/logo/orig",
329+
"custom_fields_json": "[]",
330+
"categories": [
331+
"Developer Tools"
332+
]
333+
},
334+
"created_at": "2024-08-06T21:53:05.000Z",
335+
"updated_at": "2024-08-06T21:53:05.000Z",
336+
"expires_at": null,
337+
"error": null,
338+
"last_refreshed_at": null,
339+
"next_refresh_at": "2024-08-06T22:50:01.000Z"
340+
}
341+
]
342+
```
343+
344+
##### Example Response (with `include_credentials=1`)
345+
346+
```json
347+
[
348+
{
349+
"id": "apn_WYhM5ov",
350+
"name": null,
351+
"external_id": "user-abc-123",
352+
"healthy": true,
353+
"dead": false,
354+
"app": {
355+
"id": "oa_aw4ib2",
356+
"name_slug": "airtable_oauth",
357+
"name": "Airtable",
358+
"auth_type": "oauth",
359+
"description": "Airtable is a low-code platform to build next-gen apps. Move beyond rigid tools, operationalize your critical data, and reimagine workflows with AI.",
360+
"img_src": "https://assets.pipedream.net/s.v0/app_XBxhAl/logo/orig",
361+
"custom_fields_json": "[]",
362+
"categories": [
363+
"Productivity"
364+
]
365+
},
366+
"created_at": "2024-08-06T21:51:30.000Z",
367+
"updated_at": "2024-08-06T21:51:30.000Z",
368+
"credentials": {
369+
"oauth_client_id": "dd7a26ca-ba11-4f80-8667-508364f97c58",
370+
"oauth_access_token": "oaarBssnxxxxxxxxxx.v1.xxxxxxxxxx.xxxxxxxxxx",
371+
"oauth_refresh_token": "oaarBssnxxxxxxxxxx.v1.refresh.xxxxxxxxxx.xxxxxxxxxx",
372+
"oauth_uid": "usrnbIhrdiaOwPf7q"
373+
},
374+
"expires_at": "2024-08-06T22:51:30.000Z",
375+
"error": null,
376+
"last_refreshed_at": null,
377+
"next_refresh_at": "2024-08-06T22:04:41.000Z"
378+
},
379+
{
380+
"id": "apn_KAh7JwW",
381+
"name": null,
382+
"external_id": "user-abc-123",
383+
"healthy": true,
384+
"dead": false,
385+
"app": {
386+
"id": "oa_aPXiQd",
387+
"name_slug": "github",
388+
"name": "GitHub",
389+
"auth_type": "oauth",
390+
"description": "Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.",
391+
"img_src": "https://assets.pipedream.net/s.v0/app_OrZhaO/logo/orig",
392+
"custom_fields_json": "[]",
393+
"categories": [
394+
"Developer Tools"
395+
]
396+
},
397+
"created_at": "2024-08-06T21:53:05.000Z",
398+
"updated_at": "2024-08-06T21:53:05.000Z",
399+
"credentials": {
400+
"oauth_client_id": "57dc28a15xxxxxxxxxx",
401+
"oauth_access_token": "gho_zasPWxxxxxxxxxxxxx",
402+
"oauth_uid": "104484339"
403+
},
404+
"expires_at": null,
405+
"error": null,
406+
"last_refreshed_at": null,
407+
"next_refresh_at": "2024-08-06T22:50:01.000Z"
408+
}
409+
]
410+
```
411+
248412
#### Delete individual connected account
249413
Delete a specific connected account for an end user
250414

251415
```
252416
DELETE /v1/connect/accounts/:apn_id
253417
```
418+
254419
- `:apn_id` is the auth provision of the account you want to retrieve
255420
- We'll return a `204 No Content` response if the account was successfully deleted
256421

257422
#### Delete all connected accounts for a specific app
258423

259-
`/DELETE /apps/:app_id/accounts`
424+
```
425+
/DELETE /apps/:app_id/accounts
426+
```
260427

261428
- `:app_id` can be `oauth_app_id` or `app_id`
262429
- We'll return a `204 No Content` response if the accounts were successfully deleted
263430

264431
#### Delete an end user and all their connected accounts
265432

266-
`DELETE /users/:external_id`
433+
```
434+
DELETE /users/:external_id
435+
```
267436

268437
- `:external_id` corresponds to the the end user's ID in your system
269438
- We'll return a `204 No Content` response if the user was successfully deleted
@@ -273,5 +442,10 @@ DELETE /v1/connect/accounts/:apn_id
273442

274443
- **App**: GitHub, Notion, Slack, Google Sheets, etc. — the API you want to make requests to on behalf of your end user. See our full list here: [https://pipedream.com/apps](https://pipedream.com/apps).
275444
- **Connect Partner**: This is probably you — the Pipedream customer who is developing an application and wants to use Pipedream Connect to make authenticated requests on behalf of their end users.
276-
- **Connected Account**: Read more about connected accounts [here](/connected-accounts) — this is the account connection for your end user.
277-
- **End User**: The customer of the Connect Partner and whose data you want to access on their behalf.
445+
- **Connected Account**: Read more about connected accounts [here](/connected-accounts) — this is the account connection for your end user, and is also referred to as **auth provision**.
446+
- **End User**: The customer of the Connect Partner and whose data you want to access on their behalf (`external_id` in the API).
447+
- **OAuth Client**: The OAuth client you create in Pipedream to connect to an app. Read more about OAuth clients [here](/connected-accounts/oauth-clients).
448+
449+
## Known limitations
450+
- The only apps that work with Pipedream Connect today are apps that use OAuth 2.0 to authenticate, and that do not require any user-input fields during the OAuth flow. We're working on extending support to all integrated apps on Pipedream.
451+
- There is very limited error handling today, but this is top of mind for us and is on the near-term roadmap. If you or your end users encounter any issues, please reach out to us at [[email protected]](mailto:[email protected])

0 commit comments

Comments
 (0)