The Cortex Cloud public API for repositories enables programmatic management of the repository asset inventory. It automates workflows that would otherwise require manual interaction with the console, enabling security teams to integrate repository governance into CI/CD pipelines, infrastructure-as-code provisioning, and scanner configuration automation.
Note
The public API base path is /public_api/appsec/v1/repositories.
API prerequisites
API Key: A valid Cortex Cloud API key with sufficient permissions (AppSec Admin or custom repository management roles)
Authentication: All requests require the
x-redlock-authheader with a valid JWT token or theAuthorizationheader containing the API key. Refer to the Cortex Cloud APIs authentication documentation for token generationBase URL: Use the base URL corresponding to your Cortex Cloud tenant region
Content-type: All payload-bearing requests (PUT and POST) in the Cortex AppSec API require
application/jsonVCS integration: VCS integration (GitHub, GitLab, and so on) must already be active to populate the
assetIdvalues required by the endpoints
Retrieve the repository inventory
Retrieve the repository inventory programmatically to identify coverage gaps and synchronize with external systems.
List repositories: Use the
GET /public_api/appsec/v1/repositoriesendpoint to retrieve all repository assets with optional filtering by source, search term, URL, and paginationGet repository by ID: Use the G
ET /public_api/appsec/v1/repositories/{assetId}endpoint to retrieve a specific repository asset by the unique asset identifier
Manage scan configuration
Automate scanner enablement and configure exclusion rules.
Retrieve configuration: Use
GET /public_api/appsec/v1/repositories/{assetId}/scan-configurationto retrieve the current scan configuration for a specific repositoryUpdate configuration: Use
PUT /public_api/appsec/v1/repositories/{assetId}/scan-configurationto update scanners, excluded file paths, PR scanning, and tagging bot activity programmatically
Note
The
excludedPathsfield replaces the entire excluded paths list; to add a new path, retrieve the current configuration first, append the new path, and send the complete arraySAST: SAST scanner configuration is not available through the public API and must be managed through the console UI
Manage scanned branches
Automate branch governance to ensure release and feature branches are scanned.
Retrieve branches: Use
GET /public_api/appsec/v1/repositories/{assetId}/branchesto retrieve all branches currently configured for scanningUpdate branches: Use
PUT /public_api/appsec/v1/repositories/{assetId}/branchesto update the primary branch and selected branches for scanning.Warning
Always retrieve the current branch list before updating. The
PUToperation replaces the entire branch selection, meaning any omitted branches will be unintentionally removed from scanning.
Export compliance evidence (SBOM)
To automate the compliance generation process within CI/CD pipelines, you can export Software Bill of Materials programmatically using the dedicated SBOM API.
API reference
For repository payload examples, schemas, and status code, refer to the Repositories API documentation.