---
title: "PATCH /api/style-document-ai-results"
method: PATCH
path: "/api/style-document-ai-results"
tags: ["Styles/Documents"]
---

# PATCH /api/style-document-ai-results

`PATCH /api/style-document-ai-results`

Bulk-accepts one or more AI review results (per-file or per-drawer). For each item the target `style_document_ai_results` row is flipped to `DONE` with the reviewer's picks (userDocumentType, userStyles) persisted, and a new `style_documents` row is created for every entry in `userStyles` using the AI-results row's own `file_name` as `document_name`. All-or-nothing atomicity: any validation failure — and any persistence error inside the batch — rolls back every result-row flip AND every `style_documents` row created in that call; the whole request either lands or none of it does. The `userModified` / `userAdded` booleans on the payload are accepted but not persisted — they can be re-derived on read by comparing to the `ai_*` fields.

## Request body

- object[]
  - `id` string, required
  - `fileId` string, required
  - `userDocumentType` object, required
    - `documentType` string, required
    - `userModified` boolean, required
  - `userStyles` object[], required
    - `styleId` string, required
    - `userAdded` boolean, required

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `acceptedResultIds` string[], required
    - `createdDocumentIds` string[], required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `404` — Default Response
- `409` — Default Response
- `422` — Default Response

## Changes

> 47 revisions in range; 1 not diffed.

- **2026-09-19** `a8932a002646` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/retraced/apis/api-reference/changes/api/style-document-ai-results/patch.md)

---

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