Skip to content

API Reference

This content is not available in your language yet.

This section is a complete, field-by-field reference for every query and mutation exposed by the Wetel API. It complements the conceptual guides elsewhere in these docs (start with Getting Started, Authentication, and Multi-Tenancy if you haven’t yet) by documenting exact argument lists, return shapes, and realistic request/response examples for each operation.

There is a single endpoint for all operations:

https://api.wetel.dev/graphql

There is no separate REST API for the core platform (agents, sessions, workflows, tenants, and so on). A small number of avatar/media operations are exposed over REST by a companion service — see Avatar Service REST API for those.

Every query/mutation is subject to two structural limits, enforced server-side regardless of authentication method:

  • Query depth: max 7. Counted as nested selection-set levels — e.g. session { messages { ... } } is depth 2. A query exceeding this is rejected before execution with a GraphQL validation error, not partially run.
  • Query complexity: max 50. A cost estimate based on field count and list-argument sizes (e.g. a first: 100 connection argument costs more than first: 10). Exceeding this is also a pre-execution rejection.

Neither limit affects introspection itself or any realistic query this API’s own resolvers produce — the schema has minimal nesting today (one Relay connection type, no deep object graphs), so a client following normal usage patterns won’t hit either ceiling. They exist to bound worst-case resource cost from a maliciously or accidentally deep/expensive request, not to constrain legitimate integration queries.

  • Authentication — login, registration, password reset, two-factor auth, current user profile
  • Tenant — reading and updating your own tenant, API key generation
  • Agents — creating and configuring AI agent personas
  • Sessions — starting conversations, sending messages, live events
  • Workflows — the visual conversation graph engine
  • Channels — connecting an agent directly to Telegram (WhatsApp/Slack/Lark planned)
  • MCP & Custom Actions — connecting third-party tools to your agents
  • Knowledge Base & Embeddings — RAG document ingestion and retrieval
  • LLM API — call an LLM directly, single-response or streaming, no session/agent/workflow needed
  • Evaluation & Export — post-session scoring and document export
  • Avatar Config — tenant-level avatar/voice defaults
  • Admin Resources — roles, permissions, notifications, media, banners
  • Avatar Service REST API — the companion REST surface for avatar/TTS/STT operations