Content

Write a large content key from raw bytes

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.

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

Path parameters

slugstring required
Example:acme-studio

Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.

keystring required

Percent-encode each segment; '/' may be sent raw or as %2F. Keys may contain '/'.

Query parameters

bodySha256string

SHA-256 of the body, in hex. If it does not match, nothing is written (400 body_sha256_mismatch).

Headers

Content-Lengthinteger required

The body's size in bytes. Required (411 length_required without it).

Response

Replaced an existing key.

keystring required

The content key.

hashstring required

SHA-256 of the stored body (hex).

bytesinteger required

Body size in bytes.

contentTypestring required
createdboolean required

True when the key did not exist before (the status is then 201).

warningsstring[]

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.

Example response

{
  "key": "about.html",
  "hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "contentType": "text/html"
}

Changes

No recorded changes to this operation across all 1 revision of this API.