Skip to main content
POST
/
api
/
policies
/
import
Import Policy
curl --request POST \
  --url https://api.example.com/api/policies/import \
  --header 'Content-Type: application/json' \
  --data '
{
  "source": "<string>",
  "content": "<string>",
  "filename": "<string>"
}
'
{
  "import_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "message": "Import accepted. Poll GET /api/policies/import/{import_id} for results."
}
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

source
string
required
Content type indicator: file for base64-encoded documents or text for plain text.
content
string
required
The policy content. Base64-encoded document bytes when source is file, or plain text when source is text.
filename
string
Original filename for reference (optional, used with file source).

Response

import_id
string
Unique identifier for the import. Use this to poll for status, view details, or activate rules.
status
string
Initial status: processing. Poll the Get Import Details endpoint until status transitions to pending_review, no_rules_found, or failed.
message
string
Human-readable message with next steps.
{
  "import_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "message": "Import accepted. Poll GET /api/policies/import/{import_id} for results."
}

Status Lifecycle

StatusDescription
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

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"