cURL

Overview

The Acro SDK allows developers to seamlessly integrate with the Acro platform, providing detailed observability into the performance of your AI Assistants and chatbots. With this SDK, you can monitor conversations, analyze interactions, and enhance user experiences with ease.

Installation

No installation needed - cURL comes pre-installed on most systems. If not installed, you can get it from:

# Ubuntu/Debian
sudo apt-get install curl

# macOS (Homebrew)
brew install curl

Using the API

To send conversation data to the Acro platform, follow these steps:

Initialize the configuration

Log in to app.acro.so, create an application, and set up your credentials:

export APPLICATION_ID="your_application_id"
export APPLICATION_SECRET="your_application_secret"

export ACRO_URL="https://data.acro.so/$APPLICATION_ID/conversation"

Properties

Required Information

PropertyTypeRequiredDescriptionConstraints
conversationIdUUID stringYesUnique identifier for the conversationValid UUID format
linesArrayYesComplete transcript of the conversationSee Lines Schema below
startDate/stringYesWhen the conversation beganISO date string or Date object

End User Information

The person interacting with your AI Agent.

PropertyTypeRequiredDescriptionConstraints
customerIdstringNoUnique identifier for the customerMax 64 chars
customerEmailstringNoCustomer’s email addressMax 320 chars, valid email
customerPhonestringNoCustomer’s phone numberMax 128 chars

Agent Information

The AI Agent properties.

PropertyTypeRequiredDescriptionConstraints
agentIdstringNoIdentifier for the AI agentMax 64 chars
agentVersionstringNoVersion of the AI agentMax 128 chars

Client Information

This refers to the business using your AI Agent to run their operations.

PropertyTypeRequiredDescriptionConstraints
externalCompanyIdstringNoClient company identifierMax 64 chars
externalCompanyNamestringNoClient company nameMax 256 chars
externalCompanyTypestringNoIndustry/category of clientMax 128 chars

Conversation Metadata

More optional metadata so that we can analyze your agent.

PropertyTypeRequiredDescriptionConstraints
sourceEnumNoOrigin of conversationMax 64 chars
endDate/stringNoWhen conversation endedISO date string or Date object
durationnumberNoLength of conversationInteger (seconds)
transferbooleanNoWhether conversation was transferred-
completedbooleanNoWhether conversation finished normally-
textUrlstringNoURL to conversation transcriptValid URL
audioUrlstringNoURL to conversation recordingValid URL

Lines Schema

Each line in the lines array must conform to this structure:

PropertyTypeRequiredDescription
roleEnumYesWho is speaking/acting
contentstring|nullYesThe message content
timestampDate/stringNoWhen this line occurred

Valid Role Values

  • "AI_ASSISTANT": AI agent messages
  • "USER": End user messages
  • "HUMAN": Human agent messages
  • "TOOL": System actions/events
  • "assistant": Alternative for AI_ASSISTANT
  • "user": Alternative for USER
  • "tool": Alternative for TOOL
  • "system": System messages

Example Usage

# Configuration
export APPLICATION_ID="your_application_id"
export APPLICATION_SECRET="your_application_secret"
export ACRO_URL="https://data.acro.so/$APPLICATION_ID/conversation"

# Send request
curl -X POST "$ACRO_URL" \
  -H "Authorization: Bearer $APPLICATION_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "conversationId": "123e4567-e89b-12d3-a456-426614174000",
    "source": "mywebsite.com",
    "customerId": "cust_123",
    "start": "2024-09-11T16:55:49.789Z",
    "lines": [
      {
        "role": "AI_ASSISTANT",
        "content": "Hello! How can I help you today?",
        "timestamp": "2024-09-11T16:55:49.789Z"
      },
      {
        "role": "USER",
        "content": "I need help with my order",
        "timestamp": "2024-09-11T16:55:50.789Z"
      }
    ]
  }'

Response Types

Success Response

{
    "conversationId": "123e4567-e89b-12d3-a456-426614174000",
    "requestId": "req_abc123"
}

Error Response

{
    "error": "Error message description",
    "requestId": "req_abc123"
}

Need help? Join our Discord community or Schedule a meeting with us.