Skip to main content
Once registered as a first-class identity in Auth0, you can associate an agent with any OAuth client. An agent can be associated with multiple clients. This is useful when you want one logical agent identity with a single agent_id visible in tokens and logs across multiple clients, such as separate clients per environment or region. The agent_id is stored on the client object, and associations are managed dynamically. Once you associate an agent with a client, tokens issued to that client carry the agent’s identity as the subject (sub) for client credentials grants, or as the actor (act) for token exchange and standard login flows. To learn more, read Agent Identity in Tokens.
The internal agent_id remains the identifier used to manage the agent through the Management API, regardless of whether you’ve set an external_agent_id.

Associate a client at creation

Set the agent_id when creating a client via POST /api/v2/clients:
If successful, Auth0 returns the client object with the agent_id you set.

Retrieve the agent-associated client

Once you’ve associated an agent_id with a client, make a GET request to /api/v2/clients/{id} to return the client object:
If successful, Auth0 returns the client object with the agent_id you set.

Associate an existing client

You can associate an existing client using the Auth0 Dashboard or Management API.
  1. Navigate to Dashboard > Agents, select the agent, and then the agent’s Applications tab.
  2. Select Add Application and select the applications you want to associate with the agent in the modal. You can select multiple applications.
  3. Select Add Applications.
Once successfully added, the applications appear under the Applications tab for the agent.

Remove the agent association

To dissociate a client from its agent, set agent_id to null via PATCH /api/v2/clients/{id}:
After dissociation, new tokens issued to the client no longer carry agent identity. Existing tokens remain valid until expiry.

Next steps