Skip to main content

Reference

API Reference

The Sigil cloud API powers the web dashboard and CI/CD integrations. Requires a Sigil account; threat intelligence, policy, and team-management endpoints are gated to Pro or Team plans.

Authentication

All API requests require a Bearer token. Standalone API keys are not yet issued. Run sigil login to complete a browser-based device authorization flow (POST /v1/auth/device/code, then POST /v1/auth/device/token); the CLI stores the resulting token at ~/.sigil/token.

bash
sigil login

curl -H "Authorization: Bearer $(cat ~/.sigil/token)" \
  https://api.sigilsec.ai/v1/scans
Keep your token secret
Never commit tokens to version control or expose them in client-side code. Use environment variables in CI/CD pipelines.

Base URL

https://api.sigilsec.ai/v1

Scan, threat, and policy endpoints are versioned under /v1; team endpoints are mounted at /team. Rate limits: 200 requests per 60 seconds per IP across the API, plus 30 requests per 60 seconds on POST /v1/scans. Each plan also has a monthly scan quota.

Endpoints

POST/v1/scansAny plan

Store results produced by the CLI. `sigil scan --submit` posts the same payload to /v1/scan. Returns the stored scan with its risk score and verdict.

GET/v1/scans/:idAny plan

Get a stored scan by ID. Includes verdict, risk score, and the findings list.

GET/v1/scansAny plan

List scan history. Query parameters: page, per_page, verdict, source, search, scope.

GET/v1/threatsPro, Team

List known malicious packages. Query parameters: severity, source, search, page, per_page.

POST/v1/policies/evaluatePro, Team

Evaluate a scan result (risk_score, verdict, findings) against the team's enabled policies. Returns allowed, violations, auto_approved, and evaluated_policies.

GET/teamAny plan

Get the current user's team, including the members list. Mounted at /team with no /v1 prefix.

POST/team/inviteTeam

Invite a member to the team. Remove or change a member's role via /team/members/:user_id.

Submit scan results

Scanning runs locally in the CLI. The API stores the results. Body fields: target, target_type (directory, git, pip, npm), files_scanned, findings, and optional metadata.

bash
# Equivalent to: sigil scan ./my-package --submit
curl -X POST https://api.sigilsec.ai/v1/scans \
  -H "Authorization: Bearer $(cat ~/.sigil/token)" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "./my-package",
    "target_type": "directory",
    "files_scanned": 0,
    "findings": []
  }'

Response

Field shape only; values in angle brackets are placeholders. Verdicts are LOW_RISK, MEDIUM_RISK, HIGH_RISK, or CRITICAL_RISK and report detection results, not a safety rating.

json
{
  "id": "<uuid>",
  "scan_id": "<uuid>",
  "target": "./my-package",
  "target_type": "directory",
  "files_scanned": 0,
  "findings": [],
  "risk_score": 0.0,
  "verdict": "LOW_RISK",
  "score": 0.0,
  "classification": "SUSPICIOUS",
  "threat_intel_hits": [],
  "created_at": "<ISO-8601 timestamp>",
  "disclaimer": "Automated static analysis result. Not a security certification. ..."
}

Error handling

Errors return a JSON body with a detail field. Validation errors (422) add an errors array; plan-gate errors (403) add required_plan, current_plan, and upgrade_url.

json
{
  "detail": "Rate limit exceeded. Max 200 requests per 60s."
}

{
  "detail": "Validation error",
  "errors": [{ "loc": ["body", "target"], "msg": "Field required", "type": "missing" }]
}
StatusDescription
401Invalid or missing Bearer token
403Endpoint not available on your plan
404Resource not found
422Invalid request body or parameters
429Rate limit or monthly scan quota exceeded

SDK libraries

Official TypeScript and Python SDK libraries are in development. For now, use the REST API directly or the CLI with --format json.

Need help?

Ask a question in GitHub Discussions or check the troubleshooting guide.