Skip to main content
A machine app is a service that signs in as itself, with no person and no sign-in page. A nightly job, a backend worker or one microservice calling another can each be a machine app. It gets a short-lived token that carries the app permissions you give it, and your own services check that token. Aiveth implements the OAuth 2.0 client credentials grant (RFC 6749 §4.4). The token is a JWT access token in the shape RFC 9068 describes.
Machine apps need the Pro plan or above.
A machine token is for your organization’s own services. It opens nothing in Aiveth itself. To manage people in Aiveth from a server, use an API key instead.

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

  • scope is 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 returns invalid_scope.
  • You can send the credentials with HTTP Basic or as client_id and client_secret in the form.
  • A machine app can use only client_credentials. Any other grant returns unauthorized_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 429 with slow_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.

Server-to-server calls for AI agents

If you run MCP servers for AI agents, one server can exchange the token an agent sent it for a token to call another of your servers, for the same person (RFC 8693 token exchange). That is part of the AI agents feature. See Agent tokens.