Validate git repository access
POST
/api/v1/projects/validate-git
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/validate-git';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"git_provider":"github","git_repo_url":"example","git_token":"example","project_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.deploybase.eu/api/v1/api/v1/projects/validate-git \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "git_provider": "github", "git_repo_url": "example", "git_token": "example", "project_id": "example" }'Tests whether a git repository URL is accessible, optionally with an access token
Authorizations
Section titled “ Authorizations ”Request Body
Section titled “ Request Body ”Git repository details
Media type application/json
object
git_provider
string
git_repo_url
required
string
git_token
string
project_id
ProjectID, when set, lets validation fall back to the project’s stored token if git_token is omitted — so a saved credential can be tested.
string
Responses
Section titled “ Responses ”OK
Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "data": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Bad Request
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Git validation failed
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}