Upload a policy document (file or plain text) and extract enforceable rules using AI. The endpoint returns immediately with a processing status while rule extraction runs in the background. Poll Get Import Details to check when extraction is complete.
Request Body
Content type indicator: file for base64-encoded documents or text for plain text.
The policy content. Base64-encoded document bytes when source is file, or plain text when source is text.
Original filename for reference (optional, used with file source).
Response
Unique identifier for the import. Use this to poll for status, view details, or activate rules.
Initial status: processing. Poll the Get Import Details endpoint until status transitions to pending_review, no_rules_found, or failed.
Human-readable message with next steps.
202 Import Accepted
400 Bad Request
422 Unprocessable Entity
{
"import_id" : "550e8400-e29b-41d4-a716-446655440000" ,
"status" : "processing" ,
"message" : "Import accepted. Poll GET /api/policies/import/{import_id} for results."
}
Status Lifecycle
Status Description processingImport accepted, AI extraction in progress pending_reviewExtraction complete, rules ready for review and activation no_rules_foundExtraction complete but no compliance rules were identified failedExtraction failed (see error_message in Get Import Details ) activatedAll extracted rules have been activated partially_activatedSome rules activated, others still pending
Example
cURL (file)
cURL (text)
Python
JavaScript
DOC_BASE64 = $( base64 -i compliance-policy.pdf )
# Submit the import
curl -X POST "https://{api-url}/api/policies/import" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\" source \" : \" file \" ,
\" content \" : \" $DOC_BASE64 \" ,
\" filename \" : \" compliance-policy.pdf \"
}"
# Poll for results (returns 'processing' until extraction completes)
curl -X GET "https://{api-url}/api/policies/import/IMPORT_ID" \
-H "x-api-key: YOUR_API_KEY"