# \GitSyncApi
All URIs are relative to */api*
[**assign_ghes_installation**](GitSyncApi.md#assign_ghes_installation) | **POST** /github_app/ghes/assign | Assign GHES installation to a workspace
[**delete_from_workspace**](GitSyncApi.md#delete_from_workspace) | **DELETE** /w/{workspace}/github_app/installation/{installation_id} | Delete a GitHub installation from a workspace
[**discover_ghes_installations**](GitSyncApi.md#discover_ghes_installations) | **GET** /github_app/ghes/discover | Discover GHES App installations
[**export_installation**](GitSyncApi.md#export_installation) | **GET** /w/{workspace}/github_app/export/{installationId} | Export GitHub installation JWT token
[**get_credential_origin**](GitSyncApi.md#get_credential_origin) | **GET** /w/{workspace}/git_sync/credential/origin | Where a repository's credential comes from
[**get_ghes_config**](GitSyncApi.md#get_ghes_config) | **GET** /github_app/ghes_config | Get GHES app config
[**get_global_connected_repositories**](GitSyncApi.md#get_global_connected_repositories) | **GET** /github_app/connected_repositories | get connected repositories
[**ghes_installation_callback**](GitSyncApi.md#ghes_installation_callback) | **POST** /w/{workspace}/github_app/ghes_installation_callback | GHES installation callback
[**import_installation**](GitSyncApi.md#import_installation) | **POST** /w/{workspace}/github_app/import | Import GitHub installation from JWT token
[**install_from_workspace**](GitSyncApi.md#install_from_workspace) | **POST** /w/{workspace}/github_app/install_from_workspace | Install a GitHub installation from another workspace
[**list_gitlab_projects**](GitSyncApi.md#list_gitlab_projects) | **POST** /w/{workspace}/git_sync/gitlab/projects | List the GitLab projects a token can sync
[**set_git_credential**](GitSyncApi.md#set_git_credential) | **POST** /w/{workspace}/git_sync/credential | Store the credential for a git repository
[**unassign_ghes_installation**](GitSyncApi.md#unassign_ghes_installation) | **DELETE** /github_app/ghes/assign/{workspace_id}/{installation_id} | Unassign GHES installation from a workspace
## assign_ghes_installation
> assign_ghes_installation(assign_ghes_installation_request)
Assign GHES installation to a workspace
Assigns a discovered GHES App installation to a workspace. The resulting installation is marked as admin-provisioned, so workspace admins cannot remove it. Super-admin only.
### Parameters
**assign_ghes_installation_request** | [**AssignGhesInstallationRequest**](AssignGhesInstallationRequest.md) | | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_from_workspace
> delete_from_workspace(workspace, installation_id)
Delete a GitHub installation from a workspace
Removes a GitHub installation from the specified workspace. Requires admin privileges.
### Parameters
**workspace** | **String** | | [required] |
**installation_id** | **i64** | The ID of the GitHub installation to delete | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## discover_ghes_installations
> Vec<models::DiscoverGhesInstallations200ResponseInner> discover_ghes_installations()
Discover GHES App installations
Lists every installation the configured self-managed GitHub App can see, annotated with the workspaces in this Windmill instance the installation is currently assigned to. Super-admin only.
### Parameters
This endpoint does not need any parameter.
### Return type
[**Vec<models::DiscoverGhesInstallations200ResponseInner>**](discoverGhesInstallations_200_response_inner.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## export_installation
> models::ExportInstallation200Response export_installation(workspace, installation_id)
Export GitHub installation JWT token
Exports the JWT token for a specific GitHub installation in the workspace
### Parameters
**workspace** | **String** | | [required] |
**installation_id** | **i32** | | [required] |
### Return type
[**models::ExportInstallation200Response**](exportInstallation_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_credential_origin
> models::GetCredentialOrigin200Response get_credential_origin(workspace, path)
Where a repository's credential comes from
Whether Windmill holds this repository's access token, and which host it talks to. `held` means this workspace stores it, `borrowed` means an ancestor does and it is not this workspace's to replace. Both absent means the repository authenticates with whatever its URL carries. Returns no secret. Requires workspace admin.
### Parameters
**workspace** | **String** | | [required] |
**path** | **String** | Path of the git repository resource, with or without the `$res:` prefix. A path rather than a URL, because a resource URL may carry a token and a URL in a query string lands in logs. | [required] |
### Return type
[**models::GetCredentialOrigin200Response**](getCredentialOrigin_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_ghes_config
> models::GetGhesConfig200Response get_ghes_config()
Get GHES app config
Returns the GitHub Enterprise Server app configuration (without private key) for constructing the installation URL
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::GetGhesConfig200Response**](getGhesConfig_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_global_connected_repositories
> Vec<models::GithubInstallationsInner> get_global_connected_repositories(page)
get connected repositories
### Parameters
**page** | Option<**i32**> | Page number for pagination (default 1) | |[default to 1]
### Return type
[**Vec<models::GithubInstallationsInner>**](GithubInstallations_inner.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## ghes_installation_callback
> ghes_installation_callback(workspace, ghes_installation_callback_request)
GHES installation callback
Register a self-managed GitHub App installation from GitHub Enterprise Server
### Parameters
**workspace** | **String** | | [required] |
**ghes_installation_callback_request** | [**GhesInstallationCallbackRequest**](GhesInstallationCallbackRequest.md) | | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## import_installation
> import_installation(workspace, import_installation_request)
Import GitHub installation from JWT token
Imports a GitHub installation from a JWT token exported from another instance
### Parameters
**workspace** | **String** | | [required] |
**import_installation_request** | [**ImportInstallationRequest**](ImportInstallationRequest.md) | | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## install_from_workspace
> install_from_workspace(workspace, install_from_workspace_request)
Install a GitHub installation from another workspace
### Parameters
**workspace** | **String** | | [required] |
**install_from_workspace_request** | [**InstallFromWorkspaceRequest**](InstallFromWorkspaceRequest.md) | | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_gitlab_projects
> Vec<models::GitlabProject> list_gitlab_projects(workspace, list_gitlab_projects_request)
List the GitLab projects a token can sync
Lists the projects the supplied GitLab token can push to, so a git repository resource can be filled in without hand-writing a project path. The token is used for this call only and is never stored. Requires workspace admin.
### Parameters
**workspace** | **String** | | [required] |
**list_gitlab_projects_request** | [**ListGitlabProjectsRequest**](ListGitlabProjectsRequest.md) | | [required] |
### Return type
[**Vec<models::GitlabProject>**](GitlabProject.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## set_git_credential
> String set_git_credential(workspace, set_git_credential_request)
Store the credential for a git repository
Stores the access token a git repository authenticates with, so it does not have to be written into the repository URL or a workspace variable. The token is write-only: it is served only to a git-sync job that presents its own job token, and a fork of this workspace reads this copy instead of holding one of its own. Requires workspace admin.
### Parameters
**workspace** | **String** | | [required] |
**set_git_credential_request** | [**SetGitCredentialRequest**](SetGitCredentialRequest.md) | | [required] |
### Return type
**String**
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## unassign_ghes_installation
> unassign_ghes_installation(workspace_id, installation_id)
Unassign GHES installation from a workspace
Removes an installation (admin-provisioned or otherwise) from a workspace. Super-admin only. Does not affect the installation on the GitHub side.
### Parameters
**workspace_id** | **String** | | [required] |
**installation_id** | **i64** | | [required] |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)