---
title: "Finish a file upload"
method: POST
path: "/api/v1alpha1/assistant/trademe/files/{file_id}/complete"
tags: ["v1alpha1"]
---

# Finish a file upload

`POST /api/v1alpha1/assistant/trademe/files/{file_id}/complete`

## Request

- Base URL: `https://api.trademeai.co.nz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.trademeai.co.nz/api/v1alpha1/assistant/trademe/files/{file_id}/complete`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/trademeai/apis/trade-me-ai-platform/docs/api/v1alpha1/assistant/trademe/files/:file_id/complete/post.ts> (a function with typed inputs; its response is checked against the schema)

Call after the bytes are uploaded to `putUrl`. Checks the upload and makes the file active, then returns its `fileId`, `ref`, `state` and `sizeBytes`. Answers 404 for an unknown file and 422 when the upload does not pass the check.

Error bodies are described in the [error contract](https://trademe.gitlab.io/shared/projects/ai-engineering/anvil/anvil/domains/assistant-gateway/concepts/error-contract.html).

## Path parameters

- `file_id` string, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- CompleteFileResponse
  - `fileId` string, required
  - `ref` string, required
  - `state` string, required
  - `sizeBytes` integer, nullable
  - `caption` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-08-17** `4a6ad0ee6b5e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trademeai/apis/trade-me-ai-platform/changes/api/v1alpha1/assistant/trademe/files/:file_id/complete/post.md)

---

[API](https://skmtc.dev/trademeai/apis/trade-me-ai-platform.md) - [All operations](https://skmtc.dev/trademeai/apis/trade-me-ai-platform/llms.txt) - [OpenAPI document](https://skmtc.dev/trademeai/apis/trade-me-ai-platform/revisions/1164c8a5c534?raw)
