> ## Documentation Index
> Fetch the complete documentation index at: https://syncupai-robbalian-entrances-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Workbook Agents in the API

> Create an agent in a workbook, enable it for API use, and manage versions

## Overview

This guide walks through creating a workbook agent called **Attraction Rating** (rates attractions on a 1-10 scale), enabling it for API use, and managing versions.

## 1) Create the agent in a workbook

Open the agent pane and create a new agent.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image1.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=3fca9bac4ce2583f12023f60566a892a" alt="Create a new agent from the agent pane" width="2636" height="1494" data-path="images/api_agents/image1.png" />

Add the prompt, then scroll down and click **Add column**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image2.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=77e7e2d3a8cfb3824d038c43ea8de17d" alt="Enter the prompt and click Add column" width="2628" height="1488" data-path="images/api_agents/image2.png" />

## 2) Edit the agent settings

After the column is added to the table, click the column header and select **Edit agent**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image3.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=9352795cf80aa48674e53fc14650ff33" alt="Open the column menu and choose Edit agent" width="2634" height="1490" data-path="images/api_agents/image3.png" />

## 3) Enable API usage

In the agent editor, click **Advanced** and then click **Use in API**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image4.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=2af181eed812f03b6d2db79ede411434" alt="Advanced settings with the Use in API button" width="2648" height="1492" data-path="images/api_agents/image4.png" />

This opens the API enablement panel. You can add a description and optionally rename the API attribute. This is a preview of the agent you are adding.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image5.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=dadfaf12ffb20778a2f2d1db9e4d08e1" alt="Enable API usage panel with name and description" width="2644" height="1488" data-path="images/api_agents/image5.png" />

Scroll down and click **Enable API usage**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image6.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=11b7c26672c4575ace2d6509c45583f0" alt="Enable API usage button" width="2642" height="1482" data-path="images/api_agents/image6.png" />

Once enabled, you will see a confirmation that it is ready to use.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image7.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=53a5a909d500dea05c58c560cda66e15" alt="API usage enabled confirmation" width="2640" height="1490" data-path="images/api_agents/image7.png" />

## 4) Call the agent from the API

Use the `attribute_key` shown in the UI with the `/enrich` endpoint.

<CodeGroup>
  ```bash cURL theme={null}
  # Use the default version (no version param)
  curl --request POST \
    --url https://api.reprompt.io/v2/enrich \
    --header 'Authorization: Bearer {YOUR_API_KEY}' \
    --header 'Content-Type: application/json' \
    --data '{
      "attribute_key": "attraction_rating",
      "inputs": {
        "name": "Golden Gate Bridge",
        "full_address": "Golden Gate Bridge, San Francisco, CA"
      }
    }'
  ```

  ```bash cURL theme={null}
  # Call a specific version
  curl --request POST \
    --url 'https://api.reprompt.io/v2/enrich?version=1' \
    --header 'Authorization: Bearer {YOUR_API_KEY}' \
    --header 'Content-Type: application/json' \
    --data '{
      "attribute_key": "attraction_rating",
      "inputs": {
        "name": "Golden Gate Bridge",
        "full_address": "Golden Gate Bridge, San Francisco, CA"
      }
    }'
  ```
</CodeGroup>

## 5) Edit the agent and create a new version

To make changes, return to the agent editor, update the prompt, and click **Use in API** again. The text below will show which version you are about to create (for example, “will save as version 2 of Attraction Rating”).

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image8.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=38287e352127b7c210f77cef034e5244" alt="Edit agent prompt and see the next version number" width="2642" height="1492" data-path="images/api_agents/image8.png" />

Click **Save**. The confirmation will show which version will be saved.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image9.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=9865ddfea16f5050331da83776994c68" alt="Save new version confirmation" width="2638" height="1486" data-path="images/api_agents/image9.png" />

After saving, the agent is ready to use. Any API callers **without** a version parameter will now use the **default** version.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image10.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=0af3e3433d9a5989992cbbf78510b1d5" alt="Agent ready to use with default version behavior" width="2638" height="1488" data-path="images/api_agents/image10.png" />

## 6) Manage default versions

Click **Saved enrichments** to view all versions. The default version is labeled and shows **API enabled**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image11.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=1bddfb23cb22e91d223fc137a6f7a4a3" alt="Saved enrichments showing default version and API enabled status" width="2644" height="1490" data-path="images/api_agents/image11.png" />

To change the default, find the version you want and click **Set as default**.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image12.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=1b6b01c006a98bef2ae19bb1cb7cbbd7" alt="Set a different version as default" width="2644" height="1498" data-path="images/api_agents/image12.png" />

The header updates to show the new default. Calls without a version parameter will now use this version.

<img src="https://mintcdn.com/syncupai-robbalian-entrances-docs/lKDSzFUAQdjRrIf7/images/api_agents/image13.png?fit=max&auto=format&n=lKDSzFUAQdjRrIf7&q=85&s=e3b57becffea3dd061dfaf10fbdbf7ef" alt="Default version updated in the header" width="2642" height="1494" data-path="images/api_agents/image13.png" />
