# Email and Plain Text Make Modules

To get started, sign up for a new account at <https://beta.capriai.us> and start a 2 week free trial! You'll need an account to get your Agent ID and Token. See the [Quickstart Guides](/quickstart-guides/getting-started-with-capri-ai.md) for information on setting up an agent (use the "Beta" section)!

### Connection

You'll need a Capri API Token to be able to use any of the Capri Make modules. Grab it [here](https://beta.capriai.us/home/organization?show=tokens).

<figure><img src="/files/kvzhFqe4LPOrnzH5F0JP" alt=""><figcaption></figcaption></figure>

After you get this Capri Token, you can then go ahead and add the Capri module that you'd like to your Make. In the module, at the top, there's a section for "Connection". In this section, click add, then paste your Capri token into the Capri API Key field and save the connection.\ <br>

<figure><img src="/files/Se3unFKadcuSO64lehmG" alt=""><figcaption></figcaption></figure>

Without this connection, the module won't function, and this applies for any of the Capri modules!

### Module Settings

After the connection is set, you then need to fill out the settings for the module.

<figure><img src="/files/8sYUMOxBWA9xV8gEnrRB" alt=""><figcaption></figcaption></figure>

| Name                                                       | Description                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agent ID<mark style="color:red;">\*</mark>                 | (required) The desired agent ID, found at the very end of the URL of your agent's details page or as a copyable item next to the agent itself <https://beta.capriai.us/home/agents>                                                                                 |
| Session Id<mark style="color:red;">\*</mark>               | (required)  Any random string, provided by the application calling the capri API. Minimum of 8 unique characters required.                                                                                                                                          |
| Message (for plain text)<mark style="color:red;">\*</mark> | (required)  The user's query to be responded to by the agent.                                                                                                                                                                                                       |
| Subject (for email)<mark style="color:red;">\*</mark>      | (required) The subject of the email to be responded to by the agent.                                                                                                                                                                                                |
| Body (for email)<mark style="color:red;">\*</mark>         | (required) The body of the email to be responded to by the agent.                                                                                                                                                                                                   |
| Direction Type<mark style="color:red;">\*</mark>           | (required) Which direction the message is being sent.                                                                                                                                                                                                               |
| Custom Prompt                                              | If you'd like to use a different prompt than the one set in the agent, you can enter it here.                                                                                                                                                                       |
| Prompt ID                                                  | If you have more than one prompt set up for an agent, you can specify the one you'd like to use by entering its ID here. You can find the ID as a copyable item next to the prompt in the agent page itself.                                                        |
| History                                                    | How many hours of history that you'd like the AI to be able to read from. For instance, 12 would be 12 hours, 48 would be two days, and .5 would be 30 minutes. If blank, it will be unlimited.                                                                     |
| Knowledge                                                  | If you have a spreadsheet that you'd like the AI to be able to read from, you can specify it here by entering its URL. The spreadsheet does need to be connected in the Capri portal at <https://beta.capriai.us/home/settings/integrations> before it can be used. |

### Status Codes

{% tabs %}
{% tab title="200: OK Successful " %}
Response Parameters:

```
{
  "finalResponse" : //Your agent's final conversational response,
  "actions" : //array of actions your agent took during it's turn
       [
           {
              "eventId" : //unique Id representing the action
              "sender" : //who sent the message ('bot' or 'human'),
              "kind" : // the kind of action (i.e., googleSheet, ghlCalendar, etc),
              "accountId" : //id of which resource was used for this action,
              "accountName" : //name of which resource was used for this action,
              "deleted" : //boolean, represents if a user manually corrected the action from the emulator,
              "action" : //the action type (i.e., 'read', 'write', tag', etc),
              "eventData" : //event details (optional, only present if required such as calendar event dates and time ranges)
              "reference" : //reference url for the resource that was used (optional),
              "timestamp" : //time the action took place (epoch time in milliseconds)
           },
           {...}
        ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid or API Token not found" %}

```
{
    "message": string,
    "error": 'Unauthorized'
    "statusCode": 401
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid request body. Most commonly occurs when a required request parameter is missing or invalid" %}

```
{
    "message": string,
    "error": 'Bad Request'
    "statusCode": 400
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.capriai.us/api-and-developer-tools/email-and-plain-text-make-modules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
