Zapier · sdk · fg-0377

Zapier integration never refreshes the OAuth token because the API returns 403 or 400 on expiry

Zaps fail with the API's token expired message until the user reconnects

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

With autoRefresh, platform core throws RefreshAuthError only for a 401 response. Any other status for an expired token is treated as an ordinary error.

Fix

Detect the API's expiry response in afterResponse and throw z.errors.RefreshAuthError yourself.

Apply

const refreshOnExpiry = (response, z) => {
  if (response.status === 403 && /expired/i.test(response.content)) {
    throw new z.errors.RefreshAuthError();
  }
  return response;
};
module.exports = { afterResponse: [refreshOnExpiry] };

Affects: zapier-platform-core with OAuth2 autoRefresh or session auth, as of 2026-10

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp