> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xdr-5-api/aspm-cicd-and-application-security/repositories.md).

# Repositories

APIs for managing repository assets

## Get repositories

> Get details on all repositories integrated with Cortex Cloud Application Security, providing detailed information and insights into repository artifacts, configurations, and dependencies.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories":{"get":{"tags":["Repositories"],"summary":"Get repositories","description":"Get details on all repositories integrated with Cortex Cloud Application Security, providing detailed information and insights into repository artifacts, configurations, and dependencies.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","operationId":"GetRepositoryAssets","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"source","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationType"}}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Omit_Repository.assetId_"}}}}}}}}},"components":{"schemas":{"IntegrationType":{"type":"string","enum":["COLLECTOR"],"title":"IntegrationType","description":"Type of the data source instance, indicating the external system it connects to. "},"Omit_Repository.assetId_":{"$ref":"#/components/schemas/Pick_Repository.Exclude_keyofRepository.assetId__"},"Pick_Repository.Exclude_keyofRepository.assetId__":{"type":"object","title":"RepositoryResponse","properties":{"name":{"type":"string","description":"The name of the repository in the version control system (VCS)"},"description":{"type":"string","description":"Description describing the repository"},"creationDate":{"type":"string"},"defaultBranch":{"type":"string"},"diskSize":{"type":"number","format":"double"},"externalId":{"type":"string"},"id":{"type":"string","description":"Repository ID"},"integrationId":{"type":"string"},"isArchived":{"type":"boolean","description":"Whether the repository is archived"},"isBillable":{"type":"boolean","description":"Whether the repository is billable"},"isForked":{"type":"boolean","description":"Whether the repository is forked"},"isPublic":{"type":"boolean","description":"Whether the repository is public"},"isSelected":{"type":"boolean","description":"Whether the repository is selected"},"lastScanDate":{"type":"string"},"observationTime":{"type":"number","format":"double","description":"The date the repository was last updated"},"organizationId":{"type":"string"},"owner":{"type":"string","description":"Repository owner"},"projectId":{"type":"string"},"scanConfiguration":{"$ref":"#/components/schemas/ScanConfiguration"},"scannedBranch":{"type":"string"},"scannedBranches":{"type":"array","items":{"$ref":"#/components/schemas/Branch"}},"source":{"$ref":"#/components/schemas/IntegrationType"},"status":{"$ref":"#/components/schemas/RepositoryStatus"},"url":{"type":"string","description":"URL of the repository"}}},"ScanConfiguration":{"type":"object","title":"ScanConfiguration","description":"The configuration of an Application Security code scanner","additionalProperties":false,"properties":{"excludedPaths":{"type":"array","items":{"type":"string"}},"prScanning":{"$ref":"#/components/schemas/PRScanning"},"scanners":{"$ref":"#/components/schemas/ScannerTypes"},"taggingBot":{"$ref":"#/components/schemas/TaggingBot"}}},"PRScanning":{"type":"object","description":"Pull Request (PR) scans are initiated by events triggered by version control systems such as GitHub, GitLab, Bitbucket and Azure Repos, or via webhooks. The scan results are based on default enforcement thresholds.","additionalProperties":false,"properties":{"blockOnError":{"type":"boolean"},"isEnabled":{"type":"boolean","description":"Indicates whether the PR scan is enabled"}},"required":["blockOnError","isEnabled"]},"ScannerTypes":{"type":"object","title":"ScannerTypes","description":"Details on each type of scanner: Branch periodic scans, CI scans, IaC scans, Secrets scans","additionalProperties":false,"properties":{"GIT_HISTORY":{"$ref":"#/components/schemas/ScannerConfig"},"IAC":{"$ref":"#/components/schemas/ScannerConfig"},"SCA":{"$ref":"#/components/schemas/ScannerConfig"},"SECRETS":{"$ref":"#/components/schemas/ScannerConfig"}},"required":["GIT_HISTORY","IAC","SCA","SECRETS"]},"ScannerConfig":{"type":"object","title":"ScannerConfig","description":"Scanner configuration","additionalProperties":false,"properties":{"isEnabled":{"type":"boolean","description":"Indicates whether this scanner is enabled"},"scanOptions":{"type":"object","additionalProperties":{"type":"boolean"}}},"required":["isEnabled"]},"TaggingBot":{"type":"object","additionalProperties":false,"properties":{"tagModuleBlocks":{"type":"boolean"},"tagResourceBlocks":{"type":"boolean"}},"required":["tagModuleBlocks","tagResourceBlocks"]},"Branch":{"type":"object","additionalProperties":false,"properties":{"diskSize":{"type":"number","format":"double"},"firstScanDate":{"type":"string","description":"Timestamp of the first scan performed"},"id":{"type":"string","description":"Branch ID"},"isPrimary":{"type":"boolean","description":"Indicates whether or not the branch is the primary branch"},"lastApiCallDate":{"type":"string"},"lastCloneDate":{"type":"string"},"lastCloneSha":{"type":"string"},"lastScanDate":{"type":"string","description":"Timestamp of the last scan execution"},"name":{"type":"string","description":"Branch name"},"repositoryId":{"type":"string","description":"Repository ID"}}},"RepositoryStatus":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"properties":{"apiRead":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"apiWrite":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"clone":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"connection":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"webhookSubscription":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"token":{"$ref":"#/components/schemas/RepositoryStatusDetails"}},"required":["apiRead","apiWrite","clone","connection","webhookSubscription","token"]},"RepositoryStatusDetails":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"status":{"$ref":"#/components/schemas/StatusValue"}},"required":["status"]},"StatusValue":{"type":"string","enum":["INVALID","VALID"]}}}}
```

## Get a repository

> Get details on the Application Security repository specified by its asset ID.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories/{assetId}":{"get":{"tags":["Repositories"],"summary":"Get a repository","description":"Get details on the Application Security repository specified by its asset ID.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","operationId":"GetRepositoryAssetByAssetId","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"assetId","in":"path","description":"Asset ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Omit_Repository.assetId_"}}}}}}}},"components":{"schemas":{"Omit_Repository.assetId_":{"$ref":"#/components/schemas/Pick_Repository.Exclude_keyofRepository.assetId__"},"Pick_Repository.Exclude_keyofRepository.assetId__":{"type":"object","title":"RepositoryResponse","properties":{"name":{"type":"string","description":"The name of the repository in the version control system (VCS)"},"description":{"type":"string","description":"Description describing the repository"},"creationDate":{"type":"string"},"defaultBranch":{"type":"string"},"diskSize":{"type":"number","format":"double"},"externalId":{"type":"string"},"id":{"type":"string","description":"Repository ID"},"integrationId":{"type":"string"},"isArchived":{"type":"boolean","description":"Whether the repository is archived"},"isBillable":{"type":"boolean","description":"Whether the repository is billable"},"isForked":{"type":"boolean","description":"Whether the repository is forked"},"isPublic":{"type":"boolean","description":"Whether the repository is public"},"isSelected":{"type":"boolean","description":"Whether the repository is selected"},"lastScanDate":{"type":"string"},"observationTime":{"type":"number","format":"double","description":"The date the repository was last updated"},"organizationId":{"type":"string"},"owner":{"type":"string","description":"Repository owner"},"projectId":{"type":"string"},"scanConfiguration":{"$ref":"#/components/schemas/ScanConfiguration"},"scannedBranch":{"type":"string"},"scannedBranches":{"type":"array","items":{"$ref":"#/components/schemas/Branch"}},"source":{"$ref":"#/components/schemas/IntegrationType"},"status":{"$ref":"#/components/schemas/RepositoryStatus"},"url":{"type":"string","description":"URL of the repository"}}},"ScanConfiguration":{"type":"object","title":"ScanConfiguration","description":"The configuration of an Application Security code scanner","additionalProperties":false,"properties":{"excludedPaths":{"type":"array","items":{"type":"string"}},"prScanning":{"$ref":"#/components/schemas/PRScanning"},"scanners":{"$ref":"#/components/schemas/ScannerTypes"},"taggingBot":{"$ref":"#/components/schemas/TaggingBot"}}},"PRScanning":{"type":"object","description":"Pull Request (PR) scans are initiated by events triggered by version control systems such as GitHub, GitLab, Bitbucket and Azure Repos, or via webhooks. The scan results are based on default enforcement thresholds.","additionalProperties":false,"properties":{"blockOnError":{"type":"boolean"},"isEnabled":{"type":"boolean","description":"Indicates whether the PR scan is enabled"}},"required":["blockOnError","isEnabled"]},"ScannerTypes":{"type":"object","title":"ScannerTypes","description":"Details on each type of scanner: Branch periodic scans, CI scans, IaC scans, Secrets scans","additionalProperties":false,"properties":{"GIT_HISTORY":{"$ref":"#/components/schemas/ScannerConfig"},"IAC":{"$ref":"#/components/schemas/ScannerConfig"},"SCA":{"$ref":"#/components/schemas/ScannerConfig"},"SECRETS":{"$ref":"#/components/schemas/ScannerConfig"}},"required":["GIT_HISTORY","IAC","SCA","SECRETS"]},"ScannerConfig":{"type":"object","title":"ScannerConfig","description":"Scanner configuration","additionalProperties":false,"properties":{"isEnabled":{"type":"boolean","description":"Indicates whether this scanner is enabled"},"scanOptions":{"type":"object","additionalProperties":{"type":"boolean"}}},"required":["isEnabled"]},"TaggingBot":{"type":"object","additionalProperties":false,"properties":{"tagModuleBlocks":{"type":"boolean"},"tagResourceBlocks":{"type":"boolean"}},"required":["tagModuleBlocks","tagResourceBlocks"]},"Branch":{"type":"object","additionalProperties":false,"properties":{"diskSize":{"type":"number","format":"double"},"firstScanDate":{"type":"string","description":"Timestamp of the first scan performed"},"id":{"type":"string","description":"Branch ID"},"isPrimary":{"type":"boolean","description":"Indicates whether or not the branch is the primary branch"},"lastApiCallDate":{"type":"string"},"lastCloneDate":{"type":"string"},"lastCloneSha":{"type":"string"},"lastScanDate":{"type":"string","description":"Timestamp of the last scan execution"},"name":{"type":"string","description":"Branch name"},"repositoryId":{"type":"string","description":"Repository ID"}}},"IntegrationType":{"type":"string","enum":["COLLECTOR"],"title":"IntegrationType","description":"Type of the data source instance, indicating the external system it connects to. "},"RepositoryStatus":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"properties":{"apiRead":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"apiWrite":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"clone":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"connection":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"webhookSubscription":{"$ref":"#/components/schemas/RepositoryStatusDetails"},"token":{"$ref":"#/components/schemas/RepositoryStatusDetails"}},"required":["apiRead","apiWrite","clone","connection","webhookSubscription","token"]},"RepositoryStatusDetails":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string"},"status":{"$ref":"#/components/schemas/StatusValue"}},"required":["status"]},"StatusValue":{"type":"string","enum":["INVALID","VALID"]}}}}
```

