Skip to main content
POST
/
api
/
analysis
/
agents
/
scan
/
start
Start Agent Scan
curl --request POST \
  --url https://api.codeant.ai/api/analysis/agents/scan/start \
  --header 'Content-Type: application/json' \
  --data '
{
  "service": "github",
  "repo": "owner/repository",
  "accessToken": "ghp_xxxxxxxxxxxx",
  "branch": "main",
  "instructionPrompt": "threat_hunting",
  "includeFiles": "src/**/*.py,lib/**/*.js",
  "excludeFiles": "tests/**,node_modules/**"
}
'
{
  "message": "Scan started successfully",
  "scanId": "aB3xK9mP2q",
  "filesQueued": 142
}

Body

application/json
service
enum<string>
required

Version control service provider

Available options:
github,
gitlab,
azuredevops,
bitbucket
Example:

"github"

repo
string
required

Repository identifier (format varies by service)

Example:

"owner/repository"

accessToken
string
required

OAuth or personal access token for the VCS service

Example:

"ghp_xxxxxxxxxxxx"

branch
string
required

Git branch to analyze

Example:

"main"

instructionPrompt
string
required

Analysis type. Use threat_hunting for security threat detection.

Example:

"threat_hunting"

commitId
string
default:""

Specific commit SHA to analyze. If omitted, the latest commit on the branch is used.

Example:

"abc123def456"

includeFiles
string
default:""

Comma-separated glob patterns for files to include in analysis

Example:

"src/**/*.py,lib/**/*.js,app/**/*.ts"

excludeFiles
string
default:""

Comma-separated glob patterns for files to exclude from analysis

Example:

"tests/**,node_modules/**,dist/**"

azureDevopsBaseUrl
string
default:https://dev.azure.com

Base URL for Azure DevOps (for self-hosted instances)

gitlab_base_url
string
default:https://gitlab.com

Base URL for GitLab (for self-hosted instances)

github_base_url
string
default:https://github.com

Base URL for GitHub (for GitHub Enterprise Server)

bitbucket_base_url
string
default:https://api.bitbucket.org/2.0

Base URL for Bitbucket (for Bitbucket Data Center)

Response

Agent scan successfully started

message
string

Success message

Example:

"Scan started successfully"

scanId
string

Unique identifier for the scan. Use this to retrieve results and check status.

Example:

"aB3xK9mP2q"

filesQueued
integer

Number of files queued for analysis

Example:

142