Skip to content

Probe the configured Git Sync remote without saving.

POST
/git/test-connection
curl --request POST \
--url https://your-server.example/api/git/test-connection \
--header 'Content-Type: application/json' \
--cookie session=<session> \
--data '{ "remote": "example", "branch": "main", "ssh_key_path": "example", "https_username": "example", "https_token": "example" }'

Performs an ls-remote against the supplied remote with the supplied credentials and reports whether auth succeeded and whether the branch exists. Always returns 200 with a structured body; failures are classified via the code field rather than via HTTP status.

If https_token is omitted (null), the currently stored token (if any) is used. Pass an empty string to probe with no token.

Media typeapplication/json
object
remote
required
string
branch
string
default: main
ssh_key_path
string
https_username
string
https_token

Null = use stored token; “” = no token; non-empty = use this token.

string
nullable

Probe completed (success or classified failure).

Media typeapplication/json
object
ok
required
boolean
code
required
string
Allowed values: ok auth_failed not_found branch_missing network unknown
message
required
string
branch_found
required
boolean
raw_error
required
string

Example

{
"code": "ok"
}

Invalid request body.

Unauthenticated.

Not a super-admin.