Capri Ai
  • Quickstart Guides
    • Getting Started With Capri AI
    • Video Onboarding Course
    • Setup
    • Capri AI Affiliate Program
  • Capri Portal
    • Accessing the Capri Portal
    • Navigating the Capri Portal
    • Setting up the Settings
    • Setting up an Agent
    • Setting up Actions
      • GHL Channel
        • Contact/Custom Fields
      • GHL Calendar
      • Google Calendar
      • Google Sheets
      • Google Docs
      • Website Reading
    • Adding a User to your Organization
    • Using the Emulator
      • Adding the Emulator as a Custom Menu Item
      • Iframe Emulator Settings
    • Understanding Fallbacks
    • Setting up Rebilling
    • Snapshots
  • Spreadsheet and Knowledge Base
    • Setting up and Using a Spreadsheet
    • Having the Spreadsheet Auto-Update
  • PROMPT DESIGN
    • Creating Prompts
    • Prompt Examples
  • INTEGRATING WITH CRM AND WEBHOOK INFORMATION
    • GoHighLevel (GHL)
    • HubSpot
    • Webhook Information
    • Triggers
      • Automated Follow-Up For Stale Leads
    • Using Multiple Webhooks
    • Uphex
  • API and Developer Tools
    • Using The New Public API
      • Agent API
    • Email and Plain Text Make Modules
    • Model Pricing
  • Customer Support
    • Contact Us!
  • Legacy Information
    • Legacy Information
      • Setup (Legacy)
      • Accessing the Capri Portal (Legacy)
      • Navigating the Capri Portal (Legacy)
      • Capri Portal Settings (Legacy)
      • Using the Emulator (Legacy)
      • Adding the Emulator as a Custom Menu Item (Legacy)
      • Connecting to the CRM (Legacy)
        • GoHighLevel (GHL)
        • Webhook Information
      • Custom Tags (Legacy)
      • Handoff and Disqualify (Legacy)
      • Testing and Debugging (Legacy)
      • Understanding Fallbacks (Legacy)
      • Overview of the calendar integration (Legacy)
      • Respond Tasks (Legacy)
      • Outreach Tasks (Legacy)
      • Evaluate Tasks (Legacy)
      • Custom Tasks (Legacy)
      • Setting up a Spreadsheet (Legacy)
      • Using the Knowledge Base Extension (Legacy)
Powered by GitBook
On this page
  • Authorization
  • Base URL:
  • Conversations
  • Query your Capri Ai Agent
  • Export GHL Conversation
  1. API and Developer Tools

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!

PreviousUphexNextAgent API

Last updated 6 months ago

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 .

Base URL:

// https://api.capriai.us/v1/{endpoint}

Conversations

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

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

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:

{
  "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)
           },
           {...}
        ]
}
{
    "message": string,
    "error": 'Unauthorized'
    "statusCode": 401
}
{
    "message": string,
    "error": 'Bad Request'
    "statusCode": 400
}

Export GHL Conversation

https://api.capriai.us/v1/extension/leadconnector/conversations

Response Structure

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

{
    "conversations": [
        {
            "conversationId": "string",
            "participants": [
                {
                    "participantId": "string",
                    "name": "string",
                    "role": "string"
                },
                ...
            ],
            "messages": [
                {
                    "messageId": "string",
                    "sender": "string",
                    "content": "string",
                    "timestamp": "epoch time in milliseconds"
                },
                ...
            ]
        },
        ...
    ],
    "pagination": {
        "currentPage": number,
        "totalPages": number,
        "pageSize": number,
        "totalItems": number
    }
}

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.

(required) The desired agent ID, found at the very end of the URL of your agent's details page

https://beta.capriai.us/home/agents
here