# Repository

## Create a check run for a repository

> Creates a check run on a commit with optional code annotations. Supports GitHub check runs and Azure DevOps build status. Useful for reporting CI/CD results, code quality checks, or custom validations. Annotations can highlight specific lines in files with issues.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"CreateCheckDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"},"sha":{"type":"string","description":"Commit SHA to create the check for. For PRs, this should be the head commit SHA."},"pull_number":{"type":"number","description":"Pull request number. If provided, the check will be associated with this PR."},"title":{"type":"string","description":"Title of the check run"},"summary":{"type":"string","description":"Summary of the check results"},"text":{"type":"string","description":"Additional details about the check run"},"annotations":{"description":"List of annotations to add to the check run","type":"array","items":{"$ref":"#/components/schemas/CheckAnnotation"}},"details_url":{"type":"string","description":"Details URL that will appear in the GitHub UI"},"conclusion":{"type":"string","description":"Conclusion of the check run. Required when status is completed.","enum":["success","failure","neutral","cancelled","skipped","timed_out","action_required"],"default":"success"},"status":{"type":"string","description":"Status of the check run. Defaults to completed.","enum":["in_progress","completed"],"default":"completed"},"skip_comment":{"type":"boolean","description":"Skip posting a rich PR comment (ADO only). Use when the status badge is sufficient.","default":false},"check_category":{"type":"string","description":"Category of the check (analysis or validation). Used to construct web UI result page URLs."}},"required":["repositoryIdentifier","sha","title","summary"]},"CheckAnnotation":{"type":"object","properties":{"path":{"type":"string","description":"Path to the file being annotated"},"start_line":{"type":"number","description":"Start line number of the annotation"},"end_line":{"type":"number","description":"End line number of the annotation"},"annotation_level":{"type":"string","description":"Severity level of the annotation","enum":["notice","warning","failure"]},"message":{"type":"string","description":"Message to display in the annotation"},"title":{"type":"string","description":"Brief title for the annotation"}},"required":["path","start_line","end_line","annotation_level","message"]}}},"paths":{"/sfp/api/repository/checks":{"post":{"operationId":"RepositoryController_createCheck","summary":"Create a check run for a repository","description":"Creates a check run on a commit with optional code annotations. Supports GitHub check runs and Azure DevOps build status. Useful for reporting CI/CD results, code quality checks, or custom validations. Annotations can highlight specific lines in files with issues.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckDto"}}}},"responses":{"201":{"description":"The check run has been successfully created","content":{"application/json":{"schema":{"properties":{"id":{"type":"number","description":"The check run ID"},"html_url":{"type":"string","description":"URL to view the check run"},"conclusion":{"type":"string","enum":["success","failure","neutral"],"description":"The final conclusion of the check"},"status":{"type":"string","enum":["completed"],"description":"The current status of the check"}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Update an existing check run (body-based)

> Updates a check run using check\_id from the request body. Use this for check IDs that contain special characters (e.g., ADO genre/name format like "sfp/PR Validation").

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"UpdateCheckDto":{"type":"object","properties":{"check_id":{"type":"string","description":"Check run ID. Required when using the body-based PATCH /checks endpoint (e.g., ADO check IDs with slashes)."},"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"},"status":{"type":"string","description":"Status of the check run","enum":["in_progress","completed"]},"conclusion":{"type":"string","description":"Conclusion of the check run. Required when status is completed.","enum":["success","failure","neutral","cancelled","skipped","timed_out","action_required"]},"title":{"type":"string","description":"Updated title of the check run"},"summary":{"type":"string","description":"Updated summary of the check results"},"text":{"type":"string","description":"Updated details about the check run"},"sha":{"type":"string","description":"Commit SHA. Required for Azure DevOps check updates."},"pull_number":{"type":"number","description":"Pull request number. Required for Azure DevOps check updates."},"details_url":{"type":"string","description":"Details URL to include in the check comment (e.g., link to analysis results page)"},"skip_comment":{"type":"boolean","description":"Skip posting a rich PR comment (ADO only). Use when the status badge is sufficient.","default":false},"check_category":{"type":"string","description":"Category of the check (analysis or validation). Used to construct web UI result page URLs."}},"required":["repositoryIdentifier","status"]}}},"paths":{"/sfp/api/repository/checks/update":{"patch":{"operationId":"RepositoryController_updateCheckByBody","summary":"Update an existing check run (body-based)","description":"Updates a check run using check_id from the request body. Use this for check IDs that contain special characters (e.g., ADO genre/name format like \"sfp/PR Validation\").","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCheckDto"}}}},"responses":{"200":{"description":"The check run has been successfully updated"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Update an existing check run

> Updates the status, conclusion, or output of an existing check run. For check IDs with special characters (slashes, spaces), use PATCH /checks/update instead.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"UpdateCheckDto":{"type":"object","properties":{"check_id":{"type":"string","description":"Check run ID. Required when using the body-based PATCH /checks endpoint (e.g., ADO check IDs with slashes)."},"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"},"status":{"type":"string","description":"Status of the check run","enum":["in_progress","completed"]},"conclusion":{"type":"string","description":"Conclusion of the check run. Required when status is completed.","enum":["success","failure","neutral","cancelled","skipped","timed_out","action_required"]},"title":{"type":"string","description":"Updated title of the check run"},"summary":{"type":"string","description":"Updated summary of the check results"},"text":{"type":"string","description":"Updated details about the check run"},"sha":{"type":"string","description":"Commit SHA. Required for Azure DevOps check updates."},"pull_number":{"type":"number","description":"Pull request number. Required for Azure DevOps check updates."},"details_url":{"type":"string","description":"Details URL to include in the check comment (e.g., link to analysis results page)"},"skip_comment":{"type":"boolean","description":"Skip posting a rich PR comment (ADO only). Use when the status badge is sufficient.","default":false},"check_category":{"type":"string","description":"Category of the check (analysis or validation). Used to construct web UI result page URLs."}},"required":["repositoryIdentifier","status"]}}},"paths":{"/sfp/api/repository/checks/{check_id}":{"patch":{"operationId":"RepositoryController_updateCheck","summary":"Update an existing check run","description":"Updates the status, conclusion, or output of an existing check run. For check IDs with special characters (slashes, spaces), use PATCH /checks/update instead.","parameters":[{"name":"check_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCheckDto"}}}},"responses":{"200":{"description":"The check run has been successfully updated","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","description":"The check run ID"},"status":{"type":"string","description":"The current status of the check"},"conclusion":{"type":"string","description":"The conclusion of the check"}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## List open pull requests in a repository

> Lists pull requests with optional filtering by username and state. Supports GitHub and Azure DevOps repositories. Supports pagination. Can filter PRs created by or assigned to a specific user. Returns basic PR information including title, state, and branch details.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/pull-requests":{"get":{"operationId":"RepositoryController_listPullRequests","summary":"List open pull requests in a repository","description":"Lists pull requests with optional filtering by username and state. Supports GitHub and Azure DevOps repositories. Supports pagination. Can filter PRs created by or assigned to a specific user. Returns basic PR information including title, state, and branch details.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}},{"name":"username","required":false,"in":"query","description":"Filter pull requests by username","schema":{"type":"string"}},{"name":"state","required":false,"in":"query","description":"State of pull requests to return (default: open)","schema":{"enum":["open","closed","all"],"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (1-based, default: 1)","schema":{"type":"number"}},{"name":"per_page","required":false,"in":"query","description":"Number of results per page (default: 30, max: 100)","schema":{"type":"number"}}],"responses":{"200":{"description":"List of pull requests","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"id":{"type":"number","description":"The pull request ID"},"number":{"type":"number","description":"The pull request number"},"html_url":{"type":"string","description":"URL to view the pull request"},"state":{"type":"string","enum":["open","closed","merged"],"description":"Current state of the pull request"},"title":{"type":"string","description":"Pull request title"},"body":{"type":"string","description":"Pull request description"},"user":{"type":"object","properties":{"login":{"type":"string","description":"username of the creator"}}},"created_at":{"type":"string","format":"date-time","description":"When the pull request was created"},"updated_at":{"type":"string","format":"date-time","description":"When the pull request was last updated"}}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Create a pull request in a repository

> Creates a new pull request between two branches. Supports draft pull requests. The source branch must have commits ahead of the target branch. Useful for automated PR creation in CI/CD workflows.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"CreatePullRequestDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"},"sourceBranch":{"type":"string","description":"The source branch containing the changes"},"targetBranch":{"type":"string","description":"The target branch to merge changes into"},"title":{"type":"string","description":"Title of the pull request"},"description":{"type":"string","description":"Description of the pull request in markdown format"},"draft":{"type":"boolean","description":"Whether to create as a draft pull request","default":false},"userToken":{"type":"string","description":"Personal access token to create the PR as a specific user. For GitHub: use a PAT with repo scope. For GitLab: use a PAT with api scope. If omitted, PR is created using the configured app credentials."}},"required":["repositoryIdentifier","sourceBranch","targetBranch","title"]}}},"paths":{"/sfp/api/repository/pull-requests":{"post":{"operationId":"RepositoryController_createPullRequest","summary":"Create a pull request in a repository","description":"Creates a new pull request between two branches. Supports draft pull requests. The source branch must have commits ahead of the target branch. Useful for automated PR creation in CI/CD workflows.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePullRequestDto"}}}},"responses":{"201":{"description":"The pull request has been successfully created","content":{"application/json":{"schema":{"properties":{"id":{"type":"number","description":"The pull request ID"},"number":{"type":"number","description":"The pull request number"},"html_url":{"type":"string","description":"URL to view the pull request"},"state":{"type":"string","enum":["open","closed","merged"],"description":"Current state of the pull request"},"title":{"type":"string","description":"Pull request title"},"body":{"type":"string","description":"Pull request description"},"draft":{"type":"boolean","description":"Whether this is a draft pull request"}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## GET /sfp/api/repository/pull-requests/{pull\_number}

> Get pull request details

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/pull-requests/{pull_number}":{"get":{"operationId":"RepositoryController_getPullRequest","summary":"Get pull request details","parameters":[{"name":"pull_number","required":true,"in":"path","schema":{"type":"number"}},{"name":"repositoryIdentifier","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Pull request details"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## Get PR context including metadata, changed files, and reviews

> Returns a provider-agnostic PR context with branch info, commit SHAs, changed files, reviews, and metadata. Works with GitHub, Azure DevOps, and GitLab repositories. Used by sfp analyze to get PR context without needing CI-specific environment variables.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PRContextResponseDto":{"type":"object","properties":{"prNumber":{"type":"number","description":"Pull request number"},"repositoryIdentifier":{"type":"string","description":"Repository identifier (owner/repo or org/project/repo)"},"sourceBranch":{"type":"string","description":"Source branch (head branch)"},"targetBranch":{"type":"string","description":"Target branch (base branch)"},"sourceSha":{"type":"string","description":"Source commit SHA (head commit)"},"targetSha":{"type":"string","description":"Target commit SHA (base commit)"},"title":{"type":"string","description":"PR title"},"body":{"type":"string","description":"PR description/body"},"changedFiles":{"description":"List of files changed in the PR","type":"array","items":{"type":"string"}},"reviews":{"description":"PR reviews","type":"array","items":{"$ref":"#/components/schemas/PRReviewDto"}},"author":{"type":"string","description":"PR author username"},"state":{"type":"string","description":"PR state (open, closed, merged)"},"merged":{"type":"boolean","description":"Whether PR is merged"},"htmlUrl":{"type":"string","description":"PR HTML URL"}},"required":["prNumber","repositoryIdentifier","sourceBranch","targetBranch","sourceSha","targetSha","title","changedFiles"]},"PRReviewDto":{"type":"object","properties":{"id":{"type":"number","description":"Review ID"},"user":{"type":"string","description":"Reviewer username"},"state":{"type":"string","description":"Review state (approved, changes_requested, commented)"},"body":{"type":"string","description":"Review body content"},"submittedAt":{"type":"string","description":"Review submitted timestamp"}},"required":["id","user"]}}},"paths":{"/sfp/api/repository/pull-requests/{pull_number}/context":{"get":{"operationId":"RepositoryController_getPRContext","summary":"Get PR context including metadata, changed files, and reviews","description":"Returns a provider-agnostic PR context with branch info, commit SHAs, changed files, reviews, and metadata. Works with GitHub, Azure DevOps, and GitLab repositories. Used by sfp analyze to get PR context without needing CI-specific environment variables.","parameters":[{"name":"pull_number","required":true,"in":"path","schema":{"type":"number"}},{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"PR context retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PRContextResponseDto"}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"},"404":{"description":"Pull request not found"}},"tags":["Repository"]}}}}
```

## Close a pull request

> Closes an open pull request without merging. The PR can be reopened later if needed. This action preserves all PR history including comments and reviews.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"RepositoryIdentifierDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"}},"required":["repositoryIdentifier"]}}},"paths":{"/sfp/api/repository/pull-requests/{pull_number}/close":{"patch":{"operationId":"RepositoryController_closePullRequest","summary":"Close a pull request","description":"Closes an open pull request without merging. The PR can be reopened later if needed. This action preserves all PR history including comments and reviews.","parameters":[{"name":"pull_number","required":true,"in":"path","schema":{"type":"number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryIdentifierDto"}}}},"responses":{"200":{"description":"The pull request has been successfully closed","content":{"application/json":{"schema":{"properties":{"id":{"type":"number","description":"The pull request ID"},"number":{"type":"number","description":"The pull request number"},"state":{"type":"string","enum":["closed"],"description":"Current state of the pull request"}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Reopen a pull request

> Reopens a previously closed pull request. The PR must not have been merged. All previous history including comments and reviews is preserved.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"RepositoryIdentifierDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in the format owner/repo"}},"required":["repositoryIdentifier"]}}},"paths":{"/sfp/api/repository/pull-requests/{pull_number}/reopen":{"patch":{"operationId":"RepositoryController_reopenPullRequest","summary":"Reopen a pull request","description":"Reopens a previously closed pull request. The PR must not have been merged. All previous history including comments and reviews is preserved.","parameters":[{"name":"pull_number","required":true,"in":"path","schema":{"type":"number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryIdentifierDto"}}}},"responses":{"200":{"description":"The pull request has been successfully reopened","content":{"application/json":{"schema":{"properties":{"id":{"type":"number","description":"The pull request ID"},"number":{"type":"number","description":"The pull request number"},"state":{"type":"string","enum":["open"],"description":"Current state of the pull request"}}}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Generate an authentication token for a specific repository

> Generates a scoped authentication token for the specified repository. Supports GitHub (installation tokens via GitHub App or PAT) and Azure DevOps (PAT or Service Principal). The token is cached for 50 minutes to avoid unnecessary API calls. This endpoint requires an application token and the repository must be registered as a project.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/auth-token":{"get":{"operationId":"RepositoryController_getAuthToken","summary":"Generate an authentication token for a specific repository","description":"Generates a scoped authentication token for the specified repository. Supports GitHub (installation tokens via GitHub App or PAT) and Azure DevOps (PAT or Service Principal). The token is cached for 50 minutes to avoid unnecessary API calls. This endpoint requires an application token and the repository must be registered as a project.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"Authentication token generated successfully","content":{"application/json":{"schema":{"properties":{"token":{"type":"string","description":"The authentication token"},"expiresAt":{"type":"string","format":"date-time","description":"Token expiration time in ISO format"},"type":{"type":"string","enum":["installation","pat","oauth","service_principal","app"],"description":"Type of authentication token"},"provider":{"type":"string","enum":["github","azure-devops","gitlab"],"description":"Repository provider"},"scope":{"type":"string","description":"Repository scope of the token"}}}}}},"403":{"description":"Forbidden - Requires role: application"},"404":{"description":"Repository not found or not registered as a project"}},"tags":["Repository"]}}}}
```

## Get authenticated clone URL for a repository

> Returns an HTTPS clone URL with embedded authentication token. Supports GitHub and Azure DevOps repositories. This URL can be used directly with git clone without additional authentication. The token is scoped to the repository and has the same expiration as the auth token (cached for 50 minutes). Useful for automated workflows, CI/CD pipelines, or services like Hatchet that need to clone repositories programmatically.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/clone-url":{"get":{"operationId":"RepositoryController_getCloneUrl","summary":"Get authenticated clone URL for a repository","description":"Returns an HTTPS clone URL with embedded authentication token. Supports GitHub and Azure DevOps repositories. This URL can be used directly with git clone without additional authentication. The token is scoped to the repository and has the same expiration as the auth token (cached for 50 minutes). Useful for automated workflows, CI/CD pipelines, or services like Hatchet that need to clone repositories programmatically.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"Authenticated clone URL generated successfully","content":{"application/json":{"schema":{"properties":{"cloneUrl":{"type":"string","description":"HTTPS clone URL with embedded authentication token"},"expiresAt":{"type":"string","format":"date-time","description":"Token expiration time in ISO format"},"type":{"type":"string","enum":["installation","pat","oauth","service_principal","app"],"description":"Type of authentication token"},"provider":{"type":"string","enum":["github","azure-devops","gitlab"],"description":"Repository provider"},"scope":{"type":"string","description":"Repository scope of the token"}}}}}},"403":{"description":"Forbidden - Requires role: application"},"404":{"description":"Repository not found or not registered as a project"}},"tags":["Repository"]}}}}
```

## Get npmrc configuration for repository

> Returns authenticated .npmrc file content for npm package registry access. Supports GitHub Packages (via integration), JFrog Artifactory, GitLab Package Registry, and custom npm registries. Content is cached for 50 minutes. Use this endpoint to generate .npmrc files for CI/CD workflows and Hatchet workflows that need to install private npm packages.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/npmrc":{"get":{"operationId":"RepositoryController_getNpmrc","summary":"Get npmrc configuration for repository","description":"Returns authenticated .npmrc file content for npm package registry access. Supports GitHub Packages (via integration), JFrog Artifactory, GitLab Package Registry, and custom npm registries. Content is cached for 50 minutes. Use this endpoint to generate .npmrc files for CI/CD workflows and Hatchet workflows that need to install private npm packages.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo","schema":{"type":"string"}},{"name":"scope","required":false,"in":"query","description":"NPM scope (without @ symbol). If not provided, inferred from repository owner or integration config.","schema":{"type":"string"}}],"responses":{"200":{"description":"npmrc configuration with content and scope","content":{"application/json":{"schema":{"properties":{"npmrcContent":{"type":"string","description":"The npmrc file content"},"scope":{"type":"string","description":"The npm scope used (without @ symbol)"}}}}}},"403":{"description":"Forbidden - Requires role: application"},"404":{"description":"Repository not found or not registered as a project, or no integration found"}},"tags":["Repository"]}}}}
```

## Get domains (release configs) from repository

> Downloads a repository snapshot and extracts all domain/release configurations from the config directory. Returns both a simple array of domain names and full release config details. Results are cached for 30 minutes. The config directory location defaults to "config" but can be customized in project configuration.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"DomainsResponseDto":{"type":"object","properties":{"domains":{"description":"Array of domain names","type":"array","items":{"type":"string"}},"releaseConfigs":{"description":"Detailed information about each domain with full release configs","type":"array","items":{"$ref":"#/components/schemas/DomainInfoDto"}}},"required":["domains","releaseConfigs"]},"DomainInfoDto":{"type":"object","properties":{"name":{"type":"string","description":"Domain name from release config"},"filePath":{"type":"string","description":"File path of the release config"},"config":{"type":"object","description":"Full release configuration object"}},"required":["name","filePath","config"]}}},"paths":{"/sfp/api/repository/domains":{"get":{"operationId":"RepositoryController_getDomains","summary":"Get domains (release configs) from repository","description":"Downloads a repository snapshot and extracts all domain/release configurations from the config directory. Returns both a simple array of domain names and full release config details. Results are cached for 30 minutes. The config directory location defaults to \"config\" but can be customized in project configuration.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}},{"name":"branch","required":false,"in":"query","description":"Git branch name (defaults to \"main\")","schema":{"type":"string"}},{"name":"forceRefresh","required":false,"in":"query","description":"Bypass cache and fetch fresh data","schema":{"type":"string"}}],"responses":{"200":{"description":"Domains retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainsResponseDto"}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"},"404":{"description":"Repository not found or not registered as a project"}},"tags":["Repository"]}}}}
```

## Get packages from repository sfdx-project.json

> Downloads a repository snapshot and extracts all package information from sfdx-project.json. Returns both a simple array of package names and detailed package metadata including paths, versions, types, and dependencies. Results are cached for 30 minutes.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PackagesResponseDto":{"type":"object","properties":{"packages":{"description":"Array of package names","type":"array","items":{"type":"string"}},"packageDetails":{"description":"Detailed information about each package","type":"array","items":{"$ref":"#/components/schemas/PackageInfoDto"}}},"required":["packages","packageDetails"]},"PackageInfoDto":{"type":"object","properties":{"package":{"type":"string","description":"Package name"},"path":{"type":"string","description":"Package directory path"},"versionNumber":{"type":"string","description":"Package version number"},"type":{"type":"string","description":"Package type"},"default":{"type":"boolean","description":"Whether this is the default package"},"dependencies":{"description":"Package dependencies","type":"array","items":{"type":"string"}},"domains":{"description":"Domains/release configs that include this package","type":"array","items":{"type":"string"}}},"required":["package","path","versionNumber"]}}},"paths":{"/sfp/api/repository/packages":{"get":{"operationId":"RepositoryController_getPackages","summary":"Get packages from repository sfdx-project.json","description":"Downloads a repository snapshot and extracts all package information from sfdx-project.json. Returns both a simple array of package names and detailed package metadata including paths, versions, types, and dependencies. Results are cached for 30 minutes.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}},{"name":"branch","required":false,"in":"query","description":"Git branch name (defaults to \"main\")","schema":{"type":"string"}},{"name":"forceRefresh","required":false,"in":"query","description":"Bypass cache and fetch fresh data","schema":{"type":"string"}}],"responses":{"200":{"description":"Packages retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackagesResponseDto"}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"},"404":{"description":"Repository not found, not registered as a project, or sfdx-project.json not found"}},"tags":["Repository"]}}}}
```

## Get issue or pull request details

> Retrieves details of an issue or pull request including title, body, author, labels, and state. Works with GitHub issues/PRs and Azure DevOps work items/PRs.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}":{"get":{"operationId":"RepositoryController_getIssue","summary":"Get issue or pull request details","description":"Retrieves details of an issue or pull request including title, body, author, labels, and state. Works with GitHub issues/PRs and Azure DevOps work items/PRs.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}},{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"Issue details","content":{"application/json":{"schema":{"properties":{"number":{"type":"number","description":"Issue/PR number"},"title":{"type":"string","description":"Issue title"},"body":{"type":"string","description":"Issue body/description"},"author":{"type":"string","description":"Author username"},"state":{"type":"string","description":"Current state (open/closed)"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels attached to the issue"}}}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## List comments on an issue or pull request

> Retrieves all comments on an issue or pull request.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}/comments":{"get":{"operationId":"RepositoryController_listComments","summary":"List comments on an issue or pull request","description":"Retrieves all comments on an issue or pull request.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}},{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"List of comments","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"id":{"type":"string","description":"Comment ID"},"body":{"type":"string","description":"Comment body"},"author":{"type":"string","description":"Comment author"},"createdAt":{"type":"string","format":"date-time","description":"When the comment was created"}}}}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## Add a comment to an issue or pull request

> Posts a new comment to an issue or pull request. Supports GitHub and Azure DevOps repositories.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}/comments":{"post":{"operationId":"RepositoryController_addComment","summary":"Add a comment to an issue or pull request","description":"Posts a new comment to an issue or pull request. Supports GitHub and Azure DevOps repositories.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"Comment created successfully"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Add a reaction to a comment

> Creates a reaction on a specific comment. Supports standard reactions like +1, -1, laugh, confused, heart, hooray, rocket, eyes.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}/comments/{commentId}/reactions":{"post":{"operationId":"RepositoryController_createReaction","summary":"Add a reaction to a comment","description":"Creates a reaction on a specific comment. Supports standard reactions like +1, -1, laugh, confused, heart, hooray, rocket, eyes.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}},{"name":"commentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"Reaction created successfully"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Add labels to an issue or pull request

> Adds one or more labels to an issue or pull request.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}/labels":{"post":{"operationId":"RepositoryController_addLabels","summary":"Add labels to an issue or pull request","description":"Adds one or more labels to an issue or pull request.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"Labels added successfully"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Delete a branch from a repository

> Deletes the specified branch from the remote repository. Protected branches cannot be deleted.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/branches/{branchName}":{"delete":{"operationId":"RepositoryController_deleteBranch","summary":"Delete a branch from a repository","description":"Deletes the specified branch from the remote repository. Protected branches cannot be deleted.","parameters":[{"name":"branchName","required":true,"in":"path","schema":{"type":"string"}},{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"Branch deleted successfully"},"403":{"description":"Forbidden - Requires role: owner, application"},"404":{"description":"Branch not found"},"422":{"description":"Branch is protected and cannot be deleted"}},"tags":["Repository"]}}}}
```

## Remove a label from an issue or pull request

> Removes a label from an issue or pull request. Works with GitHub and Azure DevOps.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/issues/{issueNumber}/labels/{label}":{"delete":{"operationId":"RepositoryController_removeLabel","summary":"Remove a label from an issue or pull request","description":"Removes a label from an issue or pull request. Works with GitHub and Azure DevOps.","parameters":[{"name":"issueNumber","required":true,"in":"path","schema":{"type":"string"}},{"name":"label","required":true,"in":"path","schema":{"type":"string"}},{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo (GitHub) or org/project/repo (Azure DevOps)","schema":{"type":"string"}}],"responses":{"200":{"description":"Label removed successfully"},"403":{"description":"Forbidden - Requires role: owner, application"},"404":{"description":"Label not found on the issue"}},"tags":["Repository"]}}}}
```