## Get a repository scan configuration

> Get the details of an Application Security scan configuration.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories/{assetId}/scan-configuration":{"get":{"tags":["Repositories"],"summary":"Get a repository scan configuration","description":"Get the details of an Application Security scan configuration.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","operationId":"GetAssetScanConfiguration","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanConfiguration"}}}}}}}},"components":{"schemas":{"ScanConfiguration":{"type":"object","title":"ScanConfiguration","description":"The configuration of an Application Security code scanner","additionalProperties":false,"properties":{"excludedPaths":{"type":"array","items":{"type":"string"}},"prScanning":{"$ref":"#/components/schemas/PRScanning"},"scanners":{"$ref":"#/components/schemas/ScannerTypes"},"taggingBot":{"$ref":"#/components/schemas/TaggingBot"}}},"PRScanning":{"type":"object","description":"Pull Request (PR) scans are initiated by events triggered by version control systems such as GitHub, GitLab, Bitbucket and Azure Repos, or via webhooks. The scan results are based on default enforcement thresholds.","additionalProperties":false,"properties":{"blockOnError":{"type":"boolean"},"isEnabled":{"type":"boolean","description":"Indicates whether the PR scan is enabled"}},"required":["blockOnError","isEnabled"]},"ScannerTypes":{"type":"object","title":"ScannerTypes","description":"Details on each type of scanner: Branch periodic scans, CI scans, IaC scans, Secrets scans","additionalProperties":false,"properties":{"GIT_HISTORY":{"$ref":"#/components/schemas/ScannerConfig"},"IAC":{"$ref":"#/components/schemas/ScannerConfig"},"SCA":{"$ref":"#/components/schemas/ScannerConfig"},"SECRETS":{"$ref":"#/components/schemas/ScannerConfig"}},"required":["GIT_HISTORY","IAC","SCA","SECRETS"]},"ScannerConfig":{"type":"object","title":"ScannerConfig","description":"Scanner configuration","additionalProperties":false,"properties":{"isEnabled":{"type":"boolean","description":"Indicates whether this scanner is enabled"},"scanOptions":{"type":"object","additionalProperties":{"type":"boolean"}}},"required":["isEnabled"]},"TaggingBot":{"type":"object","additionalProperties":false,"properties":{"tagModuleBlocks":{"type":"boolean"},"tagResourceBlocks":{"type":"boolean"}},"required":["tagModuleBlocks","tagResourceBlocks"]}}}}
```

## Update a repository scan configuration

> Update the configuration of an Application Security scan.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories/{assetId}/scan-configuration":{"put":{"tags":["Repositories"],"summary":"Update a repository scan configuration","description":"Update the configuration of an Application Security scan.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security add-on.","operationId":"UpdateAssetScanConfiguration","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"assetId","description":"The unique asset ID of the repository.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"excludedPaths":{"type":"array","description":"A list of file or directory paths to exclude from scanning. Paths are relative to the repository root and support wildcard patterns.\n\n- **Exclude directories:** Enter folder names to exclude all files inside, such as `node_modules/`, `tests/`, `dist/`.\n- **Exclude files by pattern:** Use wildcards — `*` for any number of characters, `?` for a single character. For example, `.*.log` excludes all log files, `*.min.js` excludes all minified JavaScript files.\n- **Use a comma-separated list:** Separate multiple exclusions with commas. For example, `node_modules/, dist/, docs/`.\n- **Avoid leading slashes:** Use `dist/`, not `/dist/`.","items":{"type":"string"}},"prScanning":{"type":"object","description":"Pull Request (PR) scan settings. PR scans are triggered by version control system events (GitHub, GitLab, Bitbucket, Azure Repos) or webhooks.","required":["blockOnError","isEnabled"],"properties":{"blockOnError":{"type":"boolean","description":"When `true`, pull requests (PRs) automatically fail on a scan error. This prevents security risks and misconfigurations from being merged into the codebase."},"isEnabled":{"type":"boolean","description":"When `true`, security scans automatically trigger on a pull request (PR) to identify potential security risks or misconfigurations before the code is merged."}}},"taggingBot":{"type":"object","description":"Configuration for the tagging bot. When enabled, automatically appends a unique `yor_trace` ID to resource and module blocks when a pull request is opened. This identifier enables precise code-to-cloud tracing throughout the software development lifecycle.","required":["tagModuleBlocks","tagResourceBlocks"],"properties":{"tagModuleBlocks":{"type":"boolean","description":"When `true`, the tagging bot automatically appends a unique `yor_trace` ID to IaC module blocks when a pull request is opened."},"tagResourceBlocks":{"type":"boolean","description":"When `true`, the tagging bot automatically appends a unique yor_trace ID to IaC resource blocks when a pull request is opened."}}},"scanners":{"type":"object","description":"Scanner settings to update","properties":{"SECRETS":{"type":"object","description":"Configure the Secrets scanner to identify hardcoded credentials, such as API keys, access tokens, private keys, and passwords, embedded in source code, configuration files, and Git history.","required":["isEnabled"],"properties":{"isEnabled":{"type":"boolean","description":"When `true`, enables this scanner to run on the repository."},"scanOptions":{"type":"object","description":"Scanner-specific options for the Secrets scanner. These options control additional scanning behaviors.","properties":{"secretValidation":{"type":"boolean","description":"When `true`, enables secrets validation to check a detected secret's activity status via public APIs. This allows you to prioritize and address only active, exposed secrets. Secrets validation scanning is available through the Cortex Cloud tenant and IDE extensions."},"gitHistory":{"type":"boolean","description":"When `true`, enables Git history scanning to automatically detect secrets still present in the repository's past commits. By identifying these exposed credentials, you can proactively address risks and prevent potential data breaches."}}}}},"SCA":{"type":"object","description":"Configure the Software Composition Analysis (SCA) scanner to identify known vulnerabilities in your open-source dependencies.","required":["isEnabled"],"properties":{"isEnabled":{"type":"boolean","description":"When `true`, enables this scanner to run on the repository."}}},"IAC":{"type":"object","description":"Configure the Infrastructure as Code (IaC) scanner to detect security risks and compliance violations in your IaC templates before deployment.","required":["isEnabled"],"properties":{"isEnabled":{"type":"boolean","description":"When `true`, enables this scanner to run on the repository."}}}}}}}}}},"responses":{"204":{"description":"No content. Indicates that the Scan configuration updated successfully."}}}}}}
```

