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.mdx
-15Lines changed: 0 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,21 +47,6 @@ or a specific version:
47
47
48
48
TO DO
49
49
50
-
### Project keys
51
-
52
-
You authenticate to the Connect API using **Basic Auth**. Send your project public key as the username and the project secret key as the password. When you make API requests, pass an
Most of your interactions with the Connect API will happen on the server, to protect API requests and user credentials. You'll use the SDK in [your frontend](#typescript-sdk-browser) to let users connect accounts. Once connected, you'll use the SDK on the server to retrieve credentials, invoke workflows on their behalf, and more.
Copy file name to clipboardExpand all lines: docs-v2/pages/rest-api/auth.mdx
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,46 @@
1
1
# Authentication
2
2
3
-
##Pipedream API Key
3
+
The Pipedream API supports two methods of authentication: [OAuth](#oauth) and [User API keys](#user-api-keys).
4
4
5
-
When you sign up for Pipedream, an API key is automatically generated for your account. You can use this key to authorize requests to the API.
5
+
**We recommend OAuth** for a few reasons:
6
+
7
+
✅ OAuth clients are tied to the workspace, administered by workspace admins <br />
8
+
✅ Tokens are short-lived <br />
9
+
✅ OAuth clients support scopes, limiting access to specific operations <br />
10
+
11
+
When testing the API or using the CLI, you can use your user API key. This key is tied to your user account and provides full access to any resources your user has access to, across workspaces.
12
+
13
+
## OAuth
14
+
15
+
Workspace administrators can create OAuth applications in your workspace's [API settings](https://pipedream.com/settings/api).
16
+
17
+
Since API requests are meant to be made server-side, and since grants are not tied to individual end users, all OAuth clients are [**Client Credentials** applications](#how-client-credentials-apps-work).
18
+
19
+
### Creating an OAuth application
20
+
21
+
1. Visit your workspace's [API settings](https://pipedream.com/settings/api).
22
+
2. Click the **New OAuth App** button.
23
+
3. Name your app and click **Create**.
24
+
4. Copy the app's client secret. **It will not be accessible again**. Click **Close**.
25
+
5. Copy the app's client ID from the list of OAuth applications.
26
+
27
+
### How client credentials apps work
28
+
29
+
## User API keys
30
+
31
+
When you sign up for Pipedream, an API key is automatically generated for your user account. You can use this key to authorize requests to the API.
6
32
7
33
You'll find this API key in your [User Settings](https://pipedream.com/user) (**My Account** -> **API Key**).
8
34
9
35
## Authorizing API requests
10
36
11
-
Pipedream uses [Bearer Authentication](https://oauth.net/2/bearer-tokens/) to authorize your access to the API or SSE event streams. When you make API requests, pass an `Authorization` header of the following format:
37
+
Whether you use OAuth access tokens or user API keys, Pipedream uses [Bearer Authentication](https://oauth.net/2/bearer-tokens/) to authorize your access to the API or SSE event streams. When you make API requests, pass an `Authorization` header of the following format:
Copy file name to clipboardExpand all lines: docs-v2/pages/rest-api/index.mdx
+26-67Lines changed: 26 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,35 +4,28 @@ import Callout from "@/components/Callout";
4
4
5
5
## Overview
6
6
7
-
Use the REST API to create and manage sources, workflows, subscriptions, and more.
7
+
Use the REST API to create workflows, manage event sources, handle subscriptions, and more.
8
8
9
9
## Base URL
10
10
11
11
The base URL for all requests is [https://api.pipedream.com/v1](https://api.pipedream.com/v1).
12
12
13
13
## Authentication
14
14
15
-
You authenticate to the REST API using your [Pipedream API
16
-
key](/rest-api/auth/#pipedream-api-key). When you make API requests, pass an
17
-
`Authorization` header of the following format:
15
+
The Pipedream API supports two methods of authentication: [OAuth](/rest-api/auth#oauth) and [User API keys](/rest-api/auth#user-api-keys).
18
16
19
-
```
20
-
Authorization: Bearer <api key>
21
-
```
22
-
23
-
For example, here's how you can use `cURL` to fetch profile information for the
24
-
authenticated user:
17
+
All credentials are passed as a Bearer token in the `Authorization` header. For example:
25
18
26
19
```shell
27
-
curl 'https://api.pipedream.com/v1/users/me' \
28
-
-H 'Authorization: Bearer <api_key>'
20
+
curl https://api.pipedream.com/v1/accounts
21
+
-H "Authorization Bearer <token>"
29
22
```
30
23
31
-
Learn more about [API authentication](/rest-api/auth/)
24
+
Learn more in the [Authentication docs](/rest-api/auth/).
32
25
33
26
## Required headers
34
27
35
-
The `Authorization` header is required on all endpoints for authentication.
28
+
The `Authorization` header is required on all endpoints, to authenticate API requests.
36
29
37
30
`POST` or `PUT` requests that accept JSON payloads also require a `Content-Type`
38
31
header set to `application/json`. For example:
@@ -70,25 +63,18 @@ including all fields). Pass as a string of comma-separated values:
70
63
71
64
---
72
65
73
-
`workspace_id`**string**
74
-
75
-
Some endpoints require you to specify [your workspace ID](/workspaces/#finding-your-workspace-s-id) you want the operation to take effect in. For example, if you're creating a new event source in a specific workspace, you'll want to pass the workspace ID in the `workspace_id` query string parameter.
76
-
77
-
[Find your workspace's ID here](/workspaces/#finding-your-workspace-s-id).
78
-
79
-
<Callouttype="info">
80
-
If your organization is on one of our legacy plans like the Free Teams or
81
-
Teams plan, the `workspace_id` is synonymous with your `org_id`. Just pass
82
-
your organization ID as the same parameter.
66
+
<Callout>
67
+
The `workspace_id` parameter is only required when using [User API keys](/rest-api/auth#user-api-keys). When authenticating with OAuth tokens, the API will automatically use the workspace associated with the token.
83
68
</Callout>
84
69
85
-
## Working with resources owned by a workspace
70
+
`workspace_id`**string**
71
+
72
+
When using [User API keys](/rest-api/auth#user-api-keys), some endpoints require you to specify [your workspace ID](/workspaces/#finding-your-workspace-s-id) you want the operation to take effect in:
86
73
87
-
If you're interacting with resources owned by a [workspace](/workspaces/), you may need to specify the workspace ID as a part of the request's query string parameter or route:
74
+
- When _fetching_ specific resources (for example, when you [retrieve events for a specific source](#get-source-events)), **you should not need to pass your workspace's ID**. If your user is a part of the workspace, and you have access to that resource, and the API will return the details of the resource.
75
+
- When _creating_ new resources, you'll need to specify the `workspace_id` in which you want to create the resource.
88
76
89
-
- When fetching specific resources (for example, when you [retrieve events for a specific source](#get-source-events)), you should not need to pass your workspace's ID. If your user is a part of the workspace, you should have access to that resource, and the API will return the details of the resource.
90
-
- When _creating_ new resources, you'll need to specify the `org_id` where you want the resource to live as a query string parameter (`?org_id=o_abc123`). Read more about the `org_id` parameter in the [Common Parameters section](#common-parameters).
91
-
- When _listing_ resources, use [the workspace-specific endpoints here](#workspaces).
77
+
[Find your workspace's ID here](/workspaces/#finding-your-workspace-s-id).
92
78
93
79
## Pagination
94
80
@@ -165,9 +151,11 @@ The response from the request above will have a shape that looks like:
165
151
## Errors
166
152
167
153
Pipedream uses conventional HTTP response codes to indicate the success or
168
-
failure of an API request. Codes in the **2xx** range indicate success. Codes in
169
-
the **4xx** range indicate an error that failed (e.g., a required parameter was
170
-
omitted). Codes in the **5xx** range indicate an error with Pipedream’s server.
154
+
failure of an API request:
155
+
156
+
- Codes in the `2xx` range indicate success.
157
+
- Codes in the `4xx` range indicate an error that failed (e.g., a required parameter was omitted).
158
+
- Codes in the `5xx` range indicate an error with Pipedream's server.
[Pipedream Connect](/connect) is the easiest way for your users to connect to [over {process.env.PUBLIC_APPS}+ APIs](https://pipedream.com/apps), **right in your product**. You can build in-app messaging, CRM syncs, AI-driven products, [and much more](/connect/use-cases), all in a few minutes. Visit [the quickstart](/connect/quickstart) to build your first integration.
485
+
486
+
Read more about the Connect API in the [Connect API docs](/connect/api/).
487
+
494
488
## Events
495
489
496
490
### Get Source Events
@@ -609,41 +603,6 @@ curl -X DELETE \
609
603
Deletion happens asynchronously, so you'll receive a `202 Accepted` HTTP status
610
604
code in response to any deletion requests.
611
605
612
-
### List Projects
613
-
614
-
Programmatically list the workspace's projects.
615
-
616
-
#### Endpoint
617
-
618
-
```
619
-
GET /v1/workspaces/<workspace_id>/projects
620
-
```
621
-
622
-
#### Path Parameters
623
-
624
-
`workspaces_id`**string**
625
-
626
-
[Switch to your workspace's context](/workspaces/#switching-between-workspaces) and [find your org's ID](/workspaces/#finding-your-workspace-s-id).
627
-
628
-
#### Example Responses
629
-
630
-
```
631
-
"data": [
632
-
{
633
-
"id": "proj_kYRs18",
634
-
"hid": "proj_kYRs18",
635
-
"name": "Sample Project",
636
-
"repository_id": null,
637
-
"repository_path": null,
638
-
"created_at": "2024-02-05T21:47:24.000Z",
639
-
"updated_at": "2024-02-06T16:13:07.000Z",
640
-
"org_id": 1,
641
-
"exceptions": null,
642
-
"allow_support": false
643
-
}
644
-
]
645
-
```
646
-
647
606
## Sources
648
607
649
608
Event sources run code to collect events from an API, or receive events via
0 commit comments