/api/v1/data-discovery/sources/{id}/scanTrigger scan of a data source
Triggers an ad-hoc scan of a data source (id from the path). Verifies the source exists (404) and is enabled (400 DISABLED), inserts a `data_scans` row with `status: "queued"` and `triggered_by` (body field, one of manual|schedule|scheduled|cli|api|webhook, default "manual"), then enqueues a BullMQ `data-scan` job; if the queue is unavailable it falls back to running the scan inline fire-and-forget. Returns 201 with the queued scan row immediately — poll the scan for status; findings land in `data_findings`. Requires `security_scans:create` and membership of the source's org. There is no recurring scheduler in the product today: every scan is started through this endpoint.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
id in pathrequiredstringRequest body required
Example
{
"triggered_by": "manual"
}Schema
{
"application/json": {
"schema": {
"type": "object",
"properties": {
"triggered_by": {
"type": "string",
"enum": [
"manual",
"schedule",
"scheduled",
"cli",
"api",
"webhook"
]
}
},
"additionalProperties": false
}
}
}Response
202 example
{
"scan_id": "00000000-0000-0000-0000-000000000000"
}All status codes
Code samples
cURL
# {id} is shown with an EXAMPLE value — replace it with real values.
curl -X POST \
https://evalguard.ai/api/v1/data-discovery/sources/00000000-0000-0000-0000-000000000000/scan \
-H "Authorization: Bearer $EVALGUARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "triggered_by": "manual" }'TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {id} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/data-discovery/sources/00000000-0000-0000-0000-000000000000/scan", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"triggered_by": "manual"
}),
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {id} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://evalguard.ai/api/v1/data-discovery/sources/00000000-0000-0000-0000-000000000000/scan",
headers=headers,
json={
"triggered_by": "manual"
},
)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
)
// {id} is shown with an EXAMPLE value — replace it with real values.
func main() {
body := strings.NewReader(`{"triggered_by":"manual"}`)
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/data-discovery/sources/00000000-0000-0000-0000-000000000000/scan", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}