Skip to main content

create_document

Function create_document 

Source
pub async fn create_document(
    __arg0: State<AppState>,
    __arg1: Json<CreateDocumentRequest>,
) -> Result<Json<Document>, ApiError>
Expand description

Create a new document definition.

Accepts a CreateDocumentRequest and validates it. If validation succeeds, the document is persisted and the stored document is returned.

§Route

POST /documents

§Errors

  • Returns an error if the document definition fails validation.
  • Returns an error if persistence fails.

§Notes

This endpoint is intended only for creating new documents. Updates to existing documents should be handled via a separate endpoint to allow different validation and lifecycle rules.