The Remote API uses the OAuth 2 protocol for authorization. This means every request needs a valid access token for it to succeed. Access is valid for 3600 seconds (one hour).
There are some terms that appear across all the authorization documentation. Check the quick glossary below for term definitions.
This quick glossary is a guide for understanding who and where an operation must take place.
Currently, there are two ways to request an access token. They are designed for specific use cases ensuring the security of the transactions.
CLIENT_ID
and CLIENT_SECRET
. All actions are made on behalf of the Remote API Partner.access_token
.<aside> ℹ️ The Refresh Token flow is important because the access token returned at the end of the Authorization Code flow expires in one hour. After expiration, issuing a new access token through the Refresh Token Flow is required.
</aside>
In the Client Credentials Flow, a Client Application fetches an access_token
using the CLIENT_ID
and CLIENT_SECRET
. It allows for the creation of a new company and managing any other company that has granted consent through the Authorization Code Flow.
🖇️ ➡️ More detailed instructions for using this flow are available on the Client Credentials Flow page.
In the Refresh Token Flow, a Client Application exchanges the refresh_token
obtained at the end of one of the two flows described below. It is possible to obtain refresh_tokens
from these two different scenarios:
Connecting to an existing Remote Company: Used if the Remote API Partner wants to create new employments, time-offs, or update company attributes — for instance, a Remote Company Admin needs to give consent first. In this flow, an existing Remote Company grants the consent to the Remote API Partner for acting on behalf of the user who authorized the integration. Any Company Admin can give consent.
🖇️ ➡️ Learn how to connect to an existing company with the Authorization Code Flow.
Creating a new Remote Company: When creating the Remote Company, the Remote API Partner can ask for the OAuth authorization to be executed as well. The proper tokens are returned in the company creation payload, which enables fetching access_tokens
on behalf of the Company Admin user. Learn how to create a new company with consent.
After going through either of these two flows, you can exchange the refresh_token
for a valid access_token
at any time following the Refresh Token Flow.