# API Reference
Source: https://docs.eusate.com/modules/devspace/api-reference
API documentation for DevSpace callback endpoints
## Authentication Callback
This endpoint receives authentication data from your login system after a customer successfully authenticates.
### Base URL
All API endpoints use the following base URL:
POST `{api_base_url}/api/v1/lab/login/callback/`
You must authenticate this request using your API key from the platform settings.
### Header
```
Authorization: Bearer YOUR_API_KEY
```
You can find your API key in the platform settings. Create one if you haven't already.
### Request Body
The authentication token for the customer. This token will be used by Sate to make authenticated requests to your functions.
The expiration time of the authentication token as a Unix timestamp in seconds.
The state parameter that was included in the original login URL. This is used to match the authentication response with the correct session.
### Example Request
```json theme={null}
{
"auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"auth_token_expires_at_seconds": 1693440000,
"state": "abc123def456"
}
```
### Response
#### Success Response
Returns HTTP status `200` when the authentication is processed successfully:
```json theme={null}
{
"success": true
}
```
#### Error Responses
Returns HTTP status `400` or `403` with error details when there are issues:
```json theme={null}
{
"detail": "Error description explaining what went wrong"
}
```
### Status Codes
Authentication token processed successfully
Missing required parameters, invalid data format, or validation errors
Authentication failed or access denied
## Security Considerations
Always validate the state parameter to ensure the authentication response corresponds to a legitimate login request initiated by your system.
Store minimal information in tokens and implement proper token rotation and revocation mechanisms.
### Best Practices
1. **API Key Security**: Store your API key securely and never expose it in client-side code
2. **Validate State**: Always verify the state parameter matches an active login session
3. **Token Security**: Use secure token generation and storage practices
4. **Expiration**: Set appropriate token expiration times
5. **HTTPS Only**: Ensure all communication uses HTTPS
6. **Error Handling**: Implement proper error handling and logging
## Testing the Integration
### Using cURL
```bash theme={null}
API_BASE_URL="{api_base_url}"
curl -X POST ${API_BASE_URL}/api/v1/lab/login/callback/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"auth_token": "test_token_123",
"auth_token_expires_at_seconds": 1693440000,
"state": "test_state_456"
}'
```
### Testing Checklist
* [ ] Callback endpoint accepts all required parameters
* [ ] State parameter validation works correctly
* [ ] Token expiration is handled properly
* [ ] Error responses are returned for invalid requests
* [ ] HTTPS is enforced for all requests
## Troubleshooting
### Common Issues
**400 Bad Request**: Check that all required fields are included and properly formatted
**403 Forbidden**: Verify the API key is correct and has proper permissions
### Debug Mode
During development, you can enable debug logging to see detailed request/response information in your DevSpace dashboard.
# Authentication Configuration
Source: https://docs.eusate.com/modules/devspace/authentication
Configure how Sate authenticates with your protected endpoints
## Overview
Authentication configuration allows Sate to access your protected endpoints on behalf of your customers. This enables secure, personalized interactions while maintaining proper authorization controls.
## Authentication Types
DevSpace supports both authenticated and unauthenticated functions:
* **Unauthenticated functions**: Public endpoints that don't require user credentials
* **Authenticated functions**: Protected endpoints that require customer authentication
## Configuration Settings
Set up authentication on the DevSpace platform by providing:
The endpoint where customers will authenticate
Where the auth token should be placed (header, query, body)
The type of authentication (Bearer, API Key, etc.)
Label and value format for authorization headers
## Authentication Flow
Here's how Sate handles authentication when executing protected functions:
Sate determines it needs to call an authenticated function to help the customer
If the customer isn't authenticated, Sate sends them your configured login URL
Customer clicks the link and enters their credentials on your platform
Your platform validates credentials and sends authentication data to our callback
Sate uses the received token to execute the function on the customer's behalf
## Implementation Requirements
To use authenticated functions, your login endpoint must:
### 1. Accept State Parameter
Your login URL must accept a `state` parameter that we'll include:
```
https://yourapp.com/login?state=ABC123
```
### 2. Implement Callback Integration
After successful authentication, send a POST request to our callback endpoint:
**Endpoint**: `https://api.eusate.com/api/v1/lab/login/callback/`
**Authentication**: You must include your API key in the Authorization header. Get your API key from the platform settings.
**Required Headers**:
* `Authorization: Bearer YOUR_API_KEY`
* `Content-Type: application/json`
**Required Body Parameters**:
* `auth_token`: The customer's authentication token
* `auth_token_expires_at_seconds`: Token expiration time (Unix timestamp)
* `state`: The state parameter from the original login URL
## Security Considerations
Always validate the state parameter to prevent CSRF attacks and ensure tokens are properly scoped to the authenticated user.
Tokens should have appropriate expiration times and be invalidated after use when possible.
## Next Steps
* [Create your first function](/modules/devspace/functions)
* [Review the callback API reference](/modules/devspace/api-reference)
* [Test your authentication flow](/modules/devspace/testing)
# Functions
Source: https://docs.eusate.com/modules/devspace/functions
Create HTTP endpoints that SATE can execute to perform actions
## Overview
Functions are HTTP endpoints that SATE can call to perform actions on your behalf. They extend your SATE capabilities beyond simple knowledge retrieval to include real-time data access and system interactions.
## Current Capabilities
Currently, only `GET` functions are supported. Support for `POST`, `PATCH`, and `DELETE` methods is coming soon. MCP (Model Context Protocol) support is also planned.
## Creating a Function
Navigate to the DevSpace platform and follow these steps:
Click the "Functions" tab in your DevSpace dashboard
Click "Add new function" to start the creation process
Fill in the required function details
## Function Configuration
When creating a function, provide the following information:
### Basic Information
A clear, descriptive name for your function (e.g., "get\_order\_status")
Detailed description of what the function does and when Sate should use it
The complete URL of your HTTP endpoint. Path and query parameters will be automatically extracted from the URL.
### Parameter Configuration
For each parameter automatically detected from your URL, you need to configure:
Clear description of what this parameter represents
The parameter data type: `string`, `boolean`, or `number`
Who provides this parameter value:
* `organisation`: You provide the value
* `sate`: SATE determines the value from context
#### Organization-Provided Parameters
When you select `organisation` as the provider, you have two options:
1. **Direct Value**: Provide a static value for the parameter
2. **Leaf Function**: Reference another function that returns the parameter value
##### Using Leaf Functions
A leaf function is a simple function without any parameters that returns data. Requirements:
* Must be a function without path or query parameters
* If the main function is unauthenticated, the leaf function must also be unauthenticated
* You can optionally specify a `response_path` to extract specific data from the leaf function's response
### Security & Environment
Whether this function requires customer authentication
Set to "live" for customer use or "dev" for testing only
## Function Examples
### Simple Function (No Parameters)
```http theme={null}
GET /api/store-hours
```
**Configuration:**
* **Name**: `get_store_hours`
* **Description**: "Returns current store operating hours and holiday schedules"
* **Authentication**: Not required
* **Environment**: Live
### Function with Sate-Provided Parameters
```http theme={null}
GET /api/orders/{order_id}
```
**Configuration:**
* **Name**: `get_order_details`
* **Description**: "Retrieves detailed information about a specific customer order"
* **Authentication**: Required
* **Environment**: Live
**Parameter Configuration:**
* `order_id` (string): The unique order identifier
* **Provider**: `SATE` will extract from customer conversation
* **Description**: "Customer's order ID they're asking about"
### Function with Organization-Provided Parameters
```http theme={null}
GET /api/products?category={category}&limit={limit}
```
**Configuration:**
* **Name**: `get_products_by_category`
* **Description**: "Retrieves products filtered by category with pagination"
* **Authentication**: Not required
* **Environment**: Live
**Parameter Configuration:**
* `category` (string): Product category to filter by
* **Provider**: `SATE` determines from customer request
* **Description**: "Product category the customer is interested in"
* `limit` (number): Maximum number of products to return
* **Provider**: `organisation` (you set a static value like 20)
* **Description**: "Number of products to return per request"
### Function Using Leaf Function
```http theme={null}
GET /api/user/{user_id}/preferences?store_id={store_id}
```
**Configuration:**
* **Name**: `get_user_preferences`
* **Description**: "Retrieves user preferences for a specific store"
* **Authentication**: Required
* **Environment**: Live
**Parameter Configuration:**
* `user_id` (string): The user's unique identifier
* **Provider**: `SATE` gets from authentication context
* **Description**: "ID of the authenticated user"
* `store_id` (string): The store location identifier
* **Provider**: `organisation` (use leaf function)
* **Leaf Function**: `get_default_store` (returns store information)
* **Response Path**: `store.id` (extracts store ID from response)
## Best Practices
### Function Naming
* Use clear, action-oriented names
* Follow consistent naming conventions
* Include the resource being accessed (e.g., `get_user_orders`, `check_inventory_status`)
### Descriptions
* Explain when Sate should use this function
* Describe the expected response format
* Include any important limitations or requirements
### Parameter Configuration
* Choose the appropriate provider (`sate` vs `organisation`) for each parameter
* Use leaf functions for dynamic organization-provided values
* Provide clear descriptions to help Sate understand parameter usage
* Use appropriate data types (string, number, boolean) for validation
## Response Handling
Your endpoints should return structured JSON responses that Sate can easily interpret:
```json theme={null}
{
"success": true,
"data": {
// Your response data
},
"message": "Optional human-readable message"
}
```
Ensure your endpoints handle errors gracefully and return appropriate HTTP status codes.
## Testing Functions
Before deploying functions to production:
1. **Test endpoints independently** - Verify your APIs work correctly
2. **Use development environment** - Set functions to "dev" mode initially
3. **Test authentication flow** - Ensure auth integration works properly
4. **Validate with Sate** - Test the complete interaction flow
## Monitoring and Debugging
Monitor your function usage through:
* Server logs for your endpoints
* DevSpace analytics (coming soon)
* Customer interaction feedback
## Next Steps
* [Set up authentication](/modules/devspace/authentication) for protected functions
* [Review API reference](/modules/devspace/api-reference) for callback endpoints
# DevSpace Overview
Source: https://docs.eusate.com/modules/devspace/introduction
Enable SATE to interact with your infrastructure
DevSpace enables SATE to go beyond knowledge base responses by executing custom functions that interact with your infrastructure.
## What is DevSpace?
DevSpace allows you to create tools and functions that give Sate enhanced capabilities for customer support. Instead of escalating complex requests to humans, Sate can perform actions directly through your APIs.
### Example Use Case
Consider an e-commerce scenario:
1. A customer requests a refund through your support channels
2. Sate needs to verify the order exists and check refund eligibility
3. With DevSpace functions like `get_order` and `process_refund`, Sate can handle this automatically
4. The customer gets immediate assistance without human intervention
## Core Components
DevSpace consists of two main sections:
Configure how Sate authenticates with your protected endpoints
Create HTTP endpoints that Sate can call to perform actions
## Getting Started
1. **Set up authentication** - Configure how Sate will authenticate with your APIs
2. **Create functions** - Define the endpoints Sate can call
3. **Test and deploy** - Validate your setup before going live
Configure your DevSpace settings on the platform
## What's Next?
* Learn about [authentication configuration](/modules/devspace/authentication)
* Create your first [function](/modules/devspace/functions)
* Review the [API reference](/modules/devspace/api-reference) for callback endpoints
# API Integration
Source: https://docs.eusate.com/modules/helpdesk/api
Integrate Eusate Helpdesk using RESTful API and real-time Socket.IO
## Overview
The Helpdesk API provides a comprehensive solution for integrating customer support functionality into your applications. It combines RESTful HTTP endpoints for data retrieval with Socket.IO for real-time messaging.
While API integration offers maximum flexibility, we recommend using our [SDK](/modules/helpdesk/sdk) for faster implementation and built-in best practices.
## Prerequisites
To integrate with the Helpdesk API, you need:
* Ability to make HTTP requests
* Socket.IO client library for real-time communication
* Valid API key from your api key settings
## Integration Flow
Build a support interface where customers can send messages
Create a unique session\_id for each customer using your interface
Use the session\_id to retrieve existing customer conversations
Get individual messages for each conversation
Establish Socket.IO connection for live messaging
Listen and respond to real-time events for seamless communication
## Authentication
All API requests require authentication using your API key:
```http theme={null}
Authorization: Bearer YOUR_API_KEY
```
Keep your API key secure and never expose it in client-side code. Store it as an environment variable on your server.
## Base URL
All API endpoints use the following base URL:
## Quick Start Example
Here's a basic implementation flow:
```javascript theme={null}
const API_BASE_URL = '{api_base_url}';
// 1. Fetch customer conversations
const conversations = await fetch(`${API_BASE_URL}/api/v1/helpdesk/customer/${sessionId}/conversations/`, {
headers: {
'Authorization': `Bearer ${API_KEY}`
}
});
// 2. Connect to Socket.IO for real-time messaging
const socket = io(`${API_BASE_URL}/helpdesk?token_source=api&token=${API_KEY}`);
// 3. Handle connection
socket.on('connect', () => {
console.log('Connected to helpdesk');
});
// 4. Send customer message
socket.emit('support', {
session_id: sessionId,
message: customerMessage,
attachment: false,
ticket_chat_id: conversationId || null
});
// 5. Listen for responses
socket.on('support', (response) => {
if (response.status_code === 200) {
displayMessage(response.data);
}
});
```
## Next Steps
Explore all available REST API endpoints
Learn about real-time messaging events
## Implementation Guides
* [Complete API Reference](/modules/helpdesk/api-reference) - All endpoints and parameters
* [Socket.IO Events](/modules/helpdesk/socketio) - Real-time messaging guide
* [SDK Alternative](/modules/helpdesk/sdk) - Easier integration option
# API Reference
Source: https://docs.eusate.com/modules/helpdesk/api-reference
Complete reference for Helpdesk REST API endpoints
## Authentication
All API requests require authentication using your API key in the Authorization header:
```http theme={null}
Authorization: Bearer YOUR_API_KEY
```
## Base URL
## Endpoints
### Get Conversations
Retrieve all conversations for a customer session.
GET `{api_base_url}/api/v1/helpdesk/customer/{session_id}/conversations/`
#### Parameters
Unique identifier for the customer session
#### Query Parameters
Filter conversations by status. Accepts: `true`, `t`, `yes`, `1` (true), anything else is false
#### Response
Array of conversation objects
**Conversation Object:**
Unique conversation identifier
ISO timestamp of creation
ISO timestamp of last update
Whether the conversation is closed
Whether support closure was requested
Customer read status
Agent read status
Current responder: `"agent"` or `"sate"`
Ticket identifier
Ticket slug for URLs
Most recent message in the conversation
#### Example Response
```json theme={null}
[
{
"id": "conv_123",
"date_created": "2024-01-15T10:30:00Z",
"date_updated": "2024-01-15T11:45:00Z",
"closed": false,
"close_support": false,
"read_by_customer": true,
"read_by_agent": false,
"responder": "sate",
"ticket": "ticket_456",
"ticket_slug": "customer-inquiry-456",
"latest_message": {
"id": "msg_789",
"date_created": "2024-01-15T11:45:00Z",
"date_updated": "2024-01-15T11:45:00Z",
"message": "I can help you with that issue.",
"sender": "sate",
"is_attachment": false,
"attachment_metadata": null,
"ticket_chat": "conv_123"
}
}
]
```
#### Status Codes
Conversations retrieved successfully
Invalid parameters or malformed request
Invalid or missing API key
Access denied for this resource
***
### Get Conversation Messages
Retrieve all messages for a specific conversation.
GET `{api_base_url}/api/v1/helpdesk/customer/{session_id}/conversations/{conversation_id}/messages/`
#### Parameters
Unique identifier for the customer session
Unique identifier for the conversation
#### Response
Conversation identifier
ISO timestamp of creation
ISO timestamp of last update
Whether the conversation is closed
Whether support closure was requested
Customer read status
Agent read status
Current responder: `"agent"` or `"sate"`
Ticket identifier
Array of message objects in chronological order
**Message Object:**
Unique message identifier
ISO timestamp of creation
ISO timestamp of last update
Message content
Message sender: `"sate"`, `"agent"`, or `"customer"`
Whether this message contains an attachment
Attachment details (if is\_attachment is true)
Associated conversation ID
#### Example Response
```json theme={null}
{
"id": "conv_123",
"date_created": "2024-01-15T10:30:00Z",
"date_updated": "2024-01-15T11:45:00Z",
"closed": false,
"close_support": false,
"read_by_customer": true,
"read_by_agent": false,
"responder": "sate",
"ticket": "ticket_456",
"messages": [
{
"id": "msg_001",
"date_created": "2024-01-15T10:30:00Z",
"date_updated": "2024-01-15T10:30:00Z",
"message": "Hello, I need help with my order",
"sender": "customer",
"is_attachment": false,
"attachment_metadata": null,
"ticket_chat": "conv_123"
},
{
"id": "msg_002",
"date_created": "2024-01-15T10:31:00Z",
"date_updated": "2024-01-15T10:31:00Z",
"message": "I'd be happy to help you with your order. Could you provide your order number?",
"sender": "sate",
"is_attachment": false,
"attachment_metadata": null,
"ticket_chat": "conv_123"
}
]
}
```
#### Status Codes
Messages retrieved successfully
Invalid parameters or malformed request
Invalid or missing API key
Access denied for this resource
## Error Responses
All error responses follow this format:
```json theme={null}
{
"detail": "Error description explaining what went wrong"
}
```
## Next Steps
* [Socket.IO Events](/modules/helpdesk/socketio) for real-time messaging
* [SDK Integration](/modules/helpdesk/sdk) for easier implementation
# Discord Integration
Source: https://docs.eusate.com/modules/helpdesk/discord
Connect your Discord server for AI-powered customer support
## Overview
Integrate Eusate with your Discord server to provide AI-powered support through direct messages. Perfect for gaming communities, developer servers, and any Discord-based customer support.
## Setup Process
Setting up Discord integration is simple and takes just a few minutes:
Go to integration settings on the platform
Click the Discord integration option to start the connection process
You'll be redirected to Discord to select your server and approve bot permissions
Return to the platform where the status will show as "Connected"
## Customer Experience
Once set up, your customers can get support by:
Customer sends a direct message to the Eusate bot
Bot asks customer to select which server they need help with
A private thread is created for the customer's support conversation
SATE provides assistance and can escalate to human agents if needed
## Managing Discord Support
All Discord conversations are managed through your helpdesk dashboard:
* **View all tickets** - See Discord conversations alongside other channels
* **Monitor responses** - Track SATE and human agent interactions
* **Escalate when needed** - Transfer conversations to human agents
* **Analytics and insights** - Understand support patterns and performance
Need help with Discord integration? The setup process is designed to be simple, but our support team is available if you encounter any issues.
# Helpdesk Overview
Source: https://docs.eusate.com/modules/helpdesk/introduction
Manage customer support tickets and conversations across multiple channels
The Helpdesk module enables you to manage customer support tickets and conversations across multiple integration channels. View, track, and respond to customer inquiries from a centralized dashboard.
## What is Helpdesk?
Helpdesk aggregates support tickets created from customer interactions across all your integrated channels. Whether customers reach out through your website, Discord, or other platforms, all conversations are unified in one place.
To know more channels, check integrations settings on the platform.
### Key Features
* **Unified ticket management** - All customer conversations in one dashboard
* **Multi-channel support** - SDK, API, Discord, and more integrations
* **Real-time messaging** - Instant communication with customers
* **AI and human agents** - Seamless handoff between SATE and human support
* **Conversation tracking** - Monitor ticket status and resolution progress
## Integration Channels
Choose how customers can reach your support team:
Easy-to-implement JavaScript SDK for web and mobile apps
RESTful API with real-time Socket.IO for custom implementations
Connect your Discord server for community support
## Getting Started
Select SDK, API, or Discord based on your platform needs
Set up API keys and authentication for secure communication
Create the support interface for your customers
Use the helpdesk dashboard to monitor and respond to tickets
View and manage customer support tickets on the platform
## What's Next?
* Learn about [SDK integration](/modules/helpdesk/sdk) for quick setup
* Explore [API integration](/modules/helpdesk/api) for custom implementations
* Review [Discord bot setup](/modules/helpdesk/discord) for community support
* Check the [API reference](/modules/helpdesk/api-reference) for technical details
# SDK Integration
Source: https://docs.eusate.com/modules/helpdesk/sdk
Add AI-powered customer support to your website in minutes with a single script
## Overview
The Eusate Messenger SDK is an embeddable chat widget. Drop it into any website and your customers get a fully functional, AI-powered support chat — no backend code required on your end.
It works as a floating button that opens a chat window. Everything inside (messages, calls, agent handover) is handled automatically.
Paste one line into your HTML. Best for static sites, plain HTML, or any site where you just want to get started.
Install via npm or yarn. Best for React, Next.js, Vue, Angular, Svelte, or any modern framework.
***
## Installation
### Script Tag (Quickest)
Paste this into your HTML, just before `
Welcome
`:
```html theme={null}
```
That's it — the chat widget will appear on your page.
The `v0` path auto-updates with bug fixes and new features within the current major version. To pin to an exact release for maximum stability, use a full version path: `https://cdn.eusate.com/messenger/v0.2.7/eusate-sdk.min.js`
### Node Packages
```bash theme={null}
npm install @eusate/messenger-sdk
# or
yarn add @eusate/messenger-sdk
# or
pnpm add @eusate/messenger-sdk
# or
bun add @eusate/messenger-sdk
```
***
## Quick Start
### Plain HTML
```html theme={null}