Skip to main content
Monitor the progress of security scans after uploading a binary image. Use this endpoint to check when analysis is complete.

When to Use This Endpoint

After uploading a binary image, use this endpoint to:
  • Check if the security scan is still in progress
  • Determine when analysis has completed
  • Get the scan ID for retrieving detailed results

Request

Endpoint - List All Scans for an Image
GET <BINARLY_API_URL>/api/v4/products/{product_id}/images/{image_id}/scans?status=true
Endpoint - Get a Specific Scan
GET <BINARLY_API_URL>/api/v4/products/{product_id}/images/{image_id}/scans/{scan_id}?status=true
Path Parameters
ParameterDescription
product_idThe product ID (e.g., prod_abc123)
image_idThe image ID returned from the upload (e.g., img_abc123)
scan_id(Optional) Specific scan ID to query
Query Parameters
ParameterRequiredDescription
statusSet to true to include scan status information
Headers
HeaderValue
AuthorizationBearer <access_token>

Example Request

# Set your variables (from the upload response)
BINARLY_PRODUCT_ID="prod_abc123"
IMAGE_ID="img_abc123"

# Check scan status
curl -H "Authorization: Bearer ${TOKEN}" \
  "${BINARLY_API_URL}/api/v4/products/${BINARLY_PRODUCT_ID}/images/${IMAGE_ID}/scans?status=true"

Response

{
  "scans": [
    {
      "id": "scan_xyz789",
      "createTime": "2026-01-26T15:30:01Z",
      "latestScanState": {
        "type": "in_progress"
      }
    }
  ]
}

Scan States

The status is found in the latestScanState.type field:
StateDescriptionAction
in_progressAnalysis is currently runningWait and poll again
completedAnalysis finished successfullyResults are ready to view
no_scansNo scans exist for the imageCheck if upload succeeded
status_unavailableStatus could not be determinedContact support if persistent

Polling for Completion

To wait for a scan to complete, poll the endpoint periodically:
# Poll every 30 seconds until scan completes
while true; do
  STATUS=$(curl -s -H "Authorization: Bearer ${TOKEN}" \
    "${BINARLY_API_URL}/api/v4/products/${BINARLY_PRODUCT_ID}/images/${IMAGE_ID}/scans?status=true" \
    | jq -r '.scans[0].latestScanState.type')
  
  echo "Current status: $STATUS"
  
  if [ "$STATUS" = "completed" ]; then
    echo "✅ Scan completed!"
    break
  elif [ "$STATUS" = "in_progress" ]; then
    echo "⏳ Still scanning... waiting 30 seconds"
    sleep 30
  else
    echo "❌ Unexpected status: $STATUS"
    break
  fi
done

Scan Duration

Scan duration depends on the binary image size, complexity and content:
Image SizeTypical Duration
< 64 MB5-10 minutes
64-500 MB10-60 minutes
> 500 MB1+ hours
Tip: For large images, consider setting up webhook notifications instead of polling.