---
title: "Preview result writeback or explicitly import canonical git-hosted result files."
method: POST
path: "/api/v1/forms/{formId}/git-results"
tags: ["Forms"]
---

# Preview result writeback or explicitly import canonical git-hosted result files.

`POST /api/v1/forms/{formId}/git-results`

## Request

- Base URL: `https://commentary.dev`
- URL: `https://commentary.dev/api/v1/forms/{formId}/git-results`
- Auth: HTTP bearer

Import and preview actions require commentary.forms.writeback and the forms.github_writeback license feature. Import validates canonical JSON/YAML result files, deduplicates by external id, records audit events, and stores imported submissions with git sync metadata.

## Path parameters

- `formId` string, required

## Headers

- `X-Commentary-Workspace-Id` string
- `X-Correlation-Id` string

## Request body

- FormGitResultsRequest
  - `action` 'import' | 'preview_writeback'
  - `submissionId` string
  - `submissionIds` string[]
  - `paths` string[]
  - `target` object
    - `owner` string
    - `repo` string
    - `ref` string
    - `branch` string
    - `sourcePath` string
    - `baseBranch` string
    - `createBranch` boolean
  - `summary` string
  - `commitMessage` string
  - `openPullRequest` boolean
  - `pullRequestTitle` string
  - `pullRequestBody` string
  - `agentAlias` string
  - `clientName` string

## Response `200`

Successful response.

- object

## Other responses

- `202`: Successful response.
- `400`: The request was invalid.
- `401`: Authentication is required.
- `403`: The token or session does not have permission for this resource.
- `404`: The resource was not found.
- `429`: The request was rate limited.

---

[API](https://skmtc.dev/commentary/apis/commentary-public-api.md) · [All operations](https://skmtc.dev/commentary/apis/commentary-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/commentary/apis/commentary-public-api/revisions/7aaafc198c52?raw)
