Create scan
POST/accounts/{account_id}/managed-defense/vulnerability-discovery/scans
Submits repository intent for operator review. This endpoint does not immediately start execution. Worker-imported repositories must be ready; explicit repository host scopes must be authorized and explicit branch selections must exist before the request is persisted.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Create scan
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/managed-defense/vulnerability-discovery/scans \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"repos": [
{
"name": "x"
}
]
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completed_at": "2019-12-27T18:11:19.117Z",
"message": "message",
"phase": "provisioning",
"repositories": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"phase": "provisioning",
"report_status": "not_ready",
"status": "requested"
}
],
"started_at": "2019-12-27T18:11:19.117Z",
"status": "requested",
"submitted_at": "2019-12-27T18:11:19.117Z",
"telemetry_window": {
"end": "2019-12-27T18:11:19.117Z",
"start": "2019-12-27T18:11:19.117Z"
}
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completed_at": "2019-12-27T18:11:19.117Z",
"message": "message",
"phase": "provisioning",
"repositories": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"phase": "provisioning",
"report_status": "not_ready",
"status": "requested"
}
],
"started_at": "2019-12-27T18:11:19.117Z",
"status": "requested",
"submitted_at": "2019-12-27T18:11:19.117Z",
"telemetry_window": {
"end": "2019-12-27T18:11:19.117Z",
"start": "2019-12-27T18:11:19.117Z"
}
},
"success": true
}