cURL
curl --request GET \
--url https://api.pipedream.com/v1/connect/{project_id}/accounts \
--header 'Authorization: Bearer <token>' \
--header 'x-pd-environment: <x-pd-environment>'import { PipedreamClient } from "@pipedream/sdk";
const client = new PipedreamClient({
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
projectEnvironment: "YOUR_PROJECT_ENVIRONMENT",
projectId: "YOUR_PROJECT_ID"
});
const pageableResponse = await client.accounts.list({
externalUserId: "external_user_id",
oauthAppId: "oauth_app_id",
after: "after",
before: "before",
limit: 1,
app: "app",
includeCredentials: true
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.accounts.list({
externalUserId: "external_user_id",
oauthAppId: "oauth_app_id",
after: "after",
before: "before",
limit: 1,
app: "app",
includeCredentials: true
});
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
from pipedream import Pipedream
client = Pipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
package com.example.usage;
import com.pipedream.api.BaseClient;
import com.pipedream.api.resources.accounts.requests.AccountsListRequest;
public class Example {
public static void main(String[] args) {
BaseClient client = BaseClient.withCredentials("<clientId>", "<clientSecret>")
.projectId("YOUR_PROJECT_ID")
.build()
;
client.accounts().list(
AccountsListRequest
.builder()
.externalUserId("external_user_id")
.oauthAppId("oauth_app_id")
.after("after")
.before("before")
.limit(1)
.app("app")
.includeCredentials(true)
.build()
);
}
}
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pipedream.com/v1/connect/{project_id}/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-pd-environment", "<x-pd-environment>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"id": "<string>",
"name": "<string>",
"external_id": "<string>",
"healthy": true,
"dead": true,
"app": {
"name_slug": "<string>",
"name": "<string>",
"img_src": "<string>",
"custom_fields_json": "<string>",
"categories": [
"<string>"
],
"scope_profiles": [
{
"name": "read_only",
"scopes": [
"<string>"
]
}
],
"id": "<string>",
"auth_type": "keys",
"description": "<string>",
"featured_weight": 123,
"oauth_app_id": "<string>",
"scopes": [
"<string>"
],
"additional_scopes": [
"<string>"
],
"scope_labels": {
"scopes": "<string>",
"additional_scopes": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"authorized_scopes": [
"<string>"
],
"credentials": {
"oauth_client_id": "<string>",
"oauth_access_token": "<string>",
"oauth_refresh_token": "<string>",
"oauth_uid": "<string>",
"oauth_signer_uri": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"last_refreshed_at": "2023-11-07T05:31:56Z",
"next_refresh_at": "2023-11-07T05:31:56Z"
}
],
"page_info": {
"count": 10,
"total_count": 120,
"start_cursor": "<string>",
"end_cursor": "<string>"
}
}{
"error": "Throttled"
}List accounts
Retrieve all connected accounts for the project with optional filtering
GET
/
v1
/
connect
/
{project_id}
/
accounts
cURL
curl --request GET \
--url https://api.pipedream.com/v1/connect/{project_id}/accounts \
--header 'Authorization: Bearer <token>' \
--header 'x-pd-environment: <x-pd-environment>'import { PipedreamClient } from "@pipedream/sdk";
const client = new PipedreamClient({
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
projectEnvironment: "YOUR_PROJECT_ENVIRONMENT",
projectId: "YOUR_PROJECT_ID"
});
const pageableResponse = await client.accounts.list({
externalUserId: "external_user_id",
oauthAppId: "oauth_app_id",
after: "after",
before: "before",
limit: 1,
app: "app",
includeCredentials: true
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.accounts.list({
externalUserId: "external_user_id",
oauthAppId: "oauth_app_id",
after: "after",
before: "before",
limit: 1,
app: "app",
includeCredentials: true
});
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
from pipedream import Pipedream
client = Pipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
response = client.accounts.list(
external_user_id="external_user_id",
oauth_app_id="oauth_app_id",
after="after",
before="before",
limit=1,
app="app",
include_credentials=True,
)
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
package com.example.usage;
import com.pipedream.api.BaseClient;
import com.pipedream.api.resources.accounts.requests.AccountsListRequest;
public class Example {
public static void main(String[] args) {
BaseClient client = BaseClient.withCredentials("<clientId>", "<clientSecret>")
.projectId("YOUR_PROJECT_ID")
.build()
;
client.accounts().list(
AccountsListRequest
.builder()
.externalUserId("external_user_id")
.oauthAppId("oauth_app_id")
.after("after")
.before("before")
.limit(1)
.app("app")
.includeCredentials(true)
.build()
);
}
}
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pipedream.com/v1/connect/{project_id}/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-pd-environment", "<x-pd-environment>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"id": "<string>",
"name": "<string>",
"external_id": "<string>",
"healthy": true,
"dead": true,
"app": {
"name_slug": "<string>",
"name": "<string>",
"img_src": "<string>",
"custom_fields_json": "<string>",
"categories": [
"<string>"
],
"scope_profiles": [
{
"name": "read_only",
"scopes": [
"<string>"
]
}
],
"id": "<string>",
"auth_type": "keys",
"description": "<string>",
"featured_weight": 123,
"oauth_app_id": "<string>",
"scopes": [
"<string>"
],
"additional_scopes": [
"<string>"
],
"scope_labels": {
"scopes": "<string>",
"additional_scopes": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"authorized_scopes": [
"<string>"
],
"credentials": {
"oauth_client_id": "<string>",
"oauth_access_token": "<string>",
"oauth_refresh_token": "<string>",
"oauth_uid": "<string>",
"oauth_signer_uri": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"last_refreshed_at": "2023-11-07T05:31:56Z",
"next_refresh_at": "2023-11-07T05:31:56Z"
}
],
"page_info": {
"count": 10,
"total_count": 120,
"start_cursor": "<string>",
"end_cursor": "<string>"
}
}{
"error": "Throttled"
}To get the connected accounts for one user, use List user accounts. It is the fastest way to retrieve account details and credentials for one user. It returns up to 100 accounts, and you can filter by app.
To retrieve credentials for OAuth apps (Slack, Google Sheets, etc), the connected account must be using your own OAuth client.
Never return user credentials to the client
Authorizations
ConnectTokenOAuth2
Headers
Path Parameters
Query Parameters
Was this page helpful?

