Why am I encountering different errors for various app requests using both SDK and direct API calls in Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

I’m getting different errors for different app requests. I tried both SDK and direct API calls, same errors.

All Requests Called using: (TS SDK)

export const pipedreamClient = createBackendClient({
  environment: (NEXT_PUBLIC_ENV) as ProjectEnvironment,
  projectId: PIPEDREAM_PROJECT_ID as string,
  credentials: {
    clientId: PIPEDREAM_CLIENT_ID as string,
    clientSecret: PIPEDREAM_CLIENT_SECRET as string,
  },
});

const resp = await pipedreamClient.runAction({
        externalUserId: userSession.publicId,
        actionId: actionId,
        configuredProps
      });

Google Docs:



Logs:
runPipedreamAction configuredProps {
 "externalUserId": "1758491399752-f4aad898-d03e-40ad-aa31-df34c14b970d",
 "actionId": "google_docs-create-document",
 "configuredProps": {
  "title": "New Document",
  "googleDocs": {
   "authProvisionId": "apn_nphYAWb"
  }
 }
}


ERROR:
runPipedreamAction resp {
 "os": [
  {
   "ts": 1759019266204,
   "k": "error",
   "err": {
    "name": "Error",
    "message": "No access, refresh token, API key or refresh handler callback is set.",
    "stack": "Error: No access, refresh token, API key or refresh handler callback is set.\n  at OAuth2Client.getRequestMetadataAsync (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/google-auth-library@10.3.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:346:19)\n  at OAuth2Client.requestAsync (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/google-auth-library@10.3.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:457:34)\n  at OAuth2Client.request (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/google-auth-library@10.3.0/node_modules/google-auth-library/build/src/auth/oauth2client.js:452:25)\n  at createAPIRequestAsync (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/googleapis-common@8.0.0/node_modules/googleapis-common/build/src/apirequest.js:308:42)\n  at createAPIRequest (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/googleapis-common@8.0.0/node_modules/googleapis-common/build/src/apirequest.js:53:16)\n  at Resource$Documents.create (/tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/node_modules/.pnpm/@googleapis+docs@6.0.0/node_modules/@googleapis/docs/v1.ts:3831:32)\n  at Object.createEmptyDoc (file:///tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/code/google_docs.app.mjs:129:64)\n  at Object.run (file:///tmp/__pdg__/dist/code/da0684a46d1cebe1436841358e32125ed53a838c6bea248d71e79b81f6f8bbc1/code/actions/create-document/create-document.mjs:33:50)\n  at file:///var/task/component_maker.mjs:170:42\n  at async captureObservations (/var/task/node_modules/@lambda-v2/component-runtime/src/captureObservations.js:28:5)"
   }
  }
 ],
 "exports": {},
 "t": {
  "ar": 1759019261928,
  "br": 1759019262014,
  "bp": 1759019262014,
  "bls": 1759019262014,
  "ble": 1759019266239
 }
}

Spotify and Linkedin:

API LOGS
runPipedreamAction configuredProps {
 "externalUserId": "1758491399752-f4aad898-d03e-40ad-aa31-df34c14b970d",
 "actionId": "spotify-create-playlist",
 "configuredProps": {
  "name": "Techno Vibes",
  "description": "A playlist of popular techno tracks.",
  "isPublic": "true",
  "spotify": {
   "authProvisionId": "apn_EOhQEav"
  }
 }
}

runPipedreamAction configuredProps {
  "externalUserId": "1758491399752-f4aad898-d03e-40ad-aa31-df34c14b970d",
  "actionId": "linkedin-search-organization",
  "configuredProps": {
    "searchBy": "vanityName",
    "searchTerm": "ECSITE",
    "linkedin": {
      "authProvisionId": "apn_KAhXxVB"
    }
  }
}


ERROR:

