v2
latestOpenAPI 3.1.02026-08-0382170235.8 KBCreate a context_attachment from an inline text payload (≤16KB)
Create a context_attachment on the given document using a JSON body. For payloads larger than 16 KB use the multipart /upload variant of this endpoint.
Channel vs type: any type value (author_note or json_schema) can be created via either channel — the channel is a function of payload size, not attachment kind.
Note on the 16 KB cap: byte-size enforcement happens at the Pydantic validator layer (before the route handler runs), so oversized content_text surfaces as a 422 with the Pydantic error detail, not the route's stable {code, ...} shape. The multipart /upload path emits 413 ATTACHMENT_FILE_TOO_LARGE in-handler when its 80 KB cap is exceeded — that's the dedicated stable code for oversize payloads. Inline >16KB is a 422.
Path parameters
Request body
Response
Attachment created