# GetWrite returns a repository or its write credentials

`GET /api/v1/write-repositories/{repo}`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: apiKey, header Authorization. A token sent as `Authorization: Bearer <token>`. [API Docs](https://sourcey-argocd.pages.dev/developer-guide/api-docs/index.md#authorization) shows how to get one.

Parameters:

- `repo` (path, string, required) - Repo URL for query
  Type: string

- `forceRefresh` (query, boolean, optional) - Whether to force a cache refresh on repo's connection state.
  Type: boolean

- `appProject` (query, string, optional) - App project for query.
  Type: string

Responses:

- 200: A successful response.

Content type: application/json

Type: object

Schema: [v1alpha1Repository](https://sourcey-argocd.pages.dev/api/models/v1alpha1repository/index.md)

- `azureActiveDirectoryEndpoint` (optional)
  Type: string

- `azureServicePrincipalClientId` (optional)
  Type: string

- `azureServicePrincipalClientSecret` (optional)
  Type: string

- `azureServicePrincipalTenantId` (optional)
  Type: string

- `bearerToken` (optional)
  Type: string

- `connectionState` (optional)
  Reference: [v1alpha1ConnectionState](https://sourcey-argocd.pages.dev/api/models/v1alpha1connectionstate/index.md); Type: object

- `depth` (optional)
  Type: integer, int64
  
  Depth specifies the depth for shallow clones. A value of 0 or omitting the field indicates a full clone.

- `enableLfs` (optional)
  Type: boolean
  
  EnableLFS specifies whether git-lfs support should be enabled for this repo. Only valid for Git repositories.

- `enableOCI` (optional)
  Type: boolean

- `forceHttpBasicAuth` (optional)
  Type: boolean

- `gcpServiceAccountKey` (optional)
  Type: string

- `githubAppEnterpriseBaseUrl` (optional)
  Type: string

- `githubAppID` (optional)
  Type: integer, int64

- `githubAppInstallationID` (optional)
  Type: integer, int64

- `githubAppPrivateKey` (optional)
  Type: string

- `inheritedCreds` (optional)
  Type: boolean

- `insecure` (optional)
  Type: boolean

- `insecureIgnoreHostKey` (optional)
  Type: boolean

- `insecureOCIForceHttp` (optional)
  Type: boolean
  
  InsecureOCIForceHttp specifies whether the connection to the repository uses TLS at _all_. If true, no TLS. This flag is applicable for OCI repos only.

- `name` (optional)
  Type: string

- `noProxy` (optional)
  Type: string

- `password` (optional)
  Type: string

- `project` (optional)
  Type: string

- `proxy` (optional)
  Type: string

- `repo` (optional)
  Type: string

- `sshPrivateKey` (optional)
  Type: string
  
  SSHPrivateKey contains the PEM data for authenticating at the repo server. Only used with Git repos.

- `tlsClientCertData` (optional)
  Type: string

- `tlsClientCertKey` (optional)
  Type: string

- `type` (optional)
  Type: string
  
  Type specifies the type of the repo. Can be either "git" or "helm. "git" is assumed if empty or absent.

- `useAzureWorkloadIdentity` (optional)
  Type: boolean

- `username` (optional)
  Type: string

- `webhookManifestCacheWarmDisabled` (optional)
  Type: boolean
  
  WebhookManifestCacheWarmDisabled disables manifest cache warming during webhook processing for this repository.
  When set, webhook handlers will only trigger reconciliation for affected applications and skip Redis cache
  operations for unaffected ones. Recommended for large monorepos with plain YAML manifests.

- default: An unexpected error response.

Content type: application/json

Type: object

Schema: [runtimeError](https://sourcey-argocd.pages.dev/api/models/runtimeerror/index.md)

- `code` (optional)
  Type: integer, int32

- `details` (optional)
  Type: array
  
  Items:
    Reference: [protobufAny](https://sourcey-argocd.pages.dev/api/models/protobufany/index.md); Type: object

- `error` (optional)
  Type: string

- `message` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X GET 'https://argocd.example.com/api/v1/write-repositories/string' \
  -H 'Authorization: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://argocd.example.com/api/v1/write-repositories/string', {
  method: 'GET',
  headers: {
    'Authorization': 'YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://argocd.example.com/api/v1/write-repositories/string',
    headers={
        'Authorization': 'YOUR_TOKEN',
    },
)
print(response.text)
```
