Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 36 ยท Zaps, Triggers and Actions

Connections and Authentication: OAuth, API Keys and Safety

Understand how Zapier connects to apps: OAuth consent, API keys, permissions and scopes, shared versus personal connections, expiry, and security habits, with a runnable OAuth stand-in.

Every Zap acts as someone inside the apps it touches. The connection is that identity: a saved, authorized login. Getting connections right prevents the most common failures (expired logins) and the most serious risks (over-permissioned or leaked access).

Zapier cannot run on this site. We describe how connecting works in words. The Python blocks are stand-ins that model OAuth and key handling; they never contact a real service, and you should never paste real secrets into any tutorial code.

What a connection is

When you add a step for an app you choose an account, and the first time you click "Connect". Zapier opens a sign-in or approval window for that app. Once approved, Zapier stores credentials (usually tokens) so Zaps can act without asking again. Connections are listed in your account under a connections or "My Apps" area, where you can rename, reconnect or remove them.

OAuth: sign in and approve

Most modern apps use OAuth. The idea: you never give Zapier your password. Instead you sign in on the app's own page and approve a list of permissions called scopes. The app then gives Zapier a token limited to those scopes.

sequenceDiagram
  participant U as You
  participant Z as Automation platform
  participant A as App
  U->>Z: Click Connect
  Z->>A: Send me to the app's approval page
  U->>A: Sign in and approve scopes
  A-->>Z: Authorization code
  Z->>A: Exchange for tokens
  A-->>Z: Access token (and refresh token)
  Z->>A: Later: act using the token

You authenticate with the app itself. The platform holds only tokens with the scopes you approved.

Access tokens expire, often within an hour. A refresh token lets the platform get new ones without you. If the refresh token is revoked, expired, or your password changes in some apps, the connection breaks and must be reconnected.

API keys and other methods

Some apps use an API key or token you copy from the app's settings and paste into Zapier. Others use basic credentials or a custom form. Treat these like passwords:

  • Create a key just for Zapier, named so you can recognize it.
  • Give it the least permissions the app allows.
  • Never share keys in chat, documents or screenshots.
  • Rotate keys regularly, and revoke them if a teammate leaves.

Whose identity does a Zap use?

A connection belongs to the person who made it (or to a shared account). Actions then appear in the app as that person, for example "Created by Dana". Consequences:

  • If Dana leaves and her account is closed, every Zap using her connection breaks.
  • Dana's permissions limit the Zap. If she cannot see a folder, neither can the Zap.
  • Audit logs in the target app show Dana, not "Zapier".

For important automations use a dedicated service account (a shared automation user, not a person), with only needed permissions, and, on team plans, shared connections managed by admins. Governance practices appear in the chapter on governance.

Permissions and the least-privilege rule

Approve only what an automation needs. A Zap that adds rows to one spreadsheet should not hold access to your whole drive. When an app offers read-only versus read-write scopes, choose read-only for triggers that never change data. When the approval screen lists many scopes, take a moment: you are granting an automated system those powers.

A tiny OAuth model

The stand-in below models tokens with expiry and refresh. Use it to see why connections "just work" for a while and then need attention. The numbers are fake and no network is involved.

Python Stand-in: access tokens, expiry and refresh

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Scopes in practice

A scope check is conceptually simple: the token has a set of allowed operations, and each request is compared against it. The stand-in below shows why a read-only token cannot create rows.

Python Stand-in: scopes decide what a token may do

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Fixing broken connections

When a Zap errors with "authentication failed" or "token expired":

  1. Open Connections and look for a warning on that account.
  2. Click Reconnect and sign in again.
  3. Replay the failed runs (history lesson).
  4. If it breaks repeatedly, check password-change policies, shared-login limits, or admin rules that revoke tokens.

Security habits

  • Use two-factor authentication on your Zapier account.
  • Review your connections list every few months and remove unused ones.
  • Prefer service accounts for production automations.
  • Be careful with sensitive data in logs: Zap History stores step data for a period. Avoid sending secrets or unneeded personal data through steps.
  • Ask: should this Zap handle personal data at all, and where does that data go?

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main benefit of OAuth?

    OAuth lets you sign in on the app and grant scoped access through tokens.
  2. 2. Dana's connection powers an important Zap and Dana leaves. What is likely?

    Connections belong to an identity; use shared or service accounts for key automations.
  3. 3. What does least privilege mean for connections?

    Limiting scopes reduces the harm if something goes wrong.
  4. 4. A refresh token is revoked. What happens?

    Without a valid refresh token the platform cannot renew access tokens.

Summary

  • A connection is the identity a Zap uses; OAuth grants scoped tokens without sharing passwords.
  • API keys are secrets: dedicate, restrict, protect and rotate them.
  • Connections belong to a person or service account; plan for people leaving.
  • Approve least privilege, enable two-factor authentication, and prune unused connections.
  • Fix expired connections by reconnecting, then replay failed runs.

Next: Filters: Only Continue If