Decisions API · Examples

Decisions API Examples for Product Workflows

Explore practical Choice, Noul, and Score examples for ticket routing, rollout review, policy checks, and model selection—with your application retaining control of every action.

Route a support ticket with Choice

Define a finite set of destinations and ask the Decisions API to select one using the ticket text, order history, and relevant policy as state. The result can map to a queue in your own service. Keep a fallback for unknown cases and review low-confidence decisions.

"questions": {
  "team": {
    "type": "choice",
    "instructions": "Which team should handle the ticket?",
    "criteria": {
      "billing": "Payment, refund, or invoice issue",
      "technical": "Product defect or integration failure",
      "account": "Login, access, or profile issue"
    }
  }
}

Check an explicit condition with Noul

Use a yes/no question when downstream code needs a probability for a clearly described proposition. State the evidence and both criteria. Your application decides which probability range is acceptable and what to do when evidence is incomplete.

"questions": {
  "needs_review": {
    "type": "noul",
    "instructions": "Does this request require manual review?",
    "criteria": {
      "true": "It meets at least one written escalation rule",
      "false": "No escalation rule is supported by the supplied facts"
    }
  }
}

Apply an ordered rubric with Score

Score is useful when an application needs an ordinal assessment, such as limited, elevated, or critical impact. Write each level so it is distinguishable, then map returned levels to your own workflow. Do not treat an ordinal score as a calibrated measurement unless you have validated it for that use.

"questions": {
  "impact": {
    "type": "score",
    "instructions": "Rate customer impact from the incident evidence.",
    "criteria": ["Limited", "Elevated", "Critical"]
  }
}

Combine questions around one shared state

A single request can ask multiple questions about the same state—for example, classify a support message, assess urgency, and determine whether policy requires review. Keep each question independent, inspect every answer by its ID, and validate the response before making an application change.

These examples illustrate request patterns, not measured accuracy or production outcomes. Start in the free online playground, then use the documentation for authentication, limits, errors, and billing details.