Security API reference
Base URL:https://api.withfoundry.aiAuth:
Authorization: Bearer key_...
All responses use the envelope { success, data, meta: { requestId } }.
Start scan
POST /v1/security/scan
Start a security scan for a repository.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
repoUrl | string | Yes | Clone URL (e.g. https://github.com/org/repo). |
branch | string | No | Branch or ref to scan (default: default branch). |
waitForCompletion | boolean | No | If true, long-poll until done and return findings in response. |
data
| Field | Type | Description |
|---|---|---|
scanId | string | Id to fetch result (e.g. scan_...). |
status | string | pending | running | completed | failed. |
findings | array | Present when waitForCompletion: true and status is completed. |
Get scan result
GET /v1/security/scan/:scanId
Retrieve scan status and findings.
Path
| Param | Description |
|---|---|
scanId | Id returned from POST /v1/security/scan. |
data
| Field | Type | Description |
|---|---|---|
scanId | string | Same as path. |
status | string | pending | running | completed | failed. |
findings | array | List of findings when status is completed. |
error | string | Optional; set when status is failed. |
| Field | Type | Description |
|---|---|---|
id | string | Finding id. |
severity | string | critical | high | medium | low | info. |
title | string | Short title. |
description | string | Detailed description. |
file | string | File path in repo. |
line | number | Line number. |
suggestion | string | Optional remediation. |