## Get AppSec repository branches

> Get the details of the Application Security repository branches.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories/{assetId}/branches":{"get":{"tags":["Repositories"],"summary":"Get AppSec repository branches","description":"Get the details of the Application Security repository branches.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","operationId":"GetScannedBranches","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Branch"}}}}}}}}},"components":{"schemas":{"Branch":{"type":"object","additionalProperties":false,"properties":{"diskSize":{"type":"number","format":"double"},"firstScanDate":{"type":"string","description":"Timestamp of the first scan performed"},"id":{"type":"string","description":"Branch ID"},"isPrimary":{"type":"boolean","description":"Indicates whether or not the branch is the primary branch"},"lastApiCallDate":{"type":"string"},"lastCloneDate":{"type":"string"},"lastCloneSha":{"type":"string"},"lastScanDate":{"type":"string","description":"Timestamp of the last scan execution"},"name":{"type":"string","description":"Branch name"},"repositoryId":{"type":"string","description":"Repository ID"}}}}}}
```

## Update an AppSec repository branch

> Update the Application Security repository branch by indicating the primary branch.\
> \
> \*\*Required license:\*\* Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"tags":[{"name":"Repositories","description":"APIs for managing repository assets"}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/repositories/{assetId}/branches":{"put":{"tags":["Repositories"],"summary":"Update an AppSec repository branch","description":"Update the Application Security repository branch by indicating the primary branch.\n\n**Required license:** Cortex XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","operationId":"SetPersistBranches","parameters":[{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true},{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPersistBranchesApi"}}}},"responses":{"204":{"description":"No content"}}}}},"components":{"schemas":{"SetPersistBranchesApi":{"type":"object","additionalProperties":false,"properties":{"selectedBranches":{"type":"array","items":{"type":"string"}},"primaryBranch":{"type":"string"}},"required":["selectedBranches","primaryBranch"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xdr-5-api/aspm-cicd-and-application-security/repositories.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
