> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Suggest Decision

Use this API to compute a suggested decision for a new item, grounded in past judgments. `primary` is the best-grounded recommendation; `conflict` is populated when the evidence is split, so you can surface disagreement to your users.

# Endpoint

`POST https://api.velt.dev/v2/memory/suggest`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/docs/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="query" type="string" required>
      Non-empty. Describe the item being decided.
    </ParamField>

    <ParamField body="organizationId" type="string">
      Narrow the precedent to one organization.
    </ParamField>

    <ParamField body="documentId" type="string">
      Narrow the precedent to one document. Only applied when `organizationId` is also set. Sent alone, it is ignored and the search stays workspace-wide.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Suggest a decision for new ad copy

```JSON theme={null}
{
  "data": {
    "query": "Ad copy: \"clinically proven to reduce wrinkles\""
  }
}
```

# Response

Both `primary` and `conflict` are a suggestion object or `null`. `recommendation` is `approve` or `reject`. `basedOn` is the number of judgments the suggestion drew on, and `uniqueReviewers` is how many distinct people decided them. `scope` is `document`, `organization`, or `apiKey`. `scopeLabel` is the matching display string, one of `This document`, `This organization`, or `All content`; it never carries your own organization or document name.

Only judgments whose `decision` is `approved`, `agree`, `endorse`, or `document_approved` count toward an `approve` recommendation. Only `rejected`, `disagree`, or `document_rejected` count toward `reject`. Judgments with any other `decision` value, such as `comment` or `resolve`, count toward neither side.

`primary` is `null` when no past judgments matched, or when fewer than 2 records support the leading decision. `conflict` is non-null only when `approve` and `reject` each have 2 or more supporting records.

On `primary`, `caveats` carries four kinds of warning: a conflict between the two sides, a knowledge source updated in the last 48 hours, a stale pattern where over 70% of the supporting data is older than 6 months, and partial data when a scope times out. On `conflict`, `caveats` always carries one minority-view note comparing the two record counts.

#### Success Response

```JSON theme={null}
{
  "result": {
    "primary": {
      "recommendation": "reject",
      "confidence": 0.78,
      "basedOn": 12,
      "scope": "organization",
      "scopeLabel": "This organization",
      "topReasons": ["Unsupported medical claim", "Missing citation"],
      "uniqueReviewers": 4,
      "caveats": ["Stale pattern: >70% of supporting data is older than 6 months"]
    },
    "conflict": null
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "primary": {
        "recommendation": "reject",
        "confidence": 0.78,
        "basedOn": 12,
        "scope": "organization",
        "scopeLabel": "This organization",
        "topReasons": ["Unsupported medical claim", "Missing citation"],
        "uniqueReviewers": 4,
        "caveats": ["Stale pattern: >70% of supporting data is older than 6 months"]
      },
      "conflict": null
    }
  }
  ```
</ResponseExample>
