Skip to main content

API Integration Guide

Authentication

All API requests require a bearer token for authentication.
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Content-Type: application/json" \
     https://api.sadaa.ai/api/v1/agents

Creating Your First Agent

To create a new agent using the API (v2):
curl -X POST https://api.sadaa.ai/api/v2/agents \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "name=My First Agent" \
  -F "description=A helpful assistant" \
  -F "systemPrompt=You are a helpful assistant..." \
  -F "model=gpt-4" \
  -F "temperature=0.7"

Managing Your Agent

Get Agent Details

curl -X GET https://api.sadaa.ai/api/v1/agents/{agent_id} \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Update Agent Configuration

curl -X PATCH https://api.sadaa.ai/api/v1/agents/{agent_id} \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "name=Updated Agent Name" \
  -F "description=Updated description"

Generate Agent Questions

curl -X POST https://api.sadaa.ai/api/v1/agents/{agent_id}/generate-questions \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "count": 5
  }'

Managing Integrations

Detach Knowledge Store

curl -X DELETE https://api.sadaa.ai/api/v1/agents/{agent_id}/knowledge-store \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "knowledgeStoreId": "store_id"
  }'

Remove Voice Configuration

curl -X DELETE https://api.sadaa.ai/api/v1/agents/{agent_id}/voice-configs/{voice_config_id} \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Next Steps

Add voice capabilities to your agent Connect knowledge stores to your agent