Oscar Chat API Documentation

Oscar Chat API Documentation

Build powerful integrations with the Oscar Chat platform. Manage workspaces, widgets, and user data programmatically.

Get Your API Token →

🚀 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

NameTypeRequiredDescription
tokenstringYour 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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
pageintegerPage number (default: 1)
limitintegerResults 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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
idintegerWorkspace ID (path parameter)
namestringNew 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

NameTypeRequiredDescription
tokenstringYour 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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
idintegerWidget 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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
namestringWidget name (body)
workspace_idintegerTarget 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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
idintegerWidget ID (path parameter)
statusstring“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

NameTypeRequiredDescription
tokenstringYour API token (path parameter)
idintegerWidget 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

FieldTypeDescription
idintegerUnique user ID
mailstringUser email address
first_namestringFirst name
last_namestringLast name
plan_expiration_datestring (ISO 8601)Plan expiry date
plan_namestringCurrent plan name
rulesRules objectAccount limits and features

Rules

FieldTypeDescription
idintegerRules ID
agentsintegerMax number of agents
intervalintegerPolling interval (seconds)
all_in_onebooleanAll-in-one feature access
workspacesintegerMax workspaces allowed
lead_magnetbooleanLead magnet feature
ai_assistantbooleanAI assistant feature
countsintegerMessage count limit

Workspace

FieldTypeDescription
idintegerUnique workspace ID
namestringWorkspace name
descriptionstringWorkspace description
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp

Widget

FieldTypeDescription
idintegerUnique widget ID
namestringWidget name
ownerintegerOwner user ID
statusstring“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.

PlanRequests/MinuteRequests/Day
Free301,000
Pro6010,000
Enterprise120Unlimited

When rate limited, the API returns 429 Too Many Requests. Implement exponential backoff in your integration.

⚠️ Error Handling

CodeMeaningDescription
400Bad RequestInvalid parameters or missing required fields
401UnauthorizedInvalid or expired API token
403ForbiddenInsufficient plan permissions
404Not FoundResource does not exist
429Rate LimitedToo many requests — slow down
500Server ErrorInternal 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.

Ready to Build?

Start integrating Oscar Chat into your applications today.

Get Started Free →