Upload a PDF to a policy version (UI-only)
const url = 'https://api.varman.io/v1/policies/pol_abc123def456/pdf';const form = new FormData();form.append('file', 'binary');form.append('versionId', 'example');
const options = {method: 'POST', headers: {'X-API-Key': '<X-API-Key>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.varman.io/v1/policies/pol_abc123def456/pdf \ --header 'Content-Type: multipart/form-data' \ --header 'X-API-Key: <X-API-Key>' \ --form file=binary \ --form versionId=exampleUploads a PDF via multipart file or base64 fileData JSON. Defaults to the latest draft if no versionId; 400 if no draft is available. UI-only — AI clients should use the presigned /pdf/upload-url + /pdf/confirm flow.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
pol_abc123def456Policy ID
Header Parameters
Section titled “Header Parameters”Organization ID (required for session auth, optional for API key auth)
Request Bodyrequired
Section titled “Request Bodyrequired”Multipart file upload (recommended)
object
Target version ID. If omitted, uploads to the latest draft version.
JSON with base64-encoded file data
object
Base64-encoded file content
Target version ID. If omitted, uploads to the latest draft version.
Multipart file upload (recommended)
object
Target version ID. If omitted, uploads to the latest draft version.
JSON with base64-encoded file data
object
Base64-encoded file content
Target version ID. If omitted, uploads to the latest draft version.
Example generated
{ "file": "binary", "versionId": "example"}