API Products Message Router

POST /v1/message-router
5 tokens / req pkg 1.0.0
typescript bash
const res = await kequtech("/v1/message-router", {
  parameters: {
    message: "Hi there—I'm trying to update my card on file but keep getting an error. Also wondering if you offer discounts on upgrading to the Business plan.",
    subject: "Card update issue + upgrade question",
    context: "A subscription based software company.",
    guidance: "Prioritize resolving blocking issues first, even if the message includes multiple topics.",
    departments: [
      {
        name: "support",
        description: "Troubleshooting and technical issues.",
      },
      {
        name: "billing",
        description: "Payments, refunds, and account charges.",
      },
      {
        name: "sales",
        description: "Plan upgrades, quotes, and new deals.",
      },
    ],
  },
});

About

Classifies an incoming message into exactly one department from a predefined list. It returns the chosen department, a confidence score (0–100), and an explanation of the routing.

Default departments:

  • sales: New business, quotes, upgrades.
  • support: Troubleshooting, bugs, how-to help.
  • billing: Invoices, payments, refunds.
  • jobs: Hiring and applications.
  • press: Media and PR requests.
  • partnerships: Reseller, affiliate, integrations.
  • legal: Contracts, terms, compliance.
  • general: Everything else; triage needed.

The importance score reflects how relevant or legitimate the message appears. This can also be inferred as the spam score, a very low score indicates the message is of little importance. Importance can be tweaked and departments can be prioritized through context and guidance.

API reference

Parameters

message (required)
string

Provide the original message in plain text (10-1500 characters).

subject
string

Provide the original subject in plain text (max 120 characters).

context
string

Describe yourself or your company (max 400 characters).

guidance
string

Describe what you want (max 400 characters).

departments
[]

List of internal departments.

name (required)
string

Short keyword (2-32 characters).

description
string

Reason to route here (max 120 characters).

Response

department (required)
string

Chosen department.

confidence (required)
integer

0-100 certainty in the department selection.

reason (required)
string

One-line rationale for the department choice.

importance (required)
integer

0-100 how important is this message (0=trivial/spam, 100=urgent lead).