I’m building a Zapier integration that uses OAuth2 authentication. The auth test returns user data that I need to access in my other API endpoints. When the authentication test runs, it gives me back something like this:
{
"username": "John Doe",
"companyId": 45
}
I need to use the companyId value when making calls to other API methods in my integration. I tried adding it to the bundle.inputData but that approach didn’t work. What’s the correct way to pass authentication response data to other parts of my Zapier app?
The authentication response gets stored in bundle.authData automatically after your auth test succeeds. I ran into this exact issue when building my first Zapier integration last year. Make sure your authentication configuration’s test function returns the data you need, then reference it using bundle.authData.companyId in your trigger and action methods. One thing that caught me off guard initially was that this data persists across all API calls for that connected account, so you don’t need to worry about re-fetching it. Just double-check that your auth test is actually returning the companyId field correctly before trying to access it elsewhere.
you need to access it through bundle.authData instead of inputData. zapier automatically stores your auth test response there so you can grab companyId like bundle.authData.companyId in your other api calls. works like a charm once you know where to look!
I had this same confusion when I started with Zapier development. The key thing to understand is that whatever your authentication test function returns becomes available throughout your entire app via bundle.authData. So in your case, after authentication succeeds, you can access bundle.authData.companyId in any trigger, action, or search method. Just make sure your auth test is structured to return all the data you’ll need later - I learned the hard way that you can’t easily modify what gets stored in authData after the fact without having users reconnect their accounts. Also worth noting that this data is tied to each individual connection, so different users will have their own companyId values stored separately.