Attachments

Upload an attachment

Uploads an attachment to the vault's storage backend. Send the raw bytes as application/octet-stream with path, mtime and optional mime_type in the query string, or (legacy) base64 JSON. Attachments are a paid-tier feature (402 on Free, which is also limited to text MIME types), the MIME type and extension must pass the whitelist (415), the file must be within the per-plan size and total-quota limits (402), a raw body over the request ceiling returns 413, a raw body that stalls returns 408, a non-numeric mtime or mime_type returns 422, and a storage backend failure returns 502.

post/api/attachments

Request

  • Base URL: https://api.engram.page
  • URL: https://api.engram.page/api/attachments
  • Auth: HTTP bearer

Query parameters

pathstring

Vault-relative path. Required for an octet-stream body.

mtimenumber

File mtime in seconds (octet-stream body).

mime_typestring

MIME override; detected from the extension when absent (octet-stream body).

Request body

content_base64string required

Base64-encoded file bytes.

mime_typestring nullable

Detected from path if omitted.

pathstring required

Example request

{
  "content_base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  "mime_type": "image/png",
  "path": "assets/diagram.png"
}

Response

Uploaded

Example response

{
  "attachment": {
    "path": "assets/diagram.png"
  }
}

Changes

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