Oscar Chat API Documentation
Build powerful integrations with the Oscar Chat platform. Manage workspaces, widgets, and user data programmatically.
🚀 Getting Started
The Oscar Chat API allows developers to programmatically manage their chatbot workspaces and widgets. Whether you’re automating widget deployment, building a custom dashboard, or integrating Oscar Chat into your workflow — this API has you covered.
Base URL
https://api.oscarchat.ai
🔐 Authentication
All API requests are authenticated via a token embedded in the URL path. You can obtain your API token from the Oscar Chat Dashboard.
https://api.oscarchat.ai/{your-api-token}/endpoint
⚠️ Keep your token secret. Never expose it in client-side code or public repositories.
📡 Endpoints Reference
GET /{token}/me
Retrieve the authenticated user’s profile, including plan details and account rules.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
Request
curl -X GET https://api.oscarchat.ai/{token}/me
Response 200 OK
{
"id": 1234,
"mail": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"plan_expiration_date": "2026-12-31T23:59:59Z",
"plan_name": "Pro",
"rules": {
"id": 1,
"agents": 10,
"interval": 30,
"all_in_one": true,
"workspaces": 5,
"lead_magnet": true,
"ai_assistant": true,
"counts": 1000
}
}
GET /{token}/workspaces
List all workspaces for the authenticated user. Supports pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
page | integer | ❌ | Page number (default: 1) |
limit | integer | ❌ | Results per page (default: 20) |
Request
curl -X GET "https://api.oscarchat.ai/{token}/workspaces?page=1&limit=10"
Response 200 OK
[
{
"id": 1,
"name": "My Website",
"description": "Main website chatbot workspace",
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-20T14:22:00Z"
}
]
PUT /{token}/workspaces/{id}
Update the name of an existing workspace.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
id | integer | ✅ | Workspace ID (path parameter) |
name | string | ✅ | New workspace name (body) |
Request
curl -X PUT https://api.oscarchat.ai/{token}/workspaces/1 \
-H "Content-Type: application/json" \
-d '{"name": "Updated Workspace Name"}'
Response 200 OK
{
"id": 1,
"name": "Updated Workspace Name",
"description": "Main website chatbot workspace",
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-03-05T15:00:00Z"
}
GET /{token}/widgets
List all widgets owned by the authenticated user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
Request
curl -X GET https://api.oscarchat.ai/{token}/widgets
Response 200 OK
[
{
"id": 42,
"name": "Support Bot",
"owner": 1234,
"status": "active"
}
]
GET /{token}/widgets/{id}
Retrieve a specific widget by its ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
id | integer | ✅ | Widget ID (path parameter) |
Request
curl -X GET https://api.oscarchat.ai/{token}/widgets/42
Response 200 OK
{
"id": 42,
"name": "Support Bot",
"owner": 1234,
"status": "active"
}
POST /{token}/widgets/add
Create a new widget and assign it to a workspace.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
name | string | ✅ | Widget name (body) |
workspace_id | integer | ✅ | Target workspace ID (body) |
Request
curl -X POST https://api.oscarchat.ai/{token}/widgets/add \
-H "Content-Type: application/json" \
-d '{"name": "Sales Bot", "workspace_id": 1}'
Response 201 Created
{
"id": 43,
"name": "Sales Bot",
"owner": 1234,
"status": "active"
}
PUT /{token}/widgets/{id}/status
Activate or deactivate a widget.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
id | integer | ✅ | Widget ID (path parameter) |
status | string | ✅ | “active” or “inactive” (body) |
Request
curl -X PUT https://api.oscarchat.ai/{token}/widgets/42/status \
-H "Content-Type: application/json" \
-d '{"status": "inactive"}'
Response 200 OK
{
"id": 42,
"name": "Support Bot",
"owner": 1234,
"status": "inactive"
}
DELETE /{token}/widgets/{id}
Permanently delete a widget. This action cannot be undone.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Your API token (path parameter) |
id | integer | ✅ | Widget ID (path parameter) |
Request
curl -X DELETE https://api.oscarchat.ai/{token}/widgets/42
Response 204 No Content
Empty response body on successful deletion.
📦 Data Models
User
| Field | Type | Description |
|---|---|---|
id | integer | Unique user ID |
mail | string | User email address |
first_name | string | First name |
last_name | string | Last name |
plan_expiration_date | string (ISO 8601) | Plan expiry date |
plan_name | string | Current plan name |
rules | Rules object | Account limits and features |
Rules
| Field | Type | Description |
|---|---|---|
id | integer | Rules ID |
agents | integer | Max number of agents |
interval | integer | Polling interval (seconds) |
all_in_one | boolean | All-in-one feature access |
workspaces | integer | Max workspaces allowed |
lead_magnet | boolean | Lead magnet feature |
ai_assistant | boolean | AI assistant feature |
counts | integer | Message count limit |
Workspace
| Field | Type | Description |
|---|---|---|
id | integer | Unique workspace ID |
name | string | Workspace name |
description | string | Workspace description |
created_at | string (ISO 8601) | Creation timestamp |
updated_at | string (ISO 8601) | Last update timestamp |
Widget
| Field | Type | Description |
|---|---|---|
id | integer | Unique widget ID |
name | string | Widget name |
owner | integer | Owner user ID |
status | string | “active” or “inactive” |
Error
{
"error": "Description of what went wrong"
}
⏱️ Rate Limits
The Oscar Chat API enforces rate limiting to ensure fair usage and platform stability.
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Free | 30 | 1,000 |
| Pro | 60 | 10,000 |
| Enterprise | 120 | Unlimited |
When rate limited, the API returns 429 Too Many Requests. Implement exponential backoff in your integration.
⚠️ Error Handling
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Invalid parameters or missing required fields |
401 | Unauthorized | Invalid or expired API token |
403 | Forbidden | Insufficient plan permissions |
404 | Not Found | Resource does not exist |
429 | Rate Limited | Too many requests — slow down |
500 | Server Error | Internal error — contact support |
💻 Code Examples
cURL
# Get user info
curl -X GET https://api.oscarchat.ai/YOUR_TOKEN/me
# Create a widget
curl -X POST https://api.oscarchat.ai/YOUR_TOKEN/widgets/add \
-H "Content-Type: application/json" \
-d '{"name": "My Bot", "workspace_id": 1}'
JavaScript (fetch)
const TOKEN = 'YOUR_TOKEN';
const BASE = 'https://api.oscarchat.ai';
// Get user info
const user = await fetch(`${BASE}/${TOKEN}/me`).then(r => r.json());
console.log(user.plan_name);
// List widgets
const widgets = await fetch(`${BASE}/${TOKEN}/widgets`).then(r => r.json());
// Create a widget
const newWidget = await fetch(`${BASE}/${TOKEN}/widgets/add`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Sales Bot', workspace_id: 1 })
}).then(r => r.json());
Python (requests)
import requests
TOKEN = "YOUR_TOKEN"
BASE = f"https://api.oscarchat.ai/{TOKEN}"
# Get user info
user = requests.get(f"{BASE}/me").json()
print(user["plan_name"])
# List workspaces
workspaces = requests.get(f"{BASE}/workspaces", params={"page": 1, "limit": 10}).json()
# Create a widget
widget = requests.post(f"{BASE}/widgets/add", json={
"name": "Sales Bot",
"workspace_id": 1
}).json()
PHP
<?php
$token = 'YOUR_TOKEN';
$base = "https://api.oscarchat.ai/$token";
// Get user info
$user = json_decode(file_get_contents("$base/me"), true);
echo $user['plan_name'];
// Create widget
$ch = curl_init("$base/widgets/add");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['name' => 'Bot', 'workspace_id' => 1]),
CURLOPT_RETURNTRANSFER => true
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
?>
❓ Frequently Asked Questions
How do I get an API token?
Sign up or log in at app.oscarchat.ai and navigate to your account settings. Your API token is available in the developer section.
Is the API free to use?
Yes! All Oscar Chat plans include API access. Rate limits vary by plan — see the Rate Limits section above.
Can I use the API with my free account?
Absolutely. Free accounts have access to all API endpoints with standard rate limits.
What format does the API use?
All requests and responses use JSON. Set Content-Type: application/json for POST and PUT requests.
How do I report a bug or request a feature?
Contact our support team at support@oscarchat.ai or through the chat widget on our website.
Is there a sandbox environment?
Currently, we don’t offer a separate sandbox. We recommend creating a test workspace to experiment with the API safely.