> ## Documentation Index
> Fetch the complete documentation index at: https://sadaa-docs.actualize.ae/llms.txt
> Use this file to discover all available pages before exploring further.

# API Integration

> Create and manage AI agents programmatically

# API Integration Guide

## Authentication

All API requests require a bearer token for authentication.

```bash
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):

```bash
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

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

### Update Agent Configuration

```bash
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

```bash
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

```bash
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

```bash
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
