Skip to main content

Overview

The iwy API provides everything you need to create and deploy conversational AI agents. There are two types of agents you can create:
Both types are production-ready and interchangeable. Use the same widgets and session APIs with either type. Choose based on your use case—many production systems use both.

Authentication

All API endpoints require a Bearer token.
Authorization: Bearer YOUR_API_KEY
Get your API key from app.iwy.ai/settings.

Base URL

https://api.iwy.ai/v1

Core Endpoints

These are the three endpoints you’ll use most often:
EndpointPurpose
POST /ephemeral-agentCreate a single-use agent
POST /agentCreate a permanent agent
POST /start-agent-sessionStart a video call session
Using iwy widgets? The <live-avatar> widget and meet.iwy.ai already call /start-agent-session for you automatically. You only need this endpoint if you’re building a custom integration with the Daily.co SDK.

Single-Use vs Permanent Agents

Single-Use Agents are created through the API and can only be activated once. After their first session ends (or the TTL expires), the agent ID becomes invalid. They don’t appear in your dashboard.Permanent Agents persist in your account forever. The same agent ID can be used for unlimited sessions. You can edit them anytime at dashboard.iwy.ai or via the API.
FeatureSingle-UsePermanent
Sessions per agent1Unlimited
Visible in dashboardNoYes
Editable after creationNoYes
Auto-expiresYes (TTL)No
Both are production-ready. Choose based on your architecture:
Use CaseRecommended
Same agent for all usersPermanent
Personalized agent per user/sessionSingle-Use
Want to edit config in dashboardPermanent
Config generated from your databaseSingle-Use
White-label / multi-tenant appsSingle-Use
Quick prototyping and testingPermanent
Many production systems use both: permanent agents for core experiences, single-use agents for personalization.
Yes! Both agent types work identically with:
  • All iwy widgets (<live-avatar>, etc.)
  • meet.iwy.ai hosted pages
  • The /start-agent-session API
  • Tool integrations
The only difference is lifecycle management—single-use agents expire, permanent agents persist.
Once a session starts with a single-use agent:
  1. The agent becomes “active” for that session
  2. When the session ends, the agent expires immediately
  3. Any further attempts to use that agent ID will fail
If no session ever starts, the agent expires after its TTL (time-to-live).
You can’t convert directly, but you can reuse configurations:
  1. Single-Use → Permanent: Use the same configuration object with POST /agent
  2. Permanent → Single-Use: Fetch config with GET /agent/{id}, then use it with POST /ephemeral-agent
This is useful for prototyping in the dashboard, then deploying as single-use agents.

Single-Use Agents

Create dynamic agents that activate once and then expire. Ideal for personalized, per-session experiences.

Create Single-Use Agent

POST
/ephemeral-agent
Creates an agent that can be activated once, then expires.
Request Body
configuration
object
required
Agent configuration including LLM, TTS, and video settings.
ttl_seconds
integer
default:"600"
Maximum time (in seconds) before the agent expires if not activated. Common values: 600 (10 min), 3600 (1 hour), 86400 (24 hours).
Example Request
curl -X POST https://api.iwy.ai/v1/ephemeral-agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "configuration": {
      "llm": {
        "model": "gemini-2.0-flash",
        "provider": "google",
        "system_prompt": "You are a helpful assistant for a product demo",
        "first_message": "Welcome! How can I help you today?"
      },
      "tts": {
        "provider": "elevenlabs",
        "voice_id": "21m00Tcm4TlvDq8ikWAM"
      },
      "video": {
        "provider": "binary",
        "character_id": "0001"
      }
    },
    "ttl_seconds": 600
  }'
Response
{
  "agent": {
    "id": "550e8400-e29b-41d4-a716-446655440099",
    "expires_at": "2025-01-15T10:30:00.000Z",
    "created_at": "2025-01-15T10:20:00.000Z"
  }
}
Using the Agent
<live-avatar agentid="550e8400-e29b-41d4-a716-446655440099"></live-avatar>
<script src="https://unpkg.com/@iwy/live-widgets@latest/dist/live-avatar.min.js"></script>

Permanent Agents

Create reusable agents that persist in your account. Configure them anytime at dashboard.iwy.ai or via the API.

Create Permanent Agent

POST
/agent
Creates a reusable agent that persists in your account.
Request Body
name
string
required
Human-readable name for the agent (visible in dashboard)
publish_status
string
default:"draft"
Visibility status: draft, private, or public
configuration
object
required
Agent configuration (same structure as single-use agents, plus additional options)
Example Request
curl -X POST https://api.iwy.ai/v1/agent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Service Bot",
    "publish_status": "private",
    "configuration": {
      "llm": {
        "model": "gemini-2.0-flash",
        "provider": "google",
        "system_prompt": "You are a helpful customer service assistant",
        "first_message": "Hello! How can I help you today?"
      },
      "stt": {
        "model": "nova-3-general",
        "provider": "deepgram"
      },
      "tts": {
        "provider": "elevenlabs",
        "voice_id": "21m00Tcm4TlvDq8ikWAM"
      },
      "video": {
        "provider": "binary",
        "character_id": "0001"
      },
      "version": "1.0"
    }
  }'
Using the Agent
<live-avatar agentid="YOUR_AGENT_ID"></live-avatar>
<script src="https://unpkg.com/@iwy/live-widgets@latest/dist/live-avatar.min.js"></script>
Or share directly: https://meet.iwy.ai/YOUR_AGENT_ID

Sessions

Start video call sessions with your agents.
You probably don’t need this endpoint directly. The <live-avatar> widget and meet.iwy.ai call this automatically. Only use this if you’re building a custom integration with the Daily.co SDK.

Start Agent Session

POST
/start-agent-session
Starts a video call session with an agent. Returns Daily.co connection details.
Request Body
agentId
string
required
Agent UUID (works with both single-use and permanent agents), or "demo" for a demo session
Example Request
curl -X POST https://api.iwy.ai/v1/start-agent-session \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "550e8400-e29b-41d4-a716-446655440000"
  }'
Response
{
  "roomUrl": "https://iwy.daily.co/room-abc123",
  "dailyToken": "eyJ...",
  "webLink": "https://app.iwy.ai/call/room-abc123"
}
Usage Options
MethodWhen to use
<live-avatar> widgetRecommended for most integrations
meet.iwy.ai linkShare a direct link to your agent
Daily.co SDK with roomUrl + dailyTokenCustom video UI implementations
webLinkBrowser-based access without SDK

Advanced Endpoints

These endpoints provide additional management capabilities for permanent agents and tools.

Permanent Agent Management

EndpointMethodDescription
/agentGETList all permanent agents
/agent/{id}GETGet agent configuration
/agent/{id}PATCHUpdate agent settings
/agent/{id}DELETEDelete agent permanently
curl https://api.iwy.ai/v1/agent \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
[
  { "id": "550e8400-...", "name": "Customer Service Bot" },
  { "id": "550e8400-...", "name": "Sales Assistant" }
]
curl https://api.iwy.ai/v1/agent/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_KEY"
curl -X PATCH https://api.iwy.ai/v1/agent/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "configuration": {
      "llm": {
        "system_prompt": "You are an expert sales assistant",
        "first_message": "Welcome! Ready to explore our products?"
      }
    }
  }'
curl -X DELETE https://api.iwy.ai/v1/agent/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_KEY"

Tools

Tools are custom functions that extend your agent’s capabilities via webhooks.
EndpointMethodDescription
/toolGETList all tools
/toolPOSTCreate a new tool
/tool/{id}GETGet tool configuration
/tool/{id}PATCHUpdate tool settings
/tool/{id}DELETEDelete tool
/tool/{id}/testPOSTTest tool execution
curl -X POST https://api.iwy.ai/v1/tool \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "get_weather",
    "description": "Fetches the current weather for a given city",
    "server_url": "https://your-api.com/weather",
    "parameters_schema": {
      "type": "object",
      "required": ["city"],
      "properties": {
        "city": {
          "type": "string",
          "description": "City name (e.g., Paris, New York)"
        }
      }
    },
    "method": "POST",
    "headers": {
      "x-api-key": "your-webhook-api-key"
    }
  }'
curl -X POST https://api.iwy.ai/v1/tool/dcfae097-1b37-4444-bb0c-1a6abb0320fd/test \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": { "city": "Paris" }
  }'
Response
{
  "success": true,
  "execution_time_ms": 1234,
  "response_received": {
    "status": 200,
    "body": { "temperature": 18, "conditions": "Partly cloudy" }
  }
}

Error Responses

All endpoints return consistent error responses:
StatusDescription
400Bad request - validation failed
401Unauthorized - invalid or missing API key
404Not found - resource doesn’t exist
408Request timeout
500Internal server error
{
  "success": false,
  "error": "Error message",
  "details": "Additional context"
}

Quick Reference

Core Endpoints

EndpointMethodDescription
/ephemeral-agentPOSTCreate single-use agent
/agentPOSTCreate permanent agent
/start-agent-sessionPOSTStart video session (called automatically by widgets)

Management Endpoints

EndpointMethodDescription
/agentGETList permanent agents
/agent/{id}GETGet agent details
/agent/{id}PATCHUpdate agent
/agent/{id}DELETEDelete agent
/toolGETList tools
/toolPOSTCreate tool
/tool/{id}GETGet tool details
/tool/{id}PATCHUpdate tool
/tool/{id}DELETEDelete tool
/tool/{id}/testPOSTTest tool

Support

Need help? Contact us