---
title: "Say an upload’s bytes have arrived"
method: POST
path: "/workspaces/{id}/content/{itemId}/complete"
tags: ["content"]
---

# Say an upload’s bytes have arrived

`POST /workspaces/{id}/content/{itemId}/complete`

## Request

- Base URL: `https://api.swingfactor.ai/v1`
- URL: `https://api.swingfactor.ai/v1/workspaces/{id}/content/{itemId}/complete`
- Auth: HTTP bearer

Checks what Storage holds — its size and type, and that its first bytes are what the type says — and makes the item ready. One that fails is removed, row and bytes. Idempotent.

## Path parameters

- `id` string, uuid, required
- `itemId` string, uuid, required

## Response `200`

The ready item.

- ContentItem
  - `id` string, uuid, required
  - `kind` 'sources', required
  - `origin` 'upload' | 'web', required: Where its bytes come from: an upload, or a web page.
  - `name` string, required: A file’s name; a page’s title, or its address until it is read.
  - `note` string, nullable, required: What it is for, in the words of whoever added it.
  - `url` string, nullable, required: A page’s address. Null for an upload.
  - `status` 'pending' | 'ready', required
  - `contentType` string, nullable, required
  - `size` integer, nullable, required: Bytes: as declared while an upload is pending, as stored once ready.
  - `currentVersionId` string, uuid, nullable, required: The version it reads as now.
  - `readStatus` 'waiting' | 'reading' | 'read' | 'no_text' | 'failed' | 'not_read' | 'null', nullable, required: For a kind that is read: how far reading its text has got.
  - `readError` string, nullable, required: Why the last reading came to nothing, in words.
  - `textChars` integer, nullable, required: Characters of text read out.
  - `readAt` string, nullable, required
  - `checkedAt` string, nullable, required: When its origin was last asked whether it changed.
  - `addedBy` string, uuid, nullable, required
  - `addedByName` string, nullable, required: Kept when the account that added it is gone.
  - `addedByActor` string, nullable, required: What added it where no person did: the product, for what its model found.
  - `createdAt` string, required
  - `links` ContentItemLinks, required: Relative /v1 URLs to follow.
    - `self` string, required
    - `workspace` string, required
    - `download` string
    - `complete` string
    - `upload` string

## Other responses

- `401`: No token, or not a valid one: `unauthorized`.
- `404`: No such item.
- `409`: The bytes have not arrived.
- `422`: What arrived is not what the file said it was; it has been removed.

---

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