Skip to content

Save Document

POST
/api/canvas/{deal_id}/save
curl --request POST \
--url https://example.com/api/canvas/example/save \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "content": "example" }'

Save full document content.

Auto-promotes DRAFT -> EDITING on first save. Content is persisted to both Redis (fast) and Store (durable, decomposed by section). Broadcasts document_saved event via WebSocket.

Phase 4: RequireEditor — viewers and commenters cannot save.

deal_id
required
Deal Id
string
Media type application/json
SaveDocumentRequest

Request body for saving document content.

object
content
required
Content
string
<= 500000 characters
Example generated
{
"content": "example"
}

Successful Response

Media type application/json
DocumentStateResponse

Response for document state transitions.

object
success
required
Success
boolean
from_state
required
From State
string
to_state
Any of:
string
error
Any of:
string
details
Any of:
object
key
additional properties
any
Example generated
{
"success": true,
"from_state": "example",
"to_state": "example",
"error": "example",
"details": {}
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}