API Keys
API keys are credentials that let your application connect to Delivery Chat when using the SDK or REST API. They are generated per application and scoped to that application only.
What are API Keys?
API keys authenticate your app when it talks to Delivery Chat. You need them when:
- Using the JavaScript/TypeScript SDK — To control the widget programmatically
- Using the REST API — To send messages, create visitors, or fetch conversations from your backend
You do not need an API key for the chat widget embed—the widget uses only your application ID (appId), which is public.
When Do You Need Them?
| Integration | API Key Required? |
|---|---|
| Chat Widget | No — use appId only |
| SDK | Yes |
| REST API | Yes |
Plan Limits
Each plan allows a certain number of API keys per application:
| Feature | Free | Basic | Premium | Enterprise |
|---|---|---|---|---|
| API Keys per Application | 3 | 5 | 10 | 1,000 |
How to Generate Keys
Generate your first API key
Open your application
Go to your dashboard → Applications → select the application you want to create a key for.
Go to API Keys
Open the API Keys section for that application.
Create a key
Click Create API Key. Give it a name (e.g., "Production Website") and choose the environment (live or test).
Copy the key immediately
The full key is shown only once at creation. Copy it and store it securely. You will not be able to see it again—only a masked version (e.g., dk_live_abc1****) will appear in the list.
Important
Store your API key securely. Never expose it in client-side code or public repositories. Use environment variables or a secret manager on your server.
Revoke vs Regenerate
Revoke — Use when a key is compromised or no longer needed. The key stops working immediately. There is no replacement.
Regenerate — Use when you want to rotate keys (e.g., for security). The old key is invalidated and a new one is created. The new key is shown once—copy it before closing.
Using Your Keys
For chat widget, you only need the application ID (appId). No API key is used.
For SDK or REST API, include the key in your requests. Example:
// SDK or REST API call
const response = await fetch("https://api.deliverychat.online/api/v1/conversations", {
headers: {
"Authorization": `Bearer ${apiKey}`,
"X-App-Id": appId,
"Content-Type": "application/json",
},
});The key goes in the Authorization header, and the application ID goes in X-App-Id.
Optional: Temporary Keys
When creating a key, you can set an expiration date. The key will stop working after that date. Useful for short-lived integrations or testing.