---
title: "Complete Dialogue Upload"
method: POST
path: "/api/available/dialogue/{task_uid}/complete"
tags: ["tasks"]
---

# Complete Dialogue Upload

`POST /api/available/dialogue/{task_uid}/complete`

## Request

- Base URL: `https://api.ncspeech.org` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ncspeech.org/api/available/dialogue/{task_uid}/complete`
- Auth: HTTP bearer

Close the attempt after the client's direct-to-GCS PUT.

Carries the capture metadata for an early-minted attempt (legacy clients send
`{}` and everything is already on the row), re-runs the rules that could not
run at mint time against the merged result, verifies the object landed with
exactly the reported size (422 otherwise — the attempt stays open, the client
may re-PUT and retry), then flips progress to Pending and dispatches the
validation worker. The response is the full task payload, as
GET /available/{taskUid} returns it.

Authorizable by the usual credentials or by the attempt's one-time complete
token; the token survives a 422 → re-PUT → complete retry and dies with the
first successful close.

## Path parameters

- `task_uid` string, required

## Headers

- `X-Dialogue-Complete-Token` string, nullable
- `X-Test-UID` string, nullable

## Request body

- DialogueMetadataPayload: What one recording turned out to be. Every field is optional. The same shape is accepted at both ends of the flow: as the tail of a legacy mint (where it is complete and validated on the spot) and as the body of /complete (where it describes the artefact that actually landed). Field *shape* is enforced here; whether enough of it is present is a per-endpoint question — see DialogueUploadUrlPayload and _require_complete_metadata.
  - `sampleRate` integer, nullable
  - `channels` 1, nullable
  - `bitsPerSample` 16, nullable
  - `sizeBytes` integer, nullable
  - `sessionId` string, nullable
  - `durationSeconds` number, nullable
  - `endReason` 'selfStopped' | 'partnerEnded' | 'minDurationNotReached' | 'connectionLost' | 'error', nullable
  - `rating` integer, nullable
  - `gps` string, nullable
  - `deviceType` string, nullable
  - `inputHash` string, nullable
  - `inputLabel` string, nullable
  - `outputHash` string, nullable
  - `outputLabel` string, nullable
  - `topicId` string, nullable
  - `topicTitle` string, nullable
  - `convLang` string, nullable
  - `droppedFrames` integer, nullable
  - `startedAtEpochMs` integer, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ncspeech/apis/advanced-data-collector-api.md) - [All operations](https://skmtc.dev/ncspeech/apis/advanced-data-collector-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ncspeech/apis/advanced-data-collector-api/revisions/fec602f8df8c?raw)
