cURL
curl --request POST \
--url https://api.pipedream.com/v1/oauth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>",
"scope": "<string>"
}
'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"
});
await client.oauthTokens.create({
clientId: "client_id",
clientSecret: "client_secret"
});
from pipedream import Pipedream
client = Pipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
client.oauth_tokens.create(
client_id="client_id",
client_secret="client_secret",
)
package com.example.usage;
import com.pipedream.api.BaseClient;
import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts;
public class Example {
public static void main(String[] args) {
BaseClient client = BaseClient.withCredentials("<clientId>", "<clientSecret>")
.build()
;
client.oauthTokens().create(
CreateOAuthTokenOpts
.builder()
.clientId("client_id")
.clientSecret("client_secret")
.build()
);
}
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pipedream.com/v1/oauth/token"
payload := strings.NewReader("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scope\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123
}{
"error": "Throttled"
}Generate OAuth Token
Learn how to generate an OAuth access token to authenticate requests to the Pipedream API
POST
/
v1
/
oauth
/
token
cURL
curl --request POST \
--url https://api.pipedream.com/v1/oauth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>",
"scope": "<string>"
}
'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"
});
await client.oauthTokens.create({
clientId: "client_id",
clientSecret: "client_secret"
});
from pipedream import Pipedream
client = Pipedream(
project_id="YOUR_PROJECT_ID",
client_id="YOUR_CLIENT_ID",
client_secret="YOUR_CLIENT_SECRET",
)
client.oauth_tokens.create(
client_id="client_id",
client_secret="client_secret",
)
package com.example.usage;
import com.pipedream.api.BaseClient;
import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts;
public class Example {
public static void main(String[] args) {
BaseClient client = BaseClient.withCredentials("<clientId>", "<clientSecret>")
.build()
;
client.oauthTokens().create(
CreateOAuthTokenOpts
.builder()
.clientId("client_id")
.clientSecret("client_secret")
.build()
);
}
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pipedream.com/v1/oauth/token"
payload := strings.NewReader("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"scope\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123
}{
"error": "Throttled"
}If using one of the available SDKs in TypeScript, Python, or Java, the OAuth access token is automatically generated (and refreshed) for you when you initialize the client.
- Visit the API settings for your Pipedream workspace.
- Click the New OAuth Client button.
- Name your client and click Create.
- Copy the client secret. It will not be accessible again. Click Close.
- Copy the client ID from the list.
Read more in the Authentication section.
OAuth scopes
You can optionally specify ascope parameter in the request body to limit the access token to specific operations. The scope parameter accepts a space-separated list of scopes.
If no scope is specified, the token defaults to * (full access).
Example request with scopes:
curl -X POST https://api.pipedream.com/v1/oauth/token \
-H 'Content-Type: application/json' \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"scope": "connect:accounts:read connect:accounts:write"
}'
View the full list of available scopes in the Authentication section.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?