> ## Documentation Index
> Fetch the complete documentation index at: https://syncupai-robbalian-cleanup-deprecated-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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image1.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=72589ebc7043090b770ce386ee0edf49" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image2.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=e04af9bf6061aaf6cc8f2ea2dd08761a" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image3.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=bf8d3e5108907870b1862ff6286bca1e" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image4.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=c214e83fdc499115d648074fdda94bf9" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image5.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=b1252e4cd37a10423321c88567a2b08a" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image6.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=ff8c5ebb51cae39f2933f95dbd5cbfba" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image7.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=20a04326c59d408b7e4a8476f49548a3" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image8.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=f614ece1cfb92125e84803ff1abbc4cb" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image9.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=5e9ffb7883fc260ec2ba2c2157a446ed" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image10.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=eda18296425f4ad26c5c5e491ca764ba" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image11.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=56440618a09929de8c2d77ce4838e2b7" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image12.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=b8c21ac6b563f567c9bc7a3f8f0d84aa" 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-cleanup-deprecated-docs/dT-Kh7pbMsehLPWI/images/api_agents/image13.png?fit=max&auto=format&n=dT-Kh7pbMsehLPWI&q=85&s=67a6520062f976dd990982fd16c65fd6" alt="Default version updated in the header" width="2642" height="1494" data-path="images/api_agents/image13.png" />
