---
title: "Write a large content key from raw bytes"
method: PUT
path: "/api/v1/sites/{slug}/content-raw/{key}"
tags: ["Content"]
---

# Write a large content key from raw bytes

`PUT /api/v1/sites/{slug}/content-raw/{key}`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/content-raw/{key}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Stages one key from the raw request body, for files too big to send as a JSON string (up to 5,000,000 bytes). Send the file as the body, with a `Content-Length` header; chunked uploads are refused. The body must be valid UTF-8 text. The request's `Content-Type` is stored with the key; `application/octet-stream` or none falls back to a type inferred from the key. Everything else matches `PUT …/content/{key}`. Nothing is live until you publish.

## Path parameters

- `slug` string, required
- `key` string, required

## Query parameters

- `bodySha256` string

## Headers

- `Content-Length` integer, required

## Response `200`

Replaced an existing key.

- PutContentRawResponse
  - `key` string, required: The content key.
  - `hash` string, required: SHA-256 of the stored body (hex).
  - `bytes` integer, required: Body size in bytes.
  - `contentType` string, required
  - `created` boolean, required: True when the key did not exist before (the status is then 201).
  - `warnings` string[]: Non-blocking notes about tags that will not compose, one per problem, each as `<key>: <code> — <what to change>`. Codes: `fragment_unclosed`, `fragment_bad_name`, `fragment_full_document`, `fragment_self_reference`, `fragment_attr_hyphen`, `legacy_paige_tag`, `layout_missing_content`, `unknown_dotsy_syntax`. The write still happened. At most 50 are listed.

## Other responses

- `201`: Created a new key.
- `400`: `invalid_key`, `reserved_key`, `length_mismatch` (with `declared` and `actual`), `invalid_body_sha256`, `body_sha256_mismatch`, `invalid_utf8`, or `empty_page_body`.
- `401`: Missing or invalid credentials.
- `403`: The key or token cannot write to this site, or a plan limit blocks the write.
- `404`: No such site (`site_not_found`).
- `409`: `conflict` or `placement_version_conflict`. Retry.
- `411`: No usable `Content-Length` header (`length_required`).
- `413`: The body is over 5,000,000 bytes (`content_too_large`), or the plan's storage limit is reached.

---

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