Machine apps need the Pro plan or above.
Set up a machine app
1
Name your app permissions
Machine tokens carry your own app permissions. If you have none yet, add them under Roles → Your app permissions, for example
reports:read.2
Register the app
Open Apps → Register app. Under Kind, choose Machine. A machine app has a secret and no return addresses.
3
Save the credentials
Copy the Client ID and Client secret. The secret is shown once.
4
Choose what its tokens carry
Select the app in the list. Under What its tokens carry, tick the permissions it may ask for, then select Save. The panel also shows the Token address and the Audience your services check.
Get a token
scopeis optional. Leave it out to get every permission the app was given. You may ask for fewer, never more; asking for one it wasn’t given returnsinvalid_scope.- You can send the credentials with HTTP Basic or as
client_idandclient_secretin the form. - A machine app can use only
client_credentials. Any other grant returnsunauthorized_client. - There is no refresh token. Ask for a new token when the old one is close to its expiry, and reuse a token until then.
The token
The token is a JWT signed with RS256, using the same keys as ID tokens (/v1/auth/.well-known/jwks.json).
Check the token in your service
Verify the signature,iss, exp, that aud is your organization’s audience, and that gty is client-credentials. Then check that scope holds the permission the call needs.
Limits and revocation
- Each machine app can get at most 60 tokens a minute. Past that, the token endpoint answers
429withslow_down. Reuse a token until it ends. - A token can’t be called back. Turning the app off or changing its permissions stops new tokens; a token already issued lasts until its hour is up. Keep checking
exp.