Gusto

Gusto API Authentication

How Toku authenticates with the Gusto API using OAuth 2.0 and granular scopes

Toku connects to Gusto as an authorized application using Gusto's OAuth 2.0 flow. Your Gusto admin signs in once to authorize the connection — no API keys are copied or stored by your team.

OAuth 2.0 Flow#

  1. Authorize

    From the Toku dashboard, your admin is redirected to Gusto's consent screen, which lists every scope Toku requests.

  2. Exchange

    Gusto redirects back with an authorization code, which Toku's backend exchanges for an access token and refresh token.

  3. Refresh

    Access tokens are short-lived. Toku rotates them automatically using the refresh token — the connection stays live without re-authorization.

# Token exchange (performed by Toku's backend)
curl -X POST https://api.gusto.com/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "<toku_client_id>",
    "client_secret": "<toku_client_secret>",
    "code": "<authorization_code>",
    "grant_type": "authorization_code"
  }'

Authenticated requests carry the token as a bearer header and pin a dated API version:

curl https://api.gusto.com/v1/companies/<company_id>/employees \
  -H "Authorization: Bearer <access_token>"

Scopes#

Gusto enforces granular, per-resource scopes. Toku requests the minimum set needed for stablecoin payroll:

ScopeAccessUsed for
companies:readReadCompany and pay schedule details
employees:readReadEmployee roster sync and matching
payrolls:readReadPay period and payroll status sync
garnishments:readReadVerifying the Toku deduction each cycle
garnishments:writeWriteApplying the Toku deduction

Any call outside these scopes is rejected by Gusto. You can revoke Toku's authorization at any time from your Gusto account, which immediately invalidates all tokens.

Environments#

EnvironmentBase URL
Productionhttps://api.gusto.com
Demo (used during implementation testing)https://api.gusto-demo.com

Toku is integrated through the Gusto Developer Portal partner process, including Gusto's security review. See Gusto's API documentation to validate any of the calls referenced in this section.

Next#

Was this page helpful? Suggest edits