# null Source: https://docs.trata.ai/api-reference/API-Architecture Trata's API architecture is divided into two main categories: ### Control Plane APIs * Configuration-focused APIs * Not invoked during active conversations * Used for system setup and management ### Data Plane APIs * Runtime APIs used during conversation flows * Handles real-time communication * Manages connections and WebSocket interactions ## Conversation Protocol Trata uses WebSockets for real-time communication with user-facing endpoints (Telephony providers and Frontend UI widgets). ### Message Stream Schema After opening the websocket connection, the server expects and sends messages in the following schema: ```json theme={null} { "type": "object", "title": "MessageStream", "required": [ "command", "payloadType", "payload" ], "properties": { "command": { "type": "string", "description": "The type of message stream being sent or received, check the table below for more details of the command types", "enum": [ "CLIENT_TO_SERVER_SYNC", "SERVER_TO_CLIENT_SYNC", "END_OF_TURN", "STOP", "ABORT_AUDIO", "UPDATE_MESSAGE_STATUS" ] }, "payloadType": { "type": "string", "description": "The type of payload being sent or received. Either Audio in bytes or text string, below table contains more details on the audio encoding format requirements", "enum": [ "AUDIO", "TEXT" ] }, "payload": { "type": "object", "description": "content of the payload, either audio bytes or text string" }, "user_dialog_id": { "type": "string", "nullable": true, "description": "unique identifier for each dialog in the conversation. This dialog id is generated by the server and client can send a status update to server on whether the dialog is completely played or not at the client side" } } } ``` ### Command Types | Command | Description | | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | CLIENT\_TO\_SERVER\_SYNC | Clients uses this command to send audio bytes received from microphone or text to server | | SERVER\_TO\_CLIENT\_SYNC | Server uses this command to send audio bytes to be played to the user or text to be displayed to the users terminal | | END\_OF\_TURN | Server sends this command to indicate that the response for a dialog request is completed | | STOP | If client wants to stop the conversation and close the websocket connection, it can send this command | | ABORT\_AUDIO | When server detects that the user has interrupted the conversation, it will send this command to client so that client can stop playing any buffered audio and listen to the user input | | UPDATE\_MESSAGE\_STATUS | Client can send this message to update the server that audio bytes for a particular dialog has been played | ### Payload Types | Type | Description | Format | | ----- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | AUDIO | Audio data payload | For BROWSER connections: PCM audio with FLOAT32 encoding, 44.1kHz sample rate, 32-bit depth, and 128-sample chunks. For TWILIO/PLIVO connections: Format is automatically handled by Trata | | TEXT | Text data payload | Text string | # null Source: https://docs.trata.ai/api-reference/API-Entities ## AIAgent An AIAgent is an AI-powered virtual agent that can engage in conversations with prospects. It acts as a digital representative that can be configured with specific roles (like sales or support), personality traits, and knowledge bases. The agent uses natural language processing to understand and respond to conversations while following defined prompts and guidelines. ## Prospects Prospects represent the contacts or potential customers that the AI agents interact with. These are individuals or representatives from organizations that are part of your sales or engagement pipeline. Prospects can be engaged through various channels and their interactions are tracked and managed within the system. ## Hive Hive is Trata's knowledge base system that serves as the AI agent's source of information. It can process and understand content from various sources including: * PDF documents * Text files * Word documents * Websites (via URL crawling) The Hive system processes these inputs to create a structured knowledge base that AI agents can reference during conversations. ## Action Actions are integrations with third-party services that AI agents can trigger during conversations. These allow agents to perform tasks like: * Updating CRM records * Scheduling meetings * Sending emails * Creating tickets * And other custom integrations Actions help bridge the gap between conversation and actual business processes. ## Conversations Conversations track the actual interactions between AI agents and prospects. Each conversation maintains a complete history of the communication, including context, responses, and any actions taken during the interaction. This allows for analysis, improvement, and continuity in prospect engagement. ## Files Files represent the documents that can be uploaded into the system. These could be training materials, reference documents, or other content that needs to be processed and added to the Hive knowledge base. The system supports various file formats including PDFs, text files, and Word documents. ## Connection A Connection represents the communication channel configuration used to make calls or establish contact with prospects. This entity manages the technical details needed to establish and maintain communication # Create a Link Between an Action and an Agent Source: https://docs.trata.ai/api-reference/actionagentlink/create-a-link-between-an-action-and-an-agent openapi.json post /v1/actions/{action_id}/ai-agents/{agent_id}/link Create a Link Between an Action and an Agent # Delete a Link Between an Action and an Agent Source: https://docs.trata.ai/api-reference/actionagentlink/delete-a-link-between-an-action-and-an-agent openapi.json delete /v1/actions/{action_id}/ai-agents/{agent_id}/link Delete a Link Between an Action and an Agent # List All Actions Linked to a Specific Agent Source: https://docs.trata.ai/api-reference/actionagentlink/list-all-actions-linked-to-a-specific-agent openapi.json get /v1/ai-agents/{agent_id}/actions List All Actions Linked to a Specific Agent # Create a New Action Source: https://docs.trata.ai/api-reference/actions/create-a-new-action openapi.json post /v1/actions Create a New Action # Delete a Specific Action by ID Source: https://docs.trata.ai/api-reference/actions/delete-a-specific-action-by-id openapi.json delete /v1/actions/{action_id} Delete a Specific Action by ID # Get a Specific Action by ID Source: https://docs.trata.ai/api-reference/actions/get-a-specific-action-by-id openapi.json get /v1/actions/{action_id} Get a Specific Action by ID # List All Actions Under the User's Organization Source: https://docs.trata.ai/api-reference/actions/list-all-actions-under-the-user's-organization openapi.json get /v1/actions List All Actions Under the User's Organization # Update a Specific Action by ID Source: https://docs.trata.ai/api-reference/actions/update-a-specific-action-by-id openapi.json put /v1/actions/{action_id} Update a Specific Action by ID # Create a New AI Agent Source: https://docs.trata.ai/api-reference/agents/create-a-new-ai-agent openapi.json post /v1/ai-agents Create a New AI Agent # Delete a Specific AI Agent by ID Source: https://docs.trata.ai/api-reference/agents/delete-a-specific-ai-agent-by-id openapi.json delete /v1/ai-agents/{agent_id} Delete a Specific AI Agent by ID # Get a Specific AI Agent by ID Source: https://docs.trata.ai/api-reference/agents/get-a-specific-ai-agent-by-id openapi.json get /v1/ai-agents/{agent_id} Get a Specific AI Agent by ID # List All AI Agents Source: https://docs.trata.ai/api-reference/agents/list-all-ai-agents openapi.json get /v1/ai-agents List All AI Agents # Update a Specific AI Agent by ID Source: https://docs.trata.ai/api-reference/agents/update-a-specific-ai-agent-by-id openapi.json put /v1/ai-agents/{agent_id} Update a Specific AI Agent by ID # Get Aggregated Stats Source: https://docs.trata.ai/api-reference/analytics/get-aggregated-stats openapi.json get /v1/stats Get aggregated stats from Trata AI like call count, prospect count, etc. # Get Metrics Source: https://docs.trata.ai/api-reference/analytics/get-metrics openapi.json post /v1/metrics Get fine grained analytics data from Trata AI like call, duration stats, etc. # Create a link between a conversation and a prospect Source: https://docs.trata.ai/api-reference/conversationprospectlink/create-a-link-between-a-conversation-and-a-prospect openapi.json post /v1/conversations/{conversation_id}/prospects/{prospect_id}/links Create a link between a conversation and a prospect # Delete a link between a conversation and a prospect Source: https://docs.trata.ai/api-reference/conversationprospectlink/delete-a-link-between-a-conversation-and-a-prospect openapi.json delete /v1/conversations/{conversation_id}/prospects/{prospect_id}/links Delete a link between a conversation and a prospect # List all conversations linked to a specific prospect Source: https://docs.trata.ai/api-reference/conversationprospectlink/list-all-conversations-linked-to-a-specific-prospect openapi.json get /v1/prospects/{prospect_id}/conversations List all conversations linked to a specific prospect # Add Feedback to a Specific Conversation Source: https://docs.trata.ai/api-reference/conversations/add-feedback-to-a-specific-conversation openapi.json post /v1/conversations/{conversation_id}/feedback Add Feedback to a Specific Conversation # Create a New Conversation Source: https://docs.trata.ai/api-reference/conversations/create-a-new-conversation openapi.json post /v1/conversations Create a New Conversation # Delete a Specific Conversation by ID Source: https://docs.trata.ai/api-reference/conversations/delete-a-specific-conversation-by-id openapi.json delete /v1/conversations/{conversation_id} Delete a Specific Conversation by ID # Get a Specific Conversation by ID Source: https://docs.trata.ai/api-reference/conversations/get-a-specific-conversation-by-id openapi.json get /v1/conversations/{conversation_id} Get a Specific Conversation by ID # List All Conversations Source: https://docs.trata.ai/api-reference/conversations/list-all-conversations openapi.json get /v1/conversations List All Conversations # Update a Specific Conversation by ID Source: https://docs.trata.ai/api-reference/conversations/update-a-specific-conversation-by-id openapi.json put /v1/conversations/{conversation_id} Update a Specific Conversation by ID # Create Connection Source: https://docs.trata.ai/api-reference/data-plane/create-connection openapi.json post /v1/connections Create a new connection for an AI Agent to start a voice conversation # Get Audio Stream XML For Plivo Source: https://docs.trata.ai/api-reference/data-plane/get-audio-stream-xml-for-plivo openapi.json get /v1/connections/{connection_id}/plivo-audio-stream-xml Get the audio stream xml for Plivo to start a voice conversation # Delete Files Source: https://docs.trata.ai/api-reference/files/delete-files openapi.json delete /v1/files Delete files from Trata account # Upload Files Source: https://docs.trata.ai/api-reference/files/upload-files openapi.json post /v1/files Upload file to Trata account to use in AI Agents # Heart Beat Check For Trata Backend Source: https://docs.trata.ai/api-reference/health/heart-beat-check-for-trata-backend openapi.json get /status Heart Beat check to check the health of Trata Backend # Create a New Hive Source: https://docs.trata.ai/api-reference/hive/create-a-new-hive openapi.json post /v1/hives Hive is a collection of documents that are used to train the Agent. Hive can be a PDF, DOCX, TXT or a website URL # Delete a Specific Hive by ID Source: https://docs.trata.ai/api-reference/hive/delete-a-specific-hive-by-id openapi.json delete /v1/hives/{hive_id} Delete a Specific Hive by ID # Get a Specific Hive by ID Source: https://docs.trata.ai/api-reference/hive/get-a-specific-hive-by-id openapi.json get /v1/hives/{hive_id} Get a Specific Hive by ID # List All Hives Source: https://docs.trata.ai/api-reference/hive/list-all-hives openapi.json get /v1/hives List All Hives # Update a Specific Hive by ID Source: https://docs.trata.ai/api-reference/hive/update-a-specific-hive-by-id openapi.json put /v1/hives/{hive_id} Update a Specific Hive by ID # Create a Link Between a Hive and an Agent Source: https://docs.trata.ai/api-reference/hiveagentlink/create-a-link-between-a-hive-and-an-agent openapi.json post /v1/hives/{hive_id}/ai-agents/{agent_id}/link Create a Link Between a Hive and an Agent # Delete a Link Between a Hive and an Agent Source: https://docs.trata.ai/api-reference/hiveagentlink/delete-a-link-between-a-hive-and-an-agent openapi.json delete /v1/hives/{hive_id}/ai-agents/{agent_id}/link Delete a Link Between a Hive and an Agent # List All Agents Linked to a Specific Hive Source: https://docs.trata.ai/api-reference/hiveagentlink/list-all-agents-linked-to-a-specific-hive openapi.json get /v1/hives/{hive_id}/ai-agents List All Agents Linked to a Specific Hive # List All Hives Linked to a Specific Agent Source: https://docs.trata.ai/api-reference/hiveagentlink/list-all-hives-linked-to-a-specific-agent openapi.json get /v1/ai-agents/{agent_id}/hives List All Hives Linked to a Specific Agent # Create a New Product Source: https://docs.trata.ai/api-reference/products/create-a-new-product openapi.json post /v1/products Create a New Product # Delete a Specific Product by ID Source: https://docs.trata.ai/api-reference/products/delete-a-specific-product-by-id openapi.json delete /v1/products/{product_id} Delete a Specific Product by ID # Get a Specific Product by ID Source: https://docs.trata.ai/api-reference/products/get-a-specific-product-by-id openapi.json get /v1/products/{product_id} Get a Specific Product by ID # List All Agents Linked to a Specific Product Source: https://docs.trata.ai/api-reference/products/list-all-agents-linked-to-a-specific-product openapi.json get /v1/products/{product_id}/agents List All Agents Linked to a Specific Product # List All Products Source: https://docs.trata.ai/api-reference/products/list-all-products openapi.json get /v1/products List All Products # Update a Specific Product by ID Source: https://docs.trata.ai/api-reference/products/update-a-specific-product-by-id openapi.json put /v1/products/{product_id} Update a Specific Product by ID # Create a New Prospect Source: https://docs.trata.ai/api-reference/prospects/create-a-new-prospect openapi.json post /v1/prospects Create a New Prospect # Delete a Specific Prospect by ID Source: https://docs.trata.ai/api-reference/prospects/delete-a-specific-prospect-by-id openapi.json delete /v1/prospects/{prospect_id} Delete a Specific Prospect by ID # Get a Specific Prospect by ID Source: https://docs.trata.ai/api-reference/prospects/get-a-specific-prospect-by-id openapi.json get /v1/prospects/{prospect_id} Get a Specific Prospect by ID # List All Prospects Source: https://docs.trata.ai/api-reference/prospects/list-all-prospects openapi.json get /v1/prospects List All Prospects # Update a Specific Prospect by ID Source: https://docs.trata.ai/api-reference/prospects/update-a-specific-prospect-by-id openapi.json put /v1/prospects/{prospect_id} Update a Specific Prospect by ID # Get list of voices available for calls Source: https://docs.trata.ai/api-reference/voicemodels/get-list-of-voices-available-for-calls openapi.json get /v1/voice-models Get list of voices available for calls # Change Log Source: https://docs.trata.ai/changelog/overview New updates and improvements Welcome to our product changelog! Here you'll find a comprehensive list of all updates, improvements, and new features we've added to our platform. We update this change log with every new feature release or important updates. Key highlights from recent updates include: * Voice chat widget which can be embedded on any website * Support to buy and manage your phone numbers directly from Trata platform * Docs portal for end users to know and understand various features of Trata platform & API reference for developers to easily integrate with Trata platform * Added more language accent support (Now Trata supports - English American, English British, English Australian & Hindi India) * Other conversation quality improvements - Now users can embed Trata widget in their website and enable voice chat for their customers. - Trata now supports self sign up and self onboarding for their customers. - Now users can invite their team members to join their Trata Organization and manage their access control from Trata platform. - Trata allows users to buy and manage their phone numbers from Trata platform. # null Source: https://docs.trata.ai/home-page/AI-Agent # null Source: https://docs.trata.ai/home-page/contacts # null Source: https://docs.trata.ai/home-page/conversations # null Source: https://docs.trata.ai/home-page/integrations # null Source: https://docs.trata.ai/home-page/quickstart This is a quickstart guide to help you get started with Trata. ## 1. Create a Trata account 1. Go to [Trata](https://app.trata.ai) and sign up with your email. We are a self sign up platform and you can start using Trata right away with a free plan with 20 call minute credits. 2. Once you sign up, you will be redirected to the dashboard. 3. Click on the "Create" button on the top right to create your first AI agent. ## 2. Create an AI agent ### 2.1. Create an agent profile This is the first step in creating an exclusive AI agent for your business. This step is about setting the personality of your agent. 1. Now you will be redirected to the AI agent creation page. Create an AI agent 2. You are expected to provide the name, timezone, voice and language configurations of the agent. 3. You are also expected to provide the role name and the role description for the agent. You can select the role from one of the pre-defined roles or add a custom role. 4. Also you have to fill in how the agent should start and end the conversation. ### 2.2. Training the agent This step is about training the agent to understand your business. You are expected to provide some information in the form of website URLs, docs (PDFs, Word docs, TXT files) for agent to train and understand your business. Training an AI agent 1. Click on the "Train" section on the top section header. 2. Add the training "Prompt" which again you can find pre-defined prompts from the Trata platform which you can use or you can add your own custom prompt from the pre-defined templates 3. Add the training "Files" which are the documents you want the agent to train on. 4. If you are using website URLs and want to extract infromation from all child pages from the sitemap.xml then check the "Do you want to crawl the child pages of the website?" checkbox. Click on the "+" icon to add the website URL. 5. Post that click on "Create new Agent" button to create the agent. ## 3. Make a conversation with the agent After you created an AI agent, wait for few minutes (\< 5 minutes) for the agent to be ready if you have provide website URLs as it takes time to crawl the child pages and extract information. You can see an indicator in the Train section which shows the status of the website crawling or file reading status. Post that, you have successfully configured an AI agent for your business. Its ready strike up a conversation with the agent. Trata supports multiple conversation channels for voice like Twilio, Web socket and also through Trata widgets. For this quickstart, we will be using Trata's web widget which you can access from the "Test Agent" button in the AI agent detail page. Test Agent Click on the Phone call icon in the widget to start a conversation with the agent. You can talk to the agent and ask questions about your business. ## 4. Check the conversation logs, contacts and analytics ### 4.1. Conversation logs Now as you have successfully made a conversation with the agent, you can check the conversation logs from the "Call" section where you can see the conversation transcript, call rececordings and call summary details. Call Logs ### 4.2. Call analytics Also you can check the analytics from the "Dashboard" section where you can see the conversation summary, conversation duration, conversation sentiment and conversation topics. Dashboard Now you are ready to scale your business with Trata. But Trata provides more features that this quickstart guide covers, you can check in the features section to know about the details.