Valstorm LogoDev

document Endpoints

All endpoints for the document API group. Great for feeding into an LLM context.

POST

/v1/document/preview

Preview Document

Generates a PDF preview by merging the provided fields and data.


Request Body
{
  "content": {
    "multipart/form-data": {
      "schema": {
        "$ref": "#/components/schemas/Body_preview_document_v1_document_preview_post"
      }
    }
  }
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

POST

/v1/document/internal/init

Internal Init Document

Initializes an internal document fill session. Fetches the template, merges data, and returns the PDF base64 along with fields.


Request Body
{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/GenerateContractRequest"
      }
    }
  },
  "required": true
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

POST

/v1/document/internal/finalize

Internal Finalize Document

Finalizes an internally filled document, applying any manual signatures/text and saving the final result as a File attached to the originating record.


Request Body
{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/InternalFinalizePayload"
      }
    }
  },
  "required": true
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner

POST

/v1/document/generate-contract

Generate Contract

Generates a new contract document from a template and originating record. Returns the contract, version, and signing tokens for easy access.


Request Body
{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/GenerateContractRequest"
      }
    }
  },
  "required": true
}
Responses
200
Successful Response
application/json
{}
404
Not found
422
Validation Error
application/json
{
  "$ref": "#/components/schemas/HTTPValidationError"
}
API Runner