Skip to main content
POST
/
api
/
policies
/
import
/
start
Start Import
curl --request POST \
  --url https://api.example.com/api/policies/import/start \
  --header 'Content-Type: application/json' \
  --data '
{
  "import_id": "<string>",
  "filename": "<string>"
}
'
{
  "import_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "message": "Import accepted. Poll GET /api/policies/import/{import_id} for results."
}
Step 2 of the large-file custom policy import flow (after the S3 upload). Call this after uploading your file to the presigned upload_url from Get Import Presigned URL. It verifies the uploaded object and enforces the size cap, then — once malware scanning has completed successfully — starts asynchronous rule extraction and returns status: "processing". If the scan is still running, it returns status: "scan_pending" immediately instead; retry the call until extraction starts (see the note below). Poll Get Import Details until the status transitions to pending_review, no_rules_found, or failed — identical to the inline Import Policy flow.

Request Body

import_id
string
required
The import_id returned by Get Import Presigned URL.
filename
string
Optional filename to record on the import (overrides the value from the presigned step).

Response

import_id
string
Unique identifier for the import. Use it to poll for status or activate rules.
status
string
processing once extraction has started, or scan_pending if the malware scan is still running (retry shortly).
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."
}

Error Responses

StatusDescription
400Missing/invalid import_id, or the uploaded file is empty
403Invalid API key, or the import belongs to another customer
404No uploaded file found for this import_id (upload step skipped or failed)
409Import already started or completed
413Uploaded file exceeds the maximum allowed size (1 GB)
422File failed malware/content scanning
If you receive a 202 with status: "scan_pending", the malware scan is still running (usually a few seconds). Retry this request shortly — rule extraction does not start until the scan completes successfully.

Example

curl -X POST "https://{api-url}/api/policies/import/start" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "import_id": "550e8400-e29b-41d4-a716-446655440000"
  }'