# Agent Impersonation API

The Agents Impersonation API enables third-party server applications to act on behalf of agents, which can benefit organizations that want to integrate Cubu's functionality into their applications.&#x20;

This way, agents won't have to switch to Cubu each time they contact a new customer, making their job more efficient and streamlined.

The API enables agents to perform essential tasks, such as selecting a unit and workstation, calling the next case, resolving a case, etc.

To allow registered applications to impersonate users in your organization, add the "Agent impersonator" role to the application by checking the Agent Impersonator box.

<figure><img src="https://1731291682-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtTIx5ukFLQAUpACk18tO%2Fuploads%2FGe1mj0jHWPrXMunC7bDb%2Fimage.png?alt=media&#x26;token=2ffba3a6-be26-4822-9077-87cf68f81a35" alt=""><figcaption><p>Registered Application</p></figcaption></figure>

The API method URLs contain the **user ID** of the user being impersonated by the API.

{% code overflow="wrap" %}

```
POST: https://[base-url]/{applicationId}/agents/{userId}/...
```

{% endcode %}

User IDs are available in the General tab of the user details page.

<figure><img src="https://1731291682-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtTIx5ukFLQAUpACk18tO%2Fuploads%2FWRGeeyLyMnwivfsWusyJ%2Fimage.png?alt=media&#x26;token=da170c10-7435-4450-94b5-23471d60e14a" alt=""><figcaption><p>User Details page</p></figcaption></figure>
