# Try a decision in simulation before making it

`POST /whatif` · Rivier · analytics

Try a decision in simulation before making it: a question and two or three options, run on the same seeds.

- Scope: analytics:write
- Graphql: Mutation.analyticsWhatifStart
- Sdk: analytics.whatif.start
- Cli: analytics whatif start

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "options": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1500
          }
        },
        "required": [
          "label",
          "text"
        ],
        "additionalProperties": false
      },
      "minItems": 2,
      "maxItems": 3
    },
    "seed": {
      "type": "integer"
    }
  },
  "required": [
    "question",
    "options"
  ],
  "additionalProperties": false
}
```

## Responses

- `202`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/whatif' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "question": "string",
  "options": [
    {
      "label": "string",
      "text": "string"
    }
  ]
}'
```
