Documentation Index
Fetch the complete documentation index at: https://gusto-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
system-levelcompany-level
- [Getting company employees](/embedded-payroll/v2025-11-15/reference/get-v1-companies-company_id-employeesget
- Submitting a payroll for a company
System access tokens
Starting with versionv2024-04-01, partner API tokens are deprecated in favor of system access tokens. These tokens improve security and allow you to:
- Manage multiple applications per organization
- Perform system-level actions like creating partner-managed companies and subscribing to webhooks
The token will expire after two hours. Unlike company access tokens, you can request additional system tokens anytime, even if a previous one is still active. Because of this, you don’t need to store the token unless you prefer to reuse it.
grant_type set to system_access.
Company access tokens
To call the API on behalf of a company, you need a company-level access token. You can get one by creating a partner-managed company or going through the in-app authorization code flow when migrating to embedded payroll. When you create a partner-managed company, you’ll receive:Access_tokenRefresh_tokenexpires_in(how many seconds before the token expires)company_uuid
Tokens use URL-safe base64 encoding.
Refreshing access tokens
Access tokens expire after two hours. If expired, API calls will return a401 Unauthorized error.
To refresh a token, send a POST request to the /oauth/token endpoint with:
client_idandclient_secretfrom your applicationrefresh_tokengrant_typeset torefresh_token
Token management tips
Access and refresh token pairs are tied to a resource, typically a company. Here’s an example structure for storing Gusto tokens:
company_uuid: the Gusto company ID. You might link this to your own companies table.access_token_expiration: based on theexpires_invalue. Since the default is 7200 seconds (2 hours), set your expiration check slightly earlier, for example, “expires_in- 60.”
- Confirm the access token needs refreshing by checking if
access_token_expirationis in the past or if a401error was returned - Lock the row for the
company_uuid - Refresh the token
- Update the access and refresh tokens and reset the expiration timestamp
- Unlock the row
- Use the new access token
- Make sure all processes use the most recent token
Payroll fundamentals Postman