Base URL
All API requests go to:/public/v1/. A full request URL looks like:
Authentication
The API uses Bearer token authentication. Pass your API key in theAuthorization header on every request. See Authentication for details on obtaining and using keys.
Request and response format
All request bodies and responses use JSON. SetContent-Type: application/json when sending a request body.
Pagination
Endpoints that return lists acceptlimit and offset query parameters and include a total field in the response.
| Parameter | Type | Default | Maximum | Description |
|---|---|---|---|---|
limit | integer | 50 | 100 | Number of results to return |
offset | integer | 0 | — | Number of results to skip |
total field tells you how many records exist in total, so you can calculate subsequent offsets.
Available endpoints
| Method | Path | Description |
|---|---|---|
GET | /public/v1/user | Authenticated user info |
GET | /public/v1/bugs | List bugs for a repository |
GET | /public/v1/bugs/{bug_id} | Get a single bug |
POST | /public/v1/bugs/{bug_id}/review | Resolve or dismiss a bug |
GET | /public/v1/scans | List scans for a repository |
GET | /public/v1/repos | List connected repositories |
POST | /public/v1/rules | Start an async rule creation job |
GET | /public/v1/rules | List completed rules |
GET | /public/v1/rules/{rule_id} | Get a single rule with file contents |
GET | /public/v1/rules/requests | List rule creation requests |
GET | /public/v1/rules/requests/{rcr_id} | Get a rule creation request status |
Error codes
All errors return anApiError JSON object with type, message, and statusCode fields.
| Status | Type | Meaning |
|---|---|---|
400 | INVALID_REQUEST_BODY / INVALID_QUERY_PARAMS | Malformed request body or query parameters |
401 | DETAIL_AUTHENTICATION_ERROR | Missing or invalid API key |
403 | AUTHORIZATION_ERROR | Valid key but insufficient permissions |
404 | NOT_FOUND | The requested resource does not exist |
400 | UNKNOWN_WORKFLOW_REQUEST | The referenced workflow request ID does not exist |
500 | INTERNAL_ERROR | Unexpected server error |