## GET /sfp/api/repository/workspace-tree

> Get workspace metadata tree for a repository

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/workspace-tree":{"get":{"operationId":"WorkspaceTreeController_getTree","summary":"Get workspace metadata tree for a repository","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo","schema":{"type":"string"}},{"name":"branch","required":false,"in":"query","description":"Branch name","schema":{"default":"main","type":"string"}}],"responses":{"200":{"description":"Workspace tree retrieved or generation triggered"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## POST /sfp/api/repository/workspace-tree

> Store workspace metadata tree for a repository

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"StoreWorkspaceTreeDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in format owner/repo"},"branch":{"type":"string","description":"Branch name"},"nodes":{"type":"array","description":"Array of workspace tree nodes"},"metadata":{"type":"object","description":"Additional metadata about the tree build"}},"required":["repositoryIdentifier","branch","nodes"]}}},"paths":{"/sfp/api/repository/workspace-tree":{"post":{"operationId":"WorkspaceTreeController_storeTree","summary":"Store workspace metadata tree for a repository","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreWorkspaceTreeDto"}}}},"responses":{"201":{"description":"Workspace tree stored successfully"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## POST /sfp/api/repository/workspace-tree/refresh

> Force re-generation of workspace tree

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"RefreshWorkspaceTreeDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in format owner/repo"},"branch":{"type":"string","description":"Branch name","default":"main"}},"required":["repositoryIdentifier"]}}},"paths":{"/sfp/api/repository/workspace-tree/refresh":{"post":{"operationId":"WorkspaceTreeController_refreshTree","summary":"Force re-generation of workspace tree","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshWorkspaceTreeDto"}}}},"responses":{"200":{"description":"Workspace tree refresh triggered"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## GET /sfp/api/repository/workspace-tree/overlays/code-analysis

> Get code analysis overlay for workspace tree nodes

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/workspace-tree/overlays/code-analysis":{"get":{"operationId":"WorkspaceTreeController_getCodeAnalysisOverlay","summary":"Get code analysis overlay for workspace tree nodes","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo","schema":{"type":"string"}},{"name":"branch","required":false,"in":"query","description":"Branch name","schema":{"default":"main","type":"string"}},{"name":"nodeId","required":false,"in":"query","description":"Node ID to scope the overlay to","schema":{"type":"string"}},{"name":"packageName","required":false,"in":"query","description":"Package name to scope the overlay to","schema":{"type":"string"}},{"name":"domain","required":false,"in":"query","description":"Domain to scope the overlay to","schema":{"type":"string"}}],"responses":{"200":{"description":"Code analysis overlay data"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Repository"]}}}}
```

## GET /sfp/api/repository/workspace-tree/file-content

> Get file content from a repository

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/workspace-tree/file-content":{"get":{"operationId":"WorkspaceTreeController_getFileContent","summary":"Get file content from a repository","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier in format owner/repo","schema":{"type":"string"}},{"name":"branch","required":true,"in":"query","description":"Branch name","schema":{"type":"string"}},{"name":"filePath","required":true,"in":"query","description":"File path relative to repository root","schema":{"type":"string"}}],"responses":{"200":{"description":"File content retrieved successfully"},"403":{"description":"Forbidden - Requires role: member, owner, application"},"404":{"description":"File not found"}},"tags":["Repository"]}}}}
```