runPipedreamAction resp {
 "os": [
  {
   "k": "console.log",
   "msg": "[debug] err.response {\n \"status\": 401,\n \"statusText\": \"Unauthorized\",\n \"headers\": {\n  \"www-authenticate\": \"Bearer realm=\\\"spotify\\\", error=\\\"invalid_token\\\", error_description=\\\"Invalid access token\\\"\",\n  \"access-control-allow-origin\": \"**\",\n  \"access-control-allow-headers\": \"Accept, App-Platform, Authorization, Content-Type, Origin, Retry-After, Spotify-App-Version, X-Cloud-Trace-Context, client-token, content-access-token\",\n  \"access-control-allow-methods\": \"GET, POST, OPTIONS, PUT, DELETE, PATCH\",\n  \"access-control-allow-credentials\": \"true\",\n  \"access-control-max-age\": \"604800\",\n  \"content-type\": \"application/json\",\n  \"strict-transport-security\": \"max-age=31536000\",\n  \"x-content-type-options\": \"nosniff\",\n  \"alt-svc\": \"h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000, h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000\",\n  \"date\": \"Sun, 28 Sep 2025 00:31:04 GMT\",\n  \"server\": \"envoy\",\n  \"via\": \"HTTP/2 edgeproxy, 1.1 google\",\n  \"transfer-encoding\": \"chunked\"\n },\n \"config\": {\n  \"transitional\": {\n   \"silentJSONParsing\": true,\n   \"forcedJSONParsing\": true,\n   \"clarifyTimeoutError\": false\n  },\n  \"adapter\": [\n   \"xhr\",\n   \"http\",\n   \"fetch\"\n  ],\n  \"transformRequest\": [\n   null\n  ],\n  \"transformResponse\": [\n   null\n  ],\n  \"timeout\": 0,\n  \"xsrfCookieName\": \"XSRF-TOKEN\",\n  \"xsrfHeaderName\": \"X-XSRF-TOKEN\",\n  \"maxContentLength\": -1,\n  \"maxBodyLength\": -1,\n  \"env\": {},\n  \"headers\": {\n   \"Accept\": \"application/json, text/plain, **/**\",\n   \"Content-Type\": \"application/json\",\n   \"Authorization\": \"Bearer undefined\",\n   \"User-Agent\": \"axios/1.12.2\",\n   \"Content-Length\": \"92\",\n   \"Accept-Encoding\": \"gzip, compress, deflate, br\"\n  },\n  \"method\": \"post\",\n  \"path\": \"/users/undefined/playlists\",\n  \"data\": \"{\\\"name\\\":\\\"Techno Vibes\\\",\\\"description\\\":\\\"A playlist of popular techno tracks.\\\",\\\"public\\\":\\\"true\\\"}\",\n  \"url\": \"https://api.spotify.com/v1/users/undefined/playlists\",\n  \"allowAbsoluteUrls\": true\n },\n \"data\": {\n  \"error\": {\n   \"status\": 401,\n   \"message\": \"Invalid access token\"\n  }\n }\n}",
   "ts": 1759019464801
  },
  {
   "ts": 1759019464805,
   "k": "error",
   "err": {
    "message": "{\"error\":{\"status\":401,\"message\":\"Invalid access token\"}}",
    "name": "AxiosError - Request failed with status code 401",
    "code": "ERR_BAD_REQUEST",
    "config": {
     "transitional": {
      "silentJSONParsing": true,
      "forcedJSONParsing": true,
      "clarifyTimeoutError": false
     },
     "adapter": [
      "xhr",
      "http",
      "fetch"
     ],
     "transformRequest": [],
     "transformResponse": [],
     "timeout": 0,
     "xsrfCookieName": "XSRF-TOKEN",
     "xsrfHeaderName": "X-XSRF-TOKEN",
     "maxContentLength": -1,
     "maxBodyLength": -1,
     "env": {},
     "headers": {
      "Accept": "application/json, text/plain, **/*",
      "Content-Type": "application/json",
      "Authorization": "Bearer undefined",
      "User-Agent": "axios/1.12.2",
      "Content-Length": "92",
      "Accept-Encoding": "gzip, compress, deflate, br"
     },
     "method": "post",
     "path": "/users/undefined/playlists",
     "data": "{\"name\":\"Techno Vibes\",\"description\":\"A playlist of popular techno tracks.\",\"public\":\"true\"}",
     "url": "https://api.spotify.com/v1/users/undefined/playlists",
     "allowAbsoluteUrls": true
    },

If I run:

const account = await pipedreamClient.getAccountById(
       accountId, 
        { include_credentials: true }
    );

It works fine and shows everything as healthy

Can you try running both in the SDK playground and comparing the payloads against yours?

The structure of the request seems correct, I also tried switching the externalUserId and the authProvisionId from the example with my implementation and I still got the same error. The example you provided is all frontend, the backend is only been used to generate the temporal token.

configuredProps {
“externalUserId”: “1758491399752-f4aad898-d03e-40ad-aa31-df34c14b970d”,
“actionId”: “google_docs-create-document”,
“configuredProps”: {
“title”: “New Document”,
“googleDocs”: {
“authProvisionId”: “apn_nphYAWb”
}
}
}

//PUBLIC
{
externalUserId: “demo-ced65ca4-79ac-4c01-9a4e-40c451424f41”,
actionId: “google_docs-create-document”,
configuredProps: {
googleDocs: {
authProvisionId: “apn_9whX6xA”
},
title: “New document”
}
}

Are you nesting configuredProps within configuredProps? A little confused about the structure of your payload?

I’m calling like this:
const resp = await pipedreamClient.runAction({
“externalUserId”: “1758491399752-f4aad898-d03e-40ad-aa31-df34c14b970d”,
“actionId”: “google_docs-create-document”,
“configuredProps”: {
“title”: “New Document”,
“googleDocs”: {
“authProvisionId”: “apn_nphYAWb”
}
}
}
);
The previous was just some text from the logs

I upgraded to “@pipedream/connect-react”: “^1.6.0”, still no luck

again the client works because I’m able to run successfully:
const account = await pipedreamClient.getAccountById(
accountId,
{ include_credentials: true }
);

And is the account healthy? (account.healthy === true && account.dead === false)

yeap. I’ll attach the response in a min

runPipedreamAction account {
“id”: “apn_nphYAWb”,
“name”: “jsandler.aol@gmail.com”,
“external_id”: “aCG10ChdgZI9TsdVu3aIkgRS”,
“healthy”: true,
“dead”: null,
“app”: {
“id”: “oa_G7AiAg”,
“name_slug”: “google_docs”,
“name”: “Google Docs”,
“auth_type”: “oauth”,
“description”: “Use Google Docs to create, edit and collaborate on online documents.”,
“img_src”: “https://assets.pipedream.net/s.v0/app_1pbh98/logo/orig”,
“custom_fields_json”: “”,
“categories”: [
“File Storage”
],
“featured_weight”: 5000,
“connect”: {
“allowed_domains”: [
www.googleapis.com”,
docs.googleapis.com
],
“base_proxy_target_url”: “https://www.googleapis.com”,
“proxy_enabled”: true
}
},
“created_at”: “2025-09-27T23:48:34.000Z”,
“updated_at”: “2025-09-28T22:07:48.000Z”
}

I do see that external_id is different than what you’re passing in runAction though, right?

I see, I’m checking this. Thank you I didn’t notice it before. I’ll let you know if this solves the issue

that solved the issue, thank you DannY!

Great, we should figure out how to make the debugging a little easier there.