---
title: "Write this section into the tenant's tables"
method: POST
path: "/api/admin/onboarding-questionnaires/{questionnaire_id}/sections/{section_key}/apply"
tags: ["Onboarding Questionnaire - Admin"]
---

# Write this section into the tenant's tables

`POST /api/admin/onboarding-questionnaires/{questionnaire_id}/sections/{section_key}/apply`

Accept a section: the answers land in the real tables.

Three guards, in this order:

1. the questionnaire is under review (same gate as every other verb);
2. the answers still hash to what the preview was built from -- otherwise the
   plan the reviewer approved is not the plan that would run;
3. `claim_section_for_apply` moves the row to `applying` atomically, so a
   double-clicked button matches zero rows the second time and gets a 409.

The claim is released in `finally`. That covers an exception; it does NOT
cover a killed worker, which is what `/reset` is for.

## Path parameters

- `questionnaire_id` integer, required
- `section_key` string, required

## Headers

- `x-api-token` string, nullable

## Request body

- ApplyRequest
  - `answers_hash` string, required
  - `items` ApplySelection[]
    - `key` string, required
    - `target_id` integer, nullable
    - `options` object

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-02** `8492136eefc5` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/multigest/apis/multigest-protected-api/changes/api/admin/onboarding-questionnaires/:questionnaire_id/sections/:section_key/apply/post.md)

---

[API](https://skmtc.dev/multigest/apis/multigest-protected-api.md) · [All operations](https://skmtc.dev/multigest/apis/multigest-protected-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/multigest/multigest-protected-api/revisions/8492136eefc5/schema)
