Integrations

Integrations API

The Integrations API allows you to connect your AI agents with external services and platforms. Integrations enable agents to access third-party data, perform actions, and communicate through various channels.

Base URL

https://api.aloochat.ai/api/public

Authentication

All requests require an API key in the x-api-key header:

x-api-key: your_api_key_here

Endpoints Overview

MethodEndpointDescription
GET/integrationsList all integrations
POST/integrationsCreate a new integration
GET/integrations/{id}Get integration by ID
PUT/integrations/{id}Update an integration
DELETE/integrations/{id}Delete an integration
GET/integrations/typesGet available integration types

Integration Properties

PropertyTypeDescription
idstringUnique integration identifier (UUID)
namestringIntegration name
typestringIntegration type (e.g., “shopify”, “zendesk”)
configobjectIntegration configuration
is_activebooleanWhether the integration is active
visibilitystringVisibility: “private” or “public”
company_idstringAssociated company ID
agent_idstringLinked agent ID (optional)

Supported Integration Types

TypeDescription
shopifyShopify e-commerce platform
zendeskZendesk customer support
hubspotHubSpot CRM
slackSlack messaging
whatsappWhatsApp Business
notionNotion workspace
odooOdoo ERP
google_calendarGoogle Calendar
gmailGmail email
custom_apiCustom REST API

List Integrations

Retrieve all integrations for your company.

Endpoint: GET /integrations

curl -X GET "https://api.aloochat.ai/api/public/integrations" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json"

Response

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "My Shopify Store",
    "type": "shopify",
    "config": {
      "shop_domain": "mystore.myshopify.com",
      "api_version": "2024-01"
    },
    "is_active": true,
    "visibility": "private",
    "company_id": "123e4567-e89b-12d3-a456-426614174000",
    "agent_id": "456e7890-e89b-12d3-a456-426614174001"
  },
  {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "name": "Support Zendesk",
    "type": "zendesk",
    "config": {
      "subdomain": "mycompany",
      "email": "support@mycompany.com"
    },
    "is_active": true,
    "visibility": "private",
    "company_id": "123e4567-e89b-12d3-a456-426614174000",
    "agent_id": null
  }
]

Create Integration

Create a new integration for your company.

Endpoint: POST /integrations

Request Body

FieldTypeRequiredDescription
namestringYesIntegration name
typestringYesIntegration type
configobjectNoConfiguration object
is_activebooleanNoActive status (default: true)
visibilitystringNoVisibility (default: “private”)
agent_idstringNoLink to specific agent

Shopify Integration Example

curl -X POST "https://api.aloochat.ai/api/public/integrations" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Shopify Store",
    "type": "shopify",
    "config": {
      "shop_domain": "mystore.myshopify.com",
      "access_token": "shpat_xxxxxxxxxxxxx",
      "api_version": "2024-01"
    },
    "is_active": true,
    "visibility": "private"
  }'

Zendesk Integration Example

curl -X POST "https://api.aloochat.ai/api/public/integrations" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Zendesk",
    "type": "zendesk",
    "config": {
      "subdomain": "mycompany",
      "email": "support@mycompany.com",
      "api_token": "your_zendesk_api_token"
    },
    "is_active": true
  }'

Google Calendar Integration Example

curl -X POST "https://api.aloochat.ai/api/public/integrations" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Company Calendar",
    "type": "google_calendar",
    "config": {
      "calendar_id": "meetings@mycompany.com",
      "timezone": "Asia/Kuwait"
    },
    "is_active": true
  }'

Get Integration

Retrieve a specific integration by ID.

Endpoint: GET /integrations/{id}

curl -X GET "https://api.aloochat.ai/api/public/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: your_api_key_here"

Update Integration

Update an existing integration.

Endpoint: PUT /integrations/{id}

curl -X PUT "https://api.aloochat.ai/api/public/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Integration Name",
    "is_active": false,
    "config": {
      "shop_domain": "newstore.myshopify.com"
    }
  }'

Delete Integration

Delete an integration.

Endpoint: DELETE /integrations/{id}

curl -X DELETE "https://api.aloochat.ai/api/public/integrations/550e8400-e29b-41d4-a716-446655440000" \
  -H "x-api-key: your_api_key_here"

Get Integration Types

Retrieve all available integration types.

Endpoint: GET /integrations/types

curl -X GET "https://api.aloochat.ai/api/public/integrations/types" \
  -H "x-api-key: your_api_key_here"

Response

[
  {
    "type": "shopify",
    "name": "Shopify",
    "description": "E-commerce platform integration for product catalog, orders, and inventory"
  },
  {
    "type": "zendesk",
    "name": "Zendesk",
    "description": "Customer support platform for ticket management and help desk"
  },
  {
    "type": "hubspot",
    "name": "HubSpot",
    "description": "CRM platform for contacts, deals, and marketing automation"
  },
  {
    "type": "google_calendar",
    "name": "Google Calendar",
    "description": "Calendar integration for scheduling meetings and events"
  },
  {
    "type": "gmail",
    "name": "Gmail",
    "description": "Email integration for sending and receiving emails"
  },
  {
    "type": "slack",
    "name": "Slack",
    "description": "Team messaging platform integration"
  },
  {
    "type": "notion",
    "name": "Notion",
    "description": "Workspace integration for documents and databases"
  },
  {
    "type": "custom_api",
    "name": "Custom API",
    "description": "Connect to any REST API with custom configuration"
  }
]

Integration Configuration Examples

Shopify Configuration

{
  "shop_domain": "mystore.myshopify.com",
  "access_token": "shpat_xxxxxxxxxxxxx",
  "api_version": "2024-01"
}

Zendesk Configuration

{
  "subdomain": "mycompany",
  "email": "support@mycompany.com",
  "api_token": "your_zendesk_api_token"
}

HubSpot Configuration

{
  "access_token": "your_hubspot_access_token",
  "portal_id": "12345678"
}

Google Calendar Configuration

{
  "calendar_id": "meetings@mycompany.com",
  "timezone": "Asia/Kuwait",
  "credentials": {}
}

Custom API Configuration

{
  "base_url": "https://api.example.com",
  "auth_type": "bearer",
  "auth_token": "your_api_token",
  "headers": {
    "X-Custom-Header": "value"
  }
}

Error Responses

Status CodeDescription
400Bad Request - Invalid input data
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Integration not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Error Response Format

{
  "detail": "Integration not found"
}