# Branch

List of selected repository's branch.

# HTTP Request:

POST https://api.serveravatar.com/organizations/{organization}/git-providers/{provider_id}/branches

# Parameter:

Parameters Required Type Description
provider Yes String Select any one provider from bitbucket, github, or gitlab.
workspace_slug No String Required, if provider is bitbucket.
repository_slug No String Required, if provider is bitbucket.
username No String Required, if provider is github.
repository_name No String Required, if provider is github.
project_id No String Required, if provider is gitlab.

# Curl Request Example:

curl --request POST \
  --url "https://api.serveravatar.com/organizations/5/git-providers/8/branches" \
  --header 'Content-Type: application/json' \
  --header 'Authorization: <YOUR API TOKEN>' \
  --data '{
    "provider":"gitlab",
    "project_id":36680818
  }'

# Response:

# Branch lists

  • 200 (Ok)
{
  "gitBranches": [
    "test",
    "test-demo"
  ]
}

# Organization Not Found

  • 404 (Not Found)
{
    "message": "Organization not found!"
}

# Provider Not Found

  • 404 (Not Found)
{
    "message": "Git Provider not found!"
}

# Server Error

  • 500 (Internal Server Error)
{
    "message": "Something went really wrong!"
}
Last Updated: 3/1/2023, 3:30:12 PM