Deploy Your Agent
Other Platforms
Deploy your thinnestAI agent to Discord, custom apps, mobile apps, and any platform via the REST API.
Other Platforms
Beyond the main channels, you can connect your agent to virtually any platform using webhooks or the REST API.
Discord
Deploy your agent as a Discord bot for community servers.
Setup
- Go to Discord Developer Portal
- Click New Application and name it
- Go to Bot > Add Bot
- Copy the Bot Token
- Under Privileged Gateway Intents, enable:
- Message Content Intent
- Server Members Intent
- Go to OAuth2 > URL Generator:
- Scopes:
bot - Bot Permissions:
Send Messages,Read Message History
- Scopes:
- Copy the generated URL and open it to invite the bot to your server
Configure in thinnestAI
- Open your agent > Deploy tab
- Select Discord
- Enter:
- Bot Token — From Discord Developer Portal
- Application ID — From General Information
- Click Save & Enable
Set Webhook
Configure the webhook URL in your Discord bot's interactions settings:
https://api.thinnest.ai/webhooks/discord/YOUR_AGENT_IDHow It Works
- Users @mention the bot or DM it
- The bot responds in the same channel/DM
- Each user gets their own conversation session
- Leads are automatically captured with Discord user ID
Mobile Apps
React Native
import { useState } from 'react';
const AGENT_ID = 'agent_abc123';
const API_KEY = 'ak_your_key';
export function useAgent() {
const [messages, setMessages] = useState([]);
const [sessionId] = useState(() => `mobile_${Date.now()}`);
const sendMessage = async (text) => {
setMessages(prev => [...prev, { role: 'user', content: text }]);
const response = await fetch(`https://api.thinnest.ai/v1/agents/${AGENT_ID}/chat`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
message: text,
session_id: sessionId,
}),
});
const data = await response.json();
setMessages(prev => [...prev, { role: 'assistant', content: data.response }]);
};
return { messages, sendMessage };
}Flutter
import 'dart:convert';
import 'package:http/http.dart' as http;
class AgentService {
static const _agentId = 'agent_abc123';
static const _apiKey = 'ak_your_key';
final String sessionId;
AgentService() : sessionId = 'flutter_${DateTime.now().millisecondsSinceEpoch}';
Future<String> sendMessage(String message) async {
final response = await http.post(
Uri.parse('https://api.thinnest.ai/v1/agents/$_agentId/chat'),
headers: {
'Authorization': 'Bearer $_apiKey',
'Content-Type': 'application/json',
},
body: jsonEncode({
'message': message,
'session_id': sessionId,
}),
);
final data = jsonDecode(response.body);
return data['response'];
}
}Swift (iOS)
import Foundation
struct AgentService {
static let agentId = "agent_abc123"
static let apiKey = "ak_your_key"
let sessionId = "ios_\(Int(Date().timeIntervalSince1970))"
func sendMessage(_ message: String) async throws -> String {
let url = URL(string: "https://api.thinnest.ai/v1/agents/\(Self.agentId)/chat")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer \(Self.apiKey)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONEncoder().encode([
"message": message,
"session_id": sessionId,
])
let (data, _) = try await URLSession.shared.data(for: request)
let response = try JSONDecoder().decode([String: String].self, from: data)
return response["response"] ?? ""
}
}Custom Webhooks
Build your own integration by forwarding messages to the REST API:
# Example: Custom webhook handler
from fastapi import FastAPI
import httpx
app = FastAPI()
AGENT_ID = "agent_abc123"
API_KEY = "ak_your_key"
@app.post("/my-webhook")
async def handle_webhook(request: dict):
user_message = request["message"]
user_id = request["user_id"]
async with httpx.AsyncClient() as client:
response = await client.post(
f"https://api.thinnest.ai/v1/agents/{AGENT_ID}/chat",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"message": user_message,
"session_id": f"custom_{user_id}",
},
)
return {"reply": response.json()["response"]}Shopify
Add the chat widget to your Shopify store:
- Go to Online Store > Themes > Edit code
- Open
theme.liquid - Before the closing
</body>tag, add:
<script
src="https://app.thinnest.ai/embed.js"
data-agent-id="YOUR_AGENT_ID"
data-theme="light"
data-welcome-message="Hi! Need help finding something?"
async
></script>- Save
Webflow
- Go to Project Settings > Custom Code
- In the Footer Code section, add the embed script
- Publish your site
Squarespace
- Go to Settings > Advanced > Code Injection
- In the Footer section, add the embed script
- Save
Wix
- Go to your site editor
- Click Add > Embed > Custom Embeds > Embed a Widget
- Click Enter Code and paste the embed script
- Position the widget and publish
Bubble.io
- Add an HTML element to your page
- Paste the embed script in the element's HTML content
- Preview and deploy
Any Platform
The REST API works with any platform that can make HTTP requests. The general pattern is:
- Receive a message from your platform
- Forward it to
POST /v1/agents/{agent_id}/chatwith your API key - Return the response to the user
This works for:
- Email bots (via SendGrid, Mailgun webhooks)
- SMS (via Twilio, directly — not WhatsApp)
- Voice assistants (via speech-to-text + text-to-speech)
- IoT devices
- Game chat systems
- Internal tools and dashboards