> ## Documentation Index
> Fetch the complete documentation index at: https://docs-eos.fpt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Custom APIs in a Digital Worker

> Attach a REST API connector to a Digital Worker, set Auto, Ask or Block for each operation, test it and remove it from the Digital Worker.

> [!NOTE]
>
> This page shows how to use a **REST API connector** that already exists in the Workspace inside a Digital Worker. If you don't have one yet, create it first in [Custom API connectors in the Space](https://docs-eos.fpt.ai/eos/en/custom-api-connectors.md).

## Entry point

**My Digital Workers** → open a Digital Worker → **Build** → **Configuration** panel → **Connectors** section → **+**.

## Attach the Connector to a Digital Worker

**1. Open the Digital Worker's Connectors section**

Open the Digital Worker. On the **Build** screen, select the **Configuration** panel and click **+** in the **Connectors** section.

**2. Choose the account type**

Choose **Shared** (one Workspace account) or **Per-user** (each person's own account).

![Menu with Shared and Per-user](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_add_menu.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=3b1fcf3e977acfc8152db77feb88126f)

**3. Select the Connector and click Done**

Custom Connectors are listed together with the built-in ones. Select the Connector and click **Done**. **Create connector** at the bottom opens the same REST API dialog as the Connectors page.

![Shared Connectors picker with Demo Orders API selected](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_picker.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=e6427573d0d26629a0f76885b1a2c9d4)

**4. Expand the Connector to see its operations**

The Connector appears in the **Connectors** section with its account type and the number of exceptions. Click the row to see the account in use and the permission of each operation.

![Attached Connector with the default permission of each operation](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_permissions.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=50049b31839ed7215ff5136044699b82)

| Account type | When the Digital Worker runs | Use it when |
| - | - | - |
| **Shared** | The Digital Worker always uses the same Workspace account, no matter who is asking | Shared business APIs with a key issued by an admin |
| **Per-user** | Each person connects and uses their own account | Each person has their own key or permissions on the API |

With **Shared**, the **Account** area shows which account the Digital Worker uses. Click the switch icon to pick another account, **Add account** or **Manage accounts**.

![Account menu for a Shared Connector](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_account.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=5b79d6b66f7c0ea2b280fc8304127394)

With **Per-user**, there is no Account area. If a person hasn't connected their own account yet, the Digital Worker tells them to connect it before it calls an operation.

![Connector attached as Per-user](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_peruser.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=956cb8a5cbef8e1b9b0036bee29a1808)

> [!NOTE]
>
> On one Digital Worker, a Connector can be attached with only one account type. A Connector already attached as Shared shows **Already added · Shared** in the Per-user picker. To switch types, remove the Connector and attach it again.

## Set a permission for each operation

Each operation has three permission levels:

| Level | What the Digital Worker does | Default for |
| - | - | - |
| **Auto** | Calls the API right away without asking | **Read-only** operations |
| **Ask** | Stops and asks the user to approve before calling | **Writes data** and **Can destroy data** operations |
| **Block** | Can't call this operation | No default, you set it |

The **exceptions** count next to the Connector name tells you how many operations differ from their default. The example below sets **Cancel an order** to **Block** so the Digital Worker can't cancel orders.

![Cancel an order set to Block](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_connector_block.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=aca2f984aa35f4872b03489403b5e6d3)

> [!TIP]
>
> Removing and re-attaching a Connector resets every operation to its default permission. Note your exceptions before you remove it.

## Test the Digital Worker with the Connector

**1. Send a request on the Test run tab**

Open the **Test run** tab and send a request that needs the API, for example: Create an order for customer Tran Thi B with a total of 250000.

**2. Approve or reject the action**

For an operation set to **Ask**, the **Action needs your approval** card shows the operation and the arguments the Digital Worker wants to send. Click **Approve** to call the API. Click **Reject** to skip the call, optionally with a **Rejection reason** so the Digital Worker can adjust.

![Action needs your approval card for create\_order](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_approval_card.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=652d4a163a60c8327a02f248763f9444)

**3. Check the arguments and the result**

After the Digital Worker replies, expand **Used N tools** and then the tool name to see the **Arguments** that were sent and the **Result** the API returned.

![Details of the create\_order call with arguments and result](https://mintcdn.com/fpt-15dbd015/ZZ_AlSQhekpFaExV/images/eos/en_agent_tool_result.jpg?fit=max\&auto=format\&n=ZZ_AlSQhekpFaExV\&q=85\&s=ad5dc33cf7fdd002fce55dc1f1cb5a6c)

> [!WARNING]
>
> A test run calls the real API and spends real Workspace tokens. When you test operations that write or delete data, point the Connector at a test environment of the API.

> [!NOTE]
>
> Connector changes in a Digital Worker are auto-saved to the draft. End users only see them after you Publish a new version of the Digital Worker.

## Remove the Connector from a Digital Worker

Click the **trash** icon on the Connector row in the **Connectors** section. The Connector is removed right away, with no confirmation dialog. It stays in the Workspace and you can attach it again at any time.

> [!NOTE]
>
> When the Connector is re-imported in the Space, operations removed or renamed in the new document are no longer available in the Digital Worker. Open the Digital Worker's **Connectors** section to check permissions and run a test again.

## Troubleshooting

| What you see | Cause | Fix |
| - | - | - |
| The Digital Worker asks the user to connect an account | The Connector is attached as **Per-user** and the user hasn't connected yet | The user connects their own account before using the Digital Worker |

## See also

> **[Custom API connectors in the Space](https://docs-eos.fpt.ai/eos/en/custom-api-connectors.md)**
>
> Create, edit, re-import and delete Connectors.

> **[Connectors](https://docs-eos.fpt.ai/eos/en/connections.md)**
>
> How to attach built-in Connectors and set tool permissions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.