Skip to content
ShaireDevelopers

git

11 endpoints.

Create a branch for a ticket, read which branches and pull requests it already has, and read the transition rules that move a ticket when one merges. Connecting a provider is a one-time setup an admin does in the app.

get/api/git/connections#

workspace:adminadmin only
Request
curl https://api.shairelabs.com/api/git/connections \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 200 · GitConnection[]

idstring · uuid*
providerstring*
githubgitlab
accountLoginstring*
webUrlstring*
connectedAtstring*
repositoryCountinteger*

Also answers 401 and 403. SeeErrors.

get/api/git/connections/{id}/repositories#

workspace:adminadmin only

Path

idstring*
Request
curl https://api.shairelabs.com/api/git/connections/$CONNECTION_ID/repositories \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 200 · GitRemoteRepository[]

externalIdstring*
fullNamestring*
defaultBranchstring*
webUrlstring*
enabledboolean*

Also answers 401 and 403. SeeErrors.

delete/api/git/links/{id}#

Path

idstring*
Request
curl https://api.shairelabs.com/api/git/links/$LINK_ID \
  -X DELETE \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 204

Also answers 401 and 403. SeeErrors.

get/api/git/providers#

Request
curl https://api.shairelabs.com/api/git/providers \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 200 · GitProvider[]

Also answers 401 and 403. SeeErrors.

get/api/git/repositories#

Request
curl https://api.shairelabs.com/api/git/repositories \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 200 · GitRepository[]

idstring · uuid*
connectionIdstring · uuid*
providerstring*
githubgitlab
externalIdstring*
fullNamestring*
defaultBranchstring*
webUrlstring*

Also answers 401 and 403. SeeErrors.

post/api/git/repositories#

workspace:adminadmin only

Body

connectionIdstring · uuid*
externalIdstring*
min length 1
Request
curl https://api.shairelabs.com/api/git/repositories \
  -X POST \
  -H "Authorization: Bearer $SHAIRE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"connectionId":"00000000-0000-0000-0000-000000000000","externalId":"example"}'

Response · 201 · GitRepository

idstring · uuid*
connectionIdstring · uuid*
providerstring*
githubgitlab
externalIdstring*
fullNamestring*
defaultBranchstring*
webUrlstring*

Also answers 401 and 403. SeeErrors.

delete/api/git/repositories/{id}#

workspace:adminadmin only

Path

idstring*
Request
curl https://api.shairelabs.com/api/git/repositories/$REPOSITORY_ID \
  -X DELETE \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 204

Also answers 401 and 403. SeeErrors.

post/api/git/tickets/{id}/branches#

Path

idstring*

Body

repositoryIdstring · uuid*
baseBranchstring*
min length 1 · max length 255
namestring*
min length 1 · max length 255
Request
curl https://api.shairelabs.com/api/git/tickets/$TICKET_ID/branches \
  -X POST \
  -H "Authorization: Bearer $SHAIRE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"repositoryId":"00000000-0000-0000-0000-000000000000","baseBranch":"example","name":"example"}'

Response · 201 · TicketGitLink

idstring · uuid*
ticketIdstring · uuid*
repositoryIdstring · uuid*
providerstring*
githubgitlab
repositoryFullNamestring*
kindstring*
branchpull_request
statestring*
branchbranch_deletedpr_draftpr_openpr_mergedpr_closed
numberinteger | null*
branchNamestring | null*
titlestring | null*
urlstring*
createdAtstring*
updatedAtstring*

Also answers 401 and 403. SeeErrors.

get/api/git/transition-rules#

Request
curl https://api.shairelabs.com/api/git/transition-rules \
  -H "Authorization: Bearer $SHAIRE_TOKEN"

Response · 200 · GitTransitionRule[]

eventstring*
branch_createdpr_openedpr_readypr_mergedpr_closed
statusIdstring · uuid | null*

Also answers 401 and 403. SeeErrors.

put/api/git/transition-rules#

workspace:adminadmin only

Body

rulesobject[]*
[item]object
eventstring*
branch_createdpr_openedpr_readypr_mergedpr_closed
statusIdstring · uuid | null*
Request
curl https://api.shairelabs.com/api/git/transition-rules \
  -X PUT \
  -H "Authorization: Bearer $SHAIRE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"rules":[]}'

Response · 200 · GitTransitionRule[]

eventstring*
branch_createdpr_openedpr_readypr_mergedpr_closed
statusIdstring · uuid | null*

Also answers 401 and 403. SeeErrors.