Skip to main content
The Pipedream Connect API supports two authentication methods:
  1. OAuth access tokens: Server-side authentication using client credentials
  2. Connect tokens: Client-side authentication using short-lived tokens scoped to individual end users
Both approaches support scopes to limit access to specific operations.

OAuth Access Tokens

OAuth access tokens are used for server-side API requests. They’re generated using the client credentials flow and expire after 1 hour. Why OAuth? ✅ OAuth clients are tied to the Pipedream workspace and administered by workspace admins
✅ Tokens are short-lived
✅ OAuth access tokens support scopes, limiting access to specific operations
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.

Creating an OAuth client

Each OAuth client authenticates one of two ways, chosen when you create it in the Pipedream UI:
  • Client secret: Pipedream generates a secret that your server sends to get access tokens. The steps below create this kind of client.
  • Public key: your server signs short-lived JWTs with a private key that never leaves your infrastructure, and no shared secret exists. See Private key JWT.
  1. Visit the API settings for your Pipedream workspace
  2. Click the New OAuth Client button
  3. Name your client and click Create
  4. Copy the client ID and secret (the secret will not be accessible again)

How to get an access token

In the client credentials model, you exchange your OAuth client ID and secret for an access token. Then you use the access token to make API requests. Pipedream offers TypeScript, Python, and Java SDKs, which abstract the process of generating and refreshing fresh access tokens.
You can also manage this token refresh process yourself, using the /oauth/token API endpoint:
The scope parameter is optional and accepts a space-separated list of scopes. If omitted, the token defaults to * (full access). Access tokens expire after 1 hour. Store access tokens securely in your server.

Private key JWT

Instead of a client secret, an OAuth client can authenticate with a public key. You register the public key with Pipedream and keep the private key. To get an access token, your server signs a short-lived JWT (a client assertion) with the private key and sends it to the token endpoint. Pipedream verifies the signature against the registered public key and returns the same access token as for a client secret. This is the private_key_jwt client authentication method defined in RFC 7523, so most OAuth libraries support it. Why use a public key? ✅ No shared secret exists, so nothing reusable is stored by Pipedream or sent over the network
✅ The private key can stay in a key management service or HSM
✅ Keys can be rotated without downtime
A client’s authentication method is fixed when you create it. To move an integration from a client secret to a public key, create a new public-key client and switch your app to its client ID.

Create a public-key client

1

Generate a key pair

Generate an EC P-256 key pair (recommended) or an RSA key pair. Keep private.pem secret, for example in your secrets manager.
2

Create the client

In the Pipedream UI, open Settings → API (or a project’s Configuration → API) and click New API client. Name the client, choose Public key, paste the contents of public.pem (or the public key as a JWK), and click Create.
3

Copy the client ID

Copy the Client ID. There is no client secret.
Supported keys Upload the key as a PEM public key (-----BEGIN PUBLIC KEY-----) or as a single public JWK. Pipedream rejects private keys. If you paste one by mistake, treat it as exposed and generate a new key pair. Each key is assigned a key ID (kid), shown in Manage keys. If you upload a JWK with a kid, Pipedream keeps it; otherwise the key ID is the key’s RFC 7638 thumbprint.

Authenticate with the SDKs

The TypeScript (3.2.0 and later), Python (2.2.0 and later), and Java (2.2.0 and later) SDKs sign client assertions for you. Pass your private key instead of a client secret, and the SDK handles the rest:
  • it signs a short-lived assertion for every token request
  • it sets the claims, including the audience
  • it requests, caches, and refreshes the access token, the same way it does for client secrets
  • The private key: pass the contents of private.pem, or the private key as a JWK. The SDK picks ES256 or RS256 from the key type. The Java SDK needs an unencrypted PKCS#8 PEM (-----BEGIN PRIVATE KEY-----), which the openssl commands above produce, or a JWK.
  • Python: install the private-key extra, which adds the libraries used for signing.
  • Environment variables: each SDK also reads the key from PIPEDREAM_PRIVATE_KEY, alongside PIPEDREAM_CLIENT_ID.
  • Optional key ID: set keyId (key_id in Python) or PIPEDREAM_KEY_ID to send the key ID from Manage keys as the assertion’s kid. It’s useful during key rotation and for debugging, but not required.
  • One credential at a time: a client uses either a client secret or a private key. Passing both is an error.

Sign a client assertion yourself

If you’re not using an SDK, sign the client assertion yourself. You need these values: The client assertion is a JWT signed with your private key: Pipedream allows 30 seconds of clock skew.
Sign a new assertion for every token request, including retries. An assertion is rejected if its jti has already been used.

Request an access token

Send the assertion to the token endpoint with client_assertion_type set to urn:ietf:params:oauth:client-assertion-type:jwt-bearer. Don’t send a client_secret or an Authorization header with it.
The endpoint accepts form-encoded or JSON bodies. The response, the scope parameter, and the resulting access token work exactly as they do for a client secret. These examples sign an assertion and request an access token without an SDK:
Access tokens expire after 1 hour, so cache the token and request a new one before it expires. Configuring OAuth libraries Libraries that support private_key_jwt work with Pipedream, but some default the aud claim to the token endpoint URL, which Pipedream rejects. Set the audience to https://api.pipedream.com:
  • Authlib (Python): PrivateKeyJWT uses its first argument as aud, so register PrivateKeyJWT("https://api.pipedream.com") and still call fetch_token("https://api.pipedream.com/v1/oauth/token"). For an EC key, pass alg="ES256" and give the session a joserfc.jwk.ECKey as its client_secret. A PEM string works only for RSA keys. Authlib’s default assertion lifetime of 1 hour is accepted.
  • Spring Security: use a jwtClientAssertionCustomizer to set the aud claim.

Rotate keys

A client can have up to two public keys at once, so you can rotate without downtime:
  1. Generate a new key pair.
  2. In the client’s … menu, click Manage keys, paste the new public key, and click Add key.
  3. Deploy your app with the new private key. Set kid in the assertion header to the new key’s ID.
  4. Once Last used for the old key stops updating, remove the old key.
A client always keeps at least one key. Last used is updated at most every 10 minutes.

Errors

OAuth scopes

OAuth access tokens support scopes to limit access to specific operations. When creating an access token, you can optionally specify a space-separated list of scopes. If no scope is specified, the token defaults to * (full access). Available scopes:
The table above is the complete list of scopes, and each scope must be requested exactly as written. There are no other :read / :write variants — for example, connect:apps:read is not a valid scope, so use connect:apps:* to grant access to the List apps and List app categories endpoints.Requesting an unrecognized scope fails with an invalid_scope error when you request the access token, not when you call the endpoint.

Revoking a client secret

Public-key clients have no secret. To replace a public key, see Rotate keys.
  1. Visit your workspace’s API settings
  2. Click the … button to the right of the OAuth client whose secret you want to revoke, then click Rotate client secret
  3. Copy the new client secret (it will not be accessible again)

OAuth security

See the OAuth section of the security docs for more information on how Pipedream secures OAuth credentials.

Connect Tokens

Connect tokens are short-lived tokens that enable you to securely make client-side requests on behalf of end users. They’re created server-side and passed to your frontend to authenticate requests.

Creating a Connect token

Use the Create Connect token endpoint to generate a token for an external user:

Connect token TTL

Connect tokens have a customizable time-to-live (TTL):
  • Minimum: 1 second
  • Maximum: 14,400 seconds (4 hours)
  • Default: 14,400 seconds (4 hours)
Specify the TTL using the expires_in parameter (in seconds) when creating a token.

Connect token scopes

Connect tokens support a subset of the OAuth scopes. Because Connect tokens are used client-side, they can only be granted scopes for the endpoints your end users call directly from the browser. When creating a Connect token, you can optionally specify a space-separated list of scopes. If no scope is specified, the token defaults to connect:* (full access to all Connect API endpoints available to Connect tokens). Available scopes:
Connect tokens cannot be granted the * scope. The maximum scope available is connect:*.The following scopes are available to OAuth access tokens only, and requesting any of them when creating a Connect token returns a 400 error: connect:projects:read, connect:projects:write, connect:tokens:create, connect:usage:read, connect:users:read, connect:users:write, and connect:workflow:invoke.