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
  • Agent Public API Documentation
  • Endpoints
  1. API and Developer Tools
  2. Using The New Public API

Agent API

PreviousUsing The New Public APINextEmail and Plain Text Make Modules

Last updated 10 days ago

Agent Public API Documentation

Note

  • Fields marked with ? are optional.

Error Response Format

All error responses are returned in the following format:

{
  "message": "Error message",
  "error": "error code",
  "statusCode": code
}

Example:

{
  "message": "Capri token not found",
  "error": "Unauthorized",
  "statusCode": 401
}

Endpoints

1. POST /v1/agent/create

Description: Create a new agent.

Request Body:

{
  "agentName": "string",
  "folder"?: "string",
  "website"?: "string",
  "prompts"?: {
    "name": "string",
    "promptContent": "string",
    "customFallbackPrompt"?: "string"
  }
}

Response:

{
  "agentName": "new Agent",
  "orgId": "6561047156b3825f13bwc878",
  "userId": "",
  "disabled": false,
  "aiProvider": {
    "companyId": "openai-hosted",
    "modelName": "gpt-4o",
    "accountName": "4O - Capri Hosted",
    "accountId": "capriHosted",
    "isAdvancedSettings": false,
    "advancedSettings": {
      "temperature": 0.3,
      "maxLength": 180,
      "frequencyPenalty": 0,
      "optimize": "accuracy"
    }
  },
  "failsafeAiProvider": {
    "failsafe": false,
    "companyId": "fireworks",
    "modelName": "llama-v3-70b",
    "accountName": "Capri Hosted",
    "accountId": "capriHosted"
  },
  "multipleInbound": false,
  "multipleInboundConfig": {
    "initialWait": 1,
    "maxWait": 10,
    "incrementBy": 30
  },
  "actions": [],
  "savedSessionIds": [],
  "humanTakeover": {
    "takeoverType": "None"
  },
  "contextLength": 1000,
  "textContentKnowledgeSource": null,
  "showNotifications": {
    "connectAgentToTrigger": true
  },
  "_id": "678578dc217db71ewe060b4d6",
  "processingJobs": [],
  "processedFiles": [],
  "triggers": [],
  "variables": [],
  "faqs": [],
  "__v": 0
}

2. POST /v1/agent/{agentId}/update-faq

Description: Add a new FAQ to an agent.

Params:

  • agentId // id of the agent to add the new FAQ.

Request Body:

{
  "faqs": [
    {
      "question": "string",
      "answer": "string"
    }
  ]
}

Response:

{
  "success": true,
  "faqs": [
    {
      "id": "string",
      "question": "string",
      "answer": "string"
    }
  ]
}

3. POST /v1/agent/edit/name

Description: Update an agent’s name.

Request Body:

{
  "agentId": "string",
  "agentName": "string"
}

Response:

{
  "message": "Agent name updated successfully"
}

4. POST /v1/agent/{agentId}/website/scrape

Description: Add websites as a knowledge source to an agent.

Params:

  • agentId // id of the agent to add the website.

Request Body:

{
  "urls": ["string"] // URLs of the websites to scrape.
}

Response:

{
  "success": true,
  "message": "Website processing started",
  "processingJobs": [
    {
      "jobId": "manual-processing-website",
      "accountId": "e33c37-a6a0-4748-8807-07cf194f4e82",
      "fileName": "https://capriai.us",
      "jobType": "website-scrape",
      "maxDepth": 0
    }
  ]
}

5. POST /v1/agent/{agentId}/file-upload

Description: Add a file as a knowledge source to an agent.

Params:

  • agentId // id of the agent to upload the new file.

Request Body:

{
  "files": file
}

Response:

{
  "message": "Files queued for processing",
  "processingJobs": [
    {
      "jobId": "37",
      "accountId": "9772-4e01-a403-8916dc6b1c5a",
      "fileName": "capriai.txt",
      "mimeType": "text/plain",
      "jobType": "file-upload"
    }
  ]
}

6. POST /v1/agent/add/prompt

Description: Add a prompt to an agent.

Request Body:

{
  "agentId": "string",
  "prompt": {
    "name": "string",
    "promptContent": "string",
    "customFallbackPrompt"?: "string"
  }
}

Response:

{
  "message": "New Prompt Pushed Successfully",
  "currentActive": "a17e6aa6-e54f77b-abf7-12080247fe4c",
  "prompt": {
    "promptId": "ff9a69f4-45eb-a119-aed31a75158d",
    "name": "main prompt",
    "promptContent": "You are a bot representing capri AI",
    "isFallbackPrompt": false,
    "customFallbackPrompt": "Say sorry and ask to contact customer support whenever you can't answer"
 
69KB
Agent Public API Documentation updated (1).pdf
pdf
pdf version of the Agent API documentation