Awentail


A
W
E

API Reference

The Awentail API lets you interact with your AI assistants programmatically. The chat endpoint is public (no authentication required) — it’s designed for widget embedding.

Base URL

https://app.awentail.com/api

Chat Endpoint

POST /api/chat/:botId

Send a message to an AI assistant and receive a response.

URL parameters:

ParameterTypeDescription
botIdstringUnique assistant identifier (UUID)

Request body:

{
  "message": "How do I reset my password?",
  "conversationId": "optional-conversation-id"
}
FieldTypeRequiredDescription
messagestringYesThe user’s message
conversationIdstringNoExisting conversation ID for context continuity

Response:

{
  "reply": "To reset your password, go to Settings > Security and click 'Change Password'. You'll need to enter your current password first.",
  "conversationId": "conv_abc123"
}
FieldTypeDescription
replystringAI-generated assistant response
conversationIdstringConversation ID for follow-up messages

Example:

curl -X POST https://app.awentail.com/api/chat/your-bot-id \
  -H "Content-Type: application/json" \
  -d '{"message": "What are your pricing plans?"}'

Rate Limiting

The chat endpoint is rate-limited to prevent abuse:

ScopeLimit
Per IP + Assistant30 requests/minute

When the limit is exceeded, the API returns a 429 Too Many Requests response.

Widget Configuration

GET /api/chat/:botId/config

Get an assistant’s widget configuration (name, welcome message, colors).

Response:

{
  "name": "Support Assistant",
  "welcomeMessage": "Hi! How can I help you today?",
  "color": "#7C3AED"
}

Error responses

All errors follow a consistent format:

{
  "error": "Error description"
}

Common error codes:

StatusMeaning
400Bad request — missing or invalid fields
404Assistant not found
429Rate limit exceeded
500Internal server error

Authentication

The chat endpoint does not require authentication. It’s designed for public use in embedded widgets.

All admin endpoints (creating assistants, uploading documents, viewing analytics) require a JWT token obtained by logging in. These endpoints are used internally by the Awentail dashboard and are not documented as a public API.

CORS

The chat API supports CORS from any origin, so the widget works on any website.

Webhooks

Awentail uses Stripe webhooks for billing events. If you need webhook notifications for chat events, contact us — we’re working on it.