Quickstart
Sign up, create a decision from a template, test it in the Playground, deploy it and call it with cURL, JavaScript or Python — in about five minutes.
This walkthrough follows the checklist on your Dashboard: create a decision, test it, deploy it, create an API key and make your first API call.
Create your account
Open app.dcision.io and choose Continue with Google or enter your work e-mail to receive a 6-digit code (valid for 10 minutes).
The first sign-in creates your account and a workspace on the free Genesis plan (1M decisions per month, 2 decisions, 7-day logs — see Plans).
Create a decision from a template
Go to Templates and pick Lead Qualification under All templates (or Decisions → New decision and select the template), then click Create decision.
You land in the editor with an editable draft that contains:
| Part | Content |
|---|---|
| State | message (string, required), company_size (number), source (string) |
| Questions | purchase_intent (probability), priority (score: low → critical), route (choice: sales, sdr, nurture, spam + the reserved other) |
| Composite | lead_score — a 0–1 ranking from intent (weight 2), priority (1) and the probability of sales (1) |
| Policies | route = spam → block; purchase_intent confidence below 0.6 → escalate |
The Patterns panel next to the schema shows that this decision already combines three of TypeSafe's patterns: intent routing, confidence-gated routing and composite scoring.
The slug — your endpoint — is generated from the name: lead-qualification (or lead-qualification-2 if the workspace already uses it). You can change it until the first deploy.
Test it in the Playground
Open the Playground tab, replace the state with the JSON below and click Run decision (or press ⌘/Ctrl + Enter):
{
"message": "We need pricing for 500 users and want to start next month.",
"company_size": 500,
"source": "website"
}You get the typed result, the action and why it was chosen, a confidence bar per question, the full probability distribution of every option and the value of lead_score. Playground runs are not billed and appear in Executions. Edits to the draft are picked up even before they are saved.
Deploy it
Open the Deploy tab and click Deploy v1. Dcision snapshots the draft as immutable version 1 and makes it live:
POST https://api.dcision.io/v1/decisions/lead-qualificationFrom now on the slug is locked. Later edits stay in the draft until you deploy v2 — production never changes by accident. See Versions and deploy.
Create an API key
Go to API Keys → New key, keep the name Production and the Live environment, and click Create key. Copy the key — it starts with dcs_live_ and is shown only once — and store it as an environment variable on your server:
export DCISION_API_KEY="dcs_live_…"Never ship the key to a browser or a mobile app. See Authentication.
Call the API
curl -X POST https://api.dcision.io/v1/decisions/lead-qualification \
-H "Authorization: Bearer $DCISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": {
"message": "We need pricing for 500 users and want to start next month.",
"company_size": 500,
"source": "website"
}
}'The official SDKs for TypeScript and Python wrap this call with safe retries — await dcision.decide("lead-qualification", state). To call it from a tool that can't hold an API key — a form, a CRM, Zapier, n8n or Make — turn on the decision's webhook URL in its Advanced tab. To let an AI agent call it, connect the MCP server — see Use Dcision in Claude Code.
The response (values vary from run to run; the shape is exact):
{
"decision_id": "dec_3fKq9ZtW1mXcV7bN2pLa",
"execution_id": "exec_8HsT2kQw9ZyR4vMn1cXe",
"schema": "lead-qualification",
"version": 1,
"result": {
"purchase_intent": 0.9412,
"priority": "high",
"route": "sales"
},
"confidence": {
"purchase_intent": 0.8824,
"priority": 0.69,
"route": 0.85
},
"scores": { "priority": 2.81 },
"composites": { "lead_score": 0.8414 },
"action": "continue",
"action_reason": { "type": "default" },
"metrics": {
"latency_ms": 412,
"engine": "jev",
"model": "jev-1.13.0",
"estimated_cost_usd": 0.00001575,
"input_tokens": 375,
"output_tokens": 36
}
}Read the response
resultholds one answer per question, keyed by the question key: a number in[0, 1]for probability questions, a scale label for score questions and an option for choice questions.confidenceholds how sure the engine is about each answer, from 0 to 1 — see Confidence and probabilities.scoresholds the weighted level of each score question, counted from 1:priorityat 2.81 sits betweenmedium(2) andhigh(3), closer tohigh.compositesholds the decision's weighted combinations — herelead_score. See Composites.actionis what your code should do:continue,block,escalateorfallback.action_reasonsays why — here no policy matched, so the defaultcontinueapplies. See Policies and actions.versionis the deployed version that answered andexecution_idfinds the run in Executions.metricsreports the latency, the exact model that answered, the input and output tokens and the estimated engine cost — Jev bills input tokens only.
Add ?include=probabilities to also receive the full distribution of every question — see Confidence and probabilities.
Next steps
Handle errors
Every error code, its HTTP status and what to do.
Retry safely
Idempotency keys, timeouts and backoff for production.
Design your own decision
State, questions, composites, policies and settings.
Write good questions
Instructions and options the engine answers reliably.
Learn the patterns
Fan-out, confidence-gated routing, composite scoring and intent routing.
Use the CLI
Run decisions and validate schemas from your terminal.
Act on the result
Replies, LLM answers, agents, workflows, webhooks and functions per route.
Invite your team
Owner, Admin, Member and Viewer roles, invitations and accounts.
Introduction
What Dcision is — structured decisions over a state (choice, score and probability questions plus policies that pick an action), deployed as one API — and why it exists.
Decision schema
The JSON document behind every decision — the state it accepts, the questions it answers, composites, the policies that pick the action, the runtime settings and the destinations.