---
title: "Decide makes feature decisions for the selected query parameters."
method: POST
path: "/v1/decide"
---

# Decide makes feature decisions for the selected query parameters.

`POST /v1/decide`

Returns decision results for flag keys for a user. The result for a single key is returned as an OptimizelyDecision object whereas the result for multiple keys is returned as an array of OptimizelyDecision objects. If no flag key is provided, decision is made for all flag keys. OptimizelyDecision object contains all data required to deliver the flag rule.

## Query parameters

- `keys` string

## Request body

- DecideContext
  - `decideOptions` DecideOption[]
  - `userId` string, required
  - `userAttributes` object
  - `forcedDecisions` ForcedDecision[]
    - `flagKey` string, required
    - `ruleKey` string
    - `variationKey` string, required
  - `fetchSegments` boolean
  - `fetchSegmentsOptions` FetchSegmentsOption[]

## Response `200`

Valid response

- union
  - OptimizelyDecision[]
    - `variables` object
    - `variationKey` string
    - `enabled` boolean
    - `ruleKey` string, required
    - `flagKey` string, required
    - `userContext` UserContext, required
      - `userId` string, required
      - `attributes` object
    - `reasons` string[]
  - object
    - `variables` object
    - `variationKey` string
    - `enabled` boolean
    - `ruleKey` string, required
    - `flagKey` string, required
    - `userContext` UserContext, required
      - `userId` string, required
      - `attributes` object
    - `reasons` string[]

## Other responses

- `400` — Missing required parameters
- `401` — Unauthorized, invalid JWT
- `403` — You do not have necessary permissions for the resource
- `500` — Failed to fetch qualified segments

## Changes

- **2023-05-22** `b03cfe30eb69` — 6 breaking, 4 info
  - the request's body type/format changed from ``/`` to `object`/``
  - the `forcedDecisions/items/` request property type/format changed from ``/`` to `object`/``
  - the response body contentMediaType changed from `` to `application/json` for the status `200`
  - the response's body type/format changed from ``/`` to `object`/`` for status `403`
  - …6 more
- **2023-03-03** `4f332aaf5fcd` — 3 info
  - added the new optional request property `fetchSegments`
  - added the new optional request property `fetchSegmentsOptions`
  - added the non-success response with the status `500`
- **2021-11-24** `61f8dbfdf926` — 1 info
  - added the new optional request property `forcedDecisions`
- **2021-03-01** `5ff30d650745` — 1 info
  - endpoint added
- **2019-08-29** `6933bf16666a` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/optimizely/apis/optimizely-agent-api/changes/v1/decide/post.md)

---

[API](https://skmtc.dev/optimizely/apis/optimizely-agent-api.md) · [All operations](https://skmtc.dev/optimizely/apis/optimizely-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/optimizely/optimizely-agent-api/revisions/8aa6750d4b77/schema)
