API Reference

Integrate enuchat into your systems using the Tenant API. Manage conversations, send messages, and access billing data programmatically.

Authentication

All API requests are authenticated using an API key sent in the X-Api-Key header.

Getting your API key

  1. Go to Settings → API Keys in your dashboard
  2. Click Create API Key and give it a name
  3. Copy the key immediately — it's only shown once
  4. Store it securely (environment variable, secrets manager)

Making requests

Include the key in every request:

curl -H "X-Api-Key: tak_your_key_here" \
     https://api.enuchat.com/api/v1/tenant-api/widgets

All responses are JSON. Successful responses have a data field. Errors have an error field with code and message.

Security: API keys are hashed (SHA-256) in our database. We never store the raw key. Treat your key like a password — don't commit it to code or share it publicly.

Base URL

https://api.enuchat.com/api/v1/tenant-api

All endpoints below are relative to this base URL.

Endpoints

GET /widgets

List all widgets for your account.

Response

{'{'}
  "data": [
{'{'}
      "id": "019d19c6-7e0b-...",
      "name": "Main Website Chat",
      "isActive": true,
      "aiEnabled": true,
      "translationEnabled": true,
      "primaryColor": "#2563eb",
      "position": "bottom-right"
    }
  ]
}

GET /conversations

List conversations, ordered by most recent message.

Query Parameters

ParameterTypeDescription
statusstringFilter by status: open, pending, closed
widgetIdstringFilter by widget UUID
limitintegerMax results (default 20, max 100)
offsetintegerSkip N results

Example

curl -H "X-Api-Key: tak_..." \
     "https://api.enuchat.com/api/v1/tenant-api/conversations?status=open&limit=10"

Response

{'{'}
  "data": [
{'{'}
      "id": "019d6724-000e-...",
      "widgetId": "019d19c6-7e0b-...",
      "visitorId": "v-abc123",
      "visitorName": "John",
      "visitorEmail": "john{'@'}example.com",
      "visitorLanguage": "en",
      "status": "open",
      "assignedTo": null,
      "lastMessageAt": "2026-04-11T14:30:00+00:00",
      "startedAt": "2026-04-11T14:25:00+00:00"
    }
  ]
}

GET /conversations/{'{'}id}

Get a conversation with all messages.

Query Parameters

ParameterTypeDescription
limitintegerMax messages (default 50, max 200)

Response

{'{'}
  "data": {'{'}
    "id": "019d6724-000e-...",
    "visitorLanguage": "en",
    "status": "open",
    "messages": [
{'{'}
        "id": "019d6724-1234-...",
        "role": "visitor",
        "content": "Hello, how much does it cost?",
        "contentLanguage": "en",
        "translatedContent": "Cześć, ile to kosztuje?",
        "translatedLanguage": "pl",
        "isAutoReply": false,
        "createdAt": "2026-04-11T14:25:30+00:00"
      },
{'{'}
        "id": "019d6724-5678-...",
        "role": "ai",
        "content": "Our plans start at €19/month...",
        "isAutoReply": true,
        "createdAt": "2026-04-11T14:25:32+00:00"
      }
    ]
  }
}

POST /conversations/{'{'}id}/messages

Send a message to a conversation. The message will be delivered to the visitor in real-time via the chat widget.

Request Body

{'{'}
  "content": "Thanks for reaching out! We'll process your request.",
  "role": "system"
}
FieldTypeDescription
contentstringRequired. The message text.
rolestringsystem (default) or operator

Response (201 Created)

{'{'}
  "data": {'{'}
    "id": "019d6725-abcd-...",
    "role": "system",
    "content": "Thanks for reaching out!",
    "createdAt": "2026-04-11T14:35:00+00:00"
  }
}

PATCH /conversations/{'{'}id}

Update a conversation's status or assignment.

Request Body

{'{'}
  "status": "closed"
}
FieldTypeDescription
statusstringopen, pending, or closed
assignedTostring|nullOperator UUID to assign, or null to unassign

GET /billing/balance

Get your current plan and credit balance.

Response

{'{'}
  "data": {'{'}
    "plan": "pro",
    "creditBalance": 4500000,
    "totalCreditsAdded": 10000000
  }
}

Error Handling

Errors return a non-2xx status code with a JSON body:

{'{'}
  "error": {'{'}
    "code": "NOT_FOUND",
    "message": "Conversation not found."
  }
}
HTTP StatusMeaning
401Invalid, expired, or missing API key
400Invalid request body or parameters
404Resource not found (or belongs to a different tenant)
500Server error

Common Use Cases

CRM Integration

Poll for new conversations and sync visitor data (name, email, language) to your CRM. Use the conversation ID as the external reference.

Automated Follow-ups

After a conversation is closed, send a follow-up message via the API: "Thanks for chatting! Is there anything else we can help with?"

Webhook Alternative

Until outgoing webhooks are available, poll the conversations endpoint periodically to detect new messages or status changes.

Bulk Operations

Close all conversations older than 7 days, assign conversations to operators based on external logic, or export conversation history for analytics.

Rate Limits

The API allows up to 60 requests per minute per API key. If you exceed this limit, you'll receive a 429 Too Many Requests response. Wait and retry with exponential backoff.

Ready to integrate?

Create your free account and generate an API key in minutes.

Get Started Free