Using The New Public API

Capri now offers a public API for our V3 (beta) users to engage with agents they've built and trained with our platform to be used with any other public REST API!

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 for information on setting up an agent (use the "Beta" section)!

Authorization

You'll need a Capri API Token to authorize your API Calls. Grab it herearrow-up-right.

Base URL:

Conversations

Request:

Query your Capri Ai Agent

POST https://api.capriai.us/v1/conversation/query

Send a user query and receive the final response as well as all intermediate actions that your agent predicted during it's conversation turn.

Request Header

Name
Description

Authorization*

(required) The value should be

"Bearer {YourCapriToken}", with a space in between "bearer" and your token, and no brackets.

For example, "Bearer oxoxooxoxxo"

Request Body

Name
Type
Description

agent*

String

(required) The desired agent ID, found at the very end of the URL of your agent's details page https://beta.capriai.us/home/agentsarrow-up-right

sessionId*

String

(required) Any random string, provided by the application calling the capri API. Minimum of 8 unique characters required.

message*

String

(required) The user's query to be responded to by the agent

Response Parameters:

Export GHL Conversation

Required Parameters

  1. url: The target URL for sending data.

  2. capri_token: A security token for authentication.

These parameters should be added as "custom data" parameters in GHL (GoHighLevel)

Response Structure

Upon successfully calling the export conversations API, you will receive a JSON response structured as follows:

Handling Errors

Ensure to handle potential errors when making the API call:

  • 401: Unauthorized - Check if the API token is correct and has the necessary permissions.

  • 400: Bad Request - Ensure all mandatory parameters are included and valid.

By managing both successes and errors effectively, you can seamlessly integrate conversation data into your workflow.

Last updated