🔌 API Documentation

Integrate Aemira AI into your applications

← Back to Home

The Aemira AI API allows you to programmatically interact with your bots, manage conversations, and integrate AI-powered assistance into your applications. Our REST API uses standard HTTP methods and returns JSON responses.

Authentication

All API requests must be authenticated using an API key. You can generate API keys from your account dashboard under Settings → API Keys.

API Key Authentication

Include your API key in the request header:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Important: Keep your API keys secure. Never expose them in client-side code or public repositories.

Base URL

All API requests should be made to:

https://api.aemiraai.com/v1

Conversations API

POST /conversations/send

Send a message to a bot and receive a response.

Request Body

Parameter Type Required Description
bot_id string Yes Unique identifier for your bot
message string Yes User's message text
user_id string No Optional user identifier for tracking
session_id string No Session ID for conversation continuity

Example Request

curl -X POST https://api.aemiraai.com/v1/conversations/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "bot_id": "bot_abc123",
    "message": "How do I reset my password?",
    "user_id": "user_xyz789"
  }'

Example Response

{
  "success": true,
  "conversation_id": "conv_abc123",
  "response": "To reset your password, click on 'Forgot Password' on the login page...",
  "session_id": "sess_xyz789",
  "timestamp": "2024-12-11T13:45:00Z"
}
GET /conversations/{conversation_id}

Retrieve the full history of a conversation.

Example Response

{
  "success": true,
  "conversation_id": "conv_abc123",
  "messages": [
    {
      "role": "user",
      "content": "How do I reset my password?",
      "timestamp": "2024-12-11T13:45:00Z"
    },
    {
      "role": "assistant",
      "content": "To reset your password...",
      "timestamp": "2024-12-11T13:45:02Z"
    }
  ]
}

Bot Management API

GET /bots

List all bots in your account.

GET /bots/{bot_id}

Get details for a specific bot.

Rate Limits

API requests are rate-limited to ensure fair usage:

Rate limit information is included in response headers:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: 487
X-RateLimit-Reset: 1702310400

Error Codes

Code Status Description
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
403 Forbidden Insufficient permissions
404 Not Found Resource not found
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error, contact support

Need Help with the API?

Our support team can help you integrate Aemira AI into your applications.

Contact Support