Inspect the file
Know the exact name, MIME type, and byte size before asking for an upload form.
Create a document and upload its bytes through a short-lived, controlled upload form.
documents:writeKnow the exact name, MIME type, and byte size before asking for an upload form.
Send the metadata to the ingestion endpoint and record document_id and version_id.
Create a multipart form using every returned field unchanged, add the file, and POST it to upload.url before it expires.
The document begins security checks and preview preparation after upload. There is no separate confirmation request.
Do not retry blocked types unchanged. For size or usage limits, follow the returned guidance or contact the workspace administrator.
These are the supported public contracts for this integration step.
/api/ingest/documentsdocuments:writeCreate a document record and receive a short-lived upload form for server-side or partner ingestion.
POST /api/ingest/documents
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"name": "sample-referral.pdf",
"mime": "application/pdf",
"size": 82311,
"title": "Sample referral",
"category": "referral",
"tags": ["partner-import"]
}{
"document_id": "doc_example",
"version_id": "version_example",
"status": "pending_scan",
"upload": {
"url": "https://temporary-upload.example.invalid/",
"fields": { "key": "temporary-value" }
},
"expires_in": 300,
"max_bytes": 104857600
}validation errorProvide name, MIME type, and byte size.
INSUFFICIENT_SCOPECreate a key with documents:write.
FILE_TYPE_NOT_ALLOWEDUse a supported file type.
FILE_TOO_LARGEKeep the file below max_bytes.
USAGE_LIMIT_EXCEEDEDReview the workspace’s upload or storage allowance.
Requests go directly from this browser tab to the API environment you choose. Keys and responses are held in memory only and are cleared when the page closes.
/api/ingest/documentsEnter a test key, review the sample request, and send it. The response will appear here.
curl -X POST 'https://api.connect.globalclinic.app/api/ingest/documents' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"name": "sample-referral.pdf",
"mime": "application/pdf",
"size": 82311,
"title": "Sample referral",
"category": "referral",
"tags": ["partner-import"]
}'documents:writeCreate a document record and receive a short-lived upload form for server-side or partner ingestion.