---
title: "Test a Git source connection"
method: POST
path: "/gitops/sources/test"
tags: ["gitops"]
---

# Test a Git source connection

`POST /gitops/sources/test`

Tests connectivity for Git connection details that have not been persisted yet.
**Access policy**: authenticated

## Request body

- SourcesGitSourceCreatePayload
  - `administratorsOnly` boolean
  - `authentication` SourcesGitAuthenticationPayload
    - `password` string
    - `username` string
  - `interval` string
  - `name` string
  - `public` boolean
  - `teamAccesses` integer[]
  - `tlsSkipVerify` boolean
  - `url` string, required
  - `userAccesses` integer[]

## Response `200`

Connection test result

- SourcesConnectionTestResult
  - `error` string
  - `success` boolean

## Other responses

- `400` — Invalid request payload
- `403` — Access denied
- `500` — Server error

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/versions/c0b0975cd11b/schema)
