---
title: "Apply presets to a request body"
method: POST
path: "/presets/apply"
tags: ["Presets"]
---

# Apply presets to a request body

`POST /presets/apply`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/presets/apply`
- Auth: one of:
  - none
  - HTTP bearer

Merges one or more presets into a request body you intend to send to a
generation endpoint and returns the finished payload. The tool is inferred
from `payload.model`. Presets that cannot be applied (unknown, no mapping
for the model's tool, or dropped by the model's schema) are reported in
`rejected` instead of failing the call. Returns `200` when at least one
preset applied and `422` when none did; the `422` body then still has the
`payload`/`applied`/`rejected` shape. A `422` with an `error` envelope means
the model in `payload.model` is unknown. Auth is optional.

## Request body

- PresetApplyRequest
  - `payload` object, required: The request body you intend to send to a generation endpoint. `model` is required; the tool is inferred from it.
  - `presets` string[], required: Preset ids to merge, applied in order. Non-string entries are ignored.

## Response `200`

At least one preset was applied

- PresetApplyResponse
  - `payload` object, required: The merged request body, ready to send to the generation endpoint.
  - `applied` string[], required: Ids of the presets that were merged.
  - `rejected` PresetRejection[], required
    - `id` string, required
    - `reason` 'unknown_preset' | 'incompatible' | 'catalogue_error' | 'not_accepted_by_model', required: `unknown_preset`: id not in the catalogue. `incompatible`: no mapping for the model's tool. `catalogue_error`: the preset's mapping data is broken. `not_accepted_by_model`: the model's schema would silently drop the value.
    - `message` string, required
    - `available_tools` string[]: Present for `incompatible`; the tools this preset can be applied to.

## Other responses

- `400`: Body is not a JSON object, `payload` is missing or not an object, `payload.model` is missing, or `presets` is empty
- `422`: Nothing was applied. The body is a `PresetApplyResponse` (with a non-empty `rejected` list), or an `ErrorResponse` with code `unknown_model` when `payload.model` is not in the catalogue.

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/presets/apply/post.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