## Get package baselines

> Get baselines for a specific package, or all packages on a branch if packageName is omitted.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/package-baselines":{"get":{"operationId":"PackageBaselineController_getBaselines","summary":"Get package baselines","description":"Get baselines for a specific package, or all packages on a branch if packageName is omitted.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier","schema":{"type":"string"}},{"name":"branch","required":true,"in":"query","description":"Branch name","schema":{"type":"string"}},{"name":"packageName","required":false,"in":"query","description":"Package name (omit to get all packages for the branch)","schema":{"type":"string"}}],"responses":{"200":{"description":"Package baseline(s) returned"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Repository"]}}}}
```

## Create or update a package baseline

> Sets the default baseline and optional per-environment baselines for a package on a branch.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"UpsertPackageBaselineDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier (e.g., flxbl-io/sf-core)"},"branch":{"type":"string","description":"Branch name"},"packageName":{"type":"string","description":"Package name"},"packageType":{"type":"string","description":"Package type","enum":["source","unlocked","data","diff"]},"defaultBaseline":{"type":"string","description":"Default baseline commit SHA for this package on this branch"},"defaultVersion":{"type":"string","description":"Package version from sfdx-project.json at time of baseline creation"},"environments":{"type":"object","description":"Per-environment baselines"}},"required":["repositoryIdentifier","branch","packageName","packageType","defaultBaseline"]}}},"paths":{"/sfp/api/repository/package-baselines":{"put":{"operationId":"PackageBaselineController_upsertBaseline","summary":"Create or update a package baseline","description":"Sets the default baseline and optional per-environment baselines for a package on a branch.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertPackageBaselineDto"}}}},"responses":{"200":{"description":"Package baseline created or updated"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Update environment baseline after deployment

> Advances the baseline for a specific environment after a successful package deployment.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"UpdateEnvironmentBaselineDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier (e.g., flxbl-io/sf-core)"},"branch":{"type":"string","description":"Branch name"},"packageName":{"type":"string","description":"Package name"},"baseline":{"type":"string","description":"Commit SHA deployed to this environment"},"version":{"type":"string","description":"Package version at time of deploy"}},"required":["repositoryIdentifier","branch","packageName","baseline"]}}},"paths":{"/sfp/api/repository/package-baselines/environments/{environmentName}":{"patch":{"operationId":"PackageBaselineController_updateEnvironmentBaseline","summary":"Update environment baseline after deployment","description":"Advances the baseline for a specific environment after a successful package deployment.","parameters":[{"name":"environmentName","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnvironmentBaselineDto"}}}},"responses":{"200":{"description":"Environment baseline updated"},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Repository"]}}}}
```

## Query baseline changelog

> Returns the history of baseline changes, filterable by package, environment, branch, and date range.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.3.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/repository/package-baselines/changelog":{"get":{"operationId":"PackageBaselineController_getChangelog","summary":"Query baseline changelog","description":"Returns the history of baseline changes, filterable by package, environment, branch, and date range.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier","schema":{"type":"string"}},{"name":"packageName","required":false,"in":"query","description":"Filter by package name","schema":{"type":"string"}},{"name":"branch","required":false,"in":"query","description":"Filter by branch","schema":{"type":"string"}},{"name":"environmentName","required":false,"in":"query","description":"Filter by environment name","schema":{"type":"string"}},{"name":"since","required":false,"in":"query","description":"ISO 8601 start date","schema":{"type":"string"}},{"name":"until","required":false,"in":"query","description":"ISO 8601 end date","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Max results to return","schema":{"default":50,"type":"number"}},{"name":"offset","required":false,"in":"query","description":"Number of results to skip","schema":{"default":0,"type":"number"}}],"responses":{"200":{"description":"Changelog entries returned"},"403":{"description":"Forbidden - Requires role: owner, member, application"}},"tags":["Repository"]}}}}
```
