Developer Docs
POST https://chatloka.net/api/v1/api-keys

Create API Key

Create a new API key. The token is only shown once.

Required scope: api-keys:manage

How to Use This Endpoint

1. Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Body Parameters

Field Type Required Description
name string Required Key name
description string Optional Key description
type string Optional full | limited | webhook | bot. Default limited
abilities array Optional Array of ability scopes
rate_limit_tier string Optional standard | high | enterprise

Request Body

application/json
{ "name": "Production Key", "type": "full", "abilities": ["conversations:read", "conversations:write"] }

Example Request

bash
curl -X POST 'https://chatloka.net/api/v1/api-keys' \
  -H 'Authorization: Bearer $API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{ "name": "Production Key", "type": "full", "abilities": ["conversations:read", "conversations:write"] }'

Response

201 Created
application/json
{
  "success": true,
  "data": {
    "id": 1,
    "uuid": "a1b2c3d4-...",
    "name": "Production Key",
    "token": "sk_live_...",
    "type": "limited",
    "abilities": ["conversations:read", "conversations:write"]
  },
  "message": "API key created. Save the token now - it will not be shown again."
}

Error Responses

401 UNAUTHORIZED
{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "Invalid or revoked API key" } }
403 FORBIDDEN
{ "success": false, "error": { "code": "FORBIDDEN", "message": "You do not have permission to access this resource." } }
422 VALIDATION_ERROR
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The given data was invalid.", "details": { "field": ["The field is required."] } } }
429 RATE_LIMIT_EXCEEDED
{ "success": false, "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Too many requests. Please slow down.", "retry_after": 60 } }
Start Today

Stop Losing Customers
to Slow Responses

Every minute you wait is revenue walking out the door. Join hundreds of businesses who transformed their customer communication with ChatOn.

50%
Faster Response
24/7
AI Support
40%
Higher Conversion
No credit card required
Setup in 5 minutes
Cancel anytime

βœ“ 30-day money-back guarantee

πŸͺ We use cookies

We use cookies and similar technologies to improve your experience, analyze traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. Privacy Policy & Cookie Policy.

Cookie Preferences

Choose which cookies you want to allow. Essential cookies are always required for the website to function.

Essential Cookies

Required for the website to function. Cannot be disabled.

Always On

Analytics Cookies

Help us understand how visitors interact with our website by collecting anonymous data.

Marketing Cookies

Used to track visitors across websites to display relevant advertisements.

βœ… Preferences saved!