# Build a request

> Turn a backend decision into a text, a question and its possible answers. Read the result and keep the application action in your own code.

Source: https://opendecisio.com/docs/build-request/

Ask a small [question](https://opendecisio.com/docs/glossary/#question) your application needs answered, such as which queue should handle a ticket. With a server running, this checks the service and asks one choice question:

 

```
curl --fail-with-body -sS --max-time 60 http://127.0.0.1:8000/v1/systemone \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "My card keeps getting declined when I renew.",
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "billing": "Invoices, payments and refunds",
        "access": "Login, passwords and permissions",
        "bug": "The product behaves wrongly"
      }
    }
  }
}'
```

 

Run against the CPU stand-in at v0.46.0 on 2026-11-13: the answers are the stand-in's, not the default model's.

 

[Download this request as JSON](https://opendecisio.com/examples/questions/choice.json) for your client.

 

[Figure: Find the field your code sends or reads. A request beside its answer. Four controls identify the text, question, options and answer. All field explanations are also available below.]

 

## 1 Supply the text

 

Put the message, document or record you want evaluated in `state`. Keep the question and your instructions separate from that text. For example, the ticket describes the customer’s payment problem; the question asks which team should handle it.

 

## 2 Name the question

 

Each key under `questions` is a name your code chooses, such as `category`. Its answer comes back under the same key in `answers`. Write one judgment per question, and add more named questions when you need separate judgments about the same text.

 

## 3 Choose the possible answers

 

For a choice question, `criteria` maps your [option](https://opendecisio.com/docs/glossary/#option) keys to descriptions, or to `null` when the names are enough. Choose distinct keys that your code can use directly, and write descriptions when neighboring options need a clear boundary. For example, distinguish a failed payment from a login failure rather than asking the model to invent a category.

 

[Choose a question type](https://opendecisio.com/docs/concepts/questions/) compares a choice, a yes or no question and an ordered score.

 

## 4 Read the answer before acting

 

For this request, read `answers.category.choice` for the selected option and `answers.category.probabilities` for its distribution. Your application maps that option to a queue or a review workflow. For automatic decisions at an [error target](https://opendecisio.com/docs/glossary/#error-target), use a [certified task](https://opendecisio.com/docs/tasks/certify/) and require both `certified: true` and `certificate_kind: "gold"` on its answer.

 

## Good to know

 

- A successful request returns answers under the names you supplied; check the HTTP status before reading them.
- A field called `model` does not switch the model loaded by a decisio server.
- A [probability](https://opendecisio.com/docs/glossary/#probability) [threshold](https://opendecisio.com/docs/glossary/#threshold) you choose by hand is a routing rule, not a certificate.

 

## Use a coding assistant

 

[Install the decisio skills](https://opendecisio.com/docs/ai-skills/) to have Claude Code or Codex prepare your setup, request or backend integration. Choose the workflow for your [task](https://opendecisio.com/docs/glossary/#task) and include your hardware or endpoint in the prompt.

 

## What next

 

- [Call from your code](https://opendecisio.com/docs/use-from/): Python, JavaScript, TypeScript and frameworks.
- [Support routing](https://opendecisio.com/docs/use-cases/support-routing/): a complete application recipe.
- [HTTP API](https://opendecisio.com/docs/api/): exact fields, supported options and error responses.
