Connected repositories
GitHub and GitLab connections; projects built from a repository on every push, with previews, commit statuses and pull request comments.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Response
200object
githubobjectavailableboolean
gitlabobjectavailablebooleandefault_hoststringhostsstring[]custom_hostsboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/repos/config" \
-H "Authorization: Bearer $KEY"/v1/repos/connectionsThe team's Git connections#
- Credential
- An API key or a dashboard session
- Roles
- Any role
Response
200object
connectionsobject[]idstring (uuid)providerstringone of
github,gitlabhoststringloginstring | nullstatusstringone of
active,revokedown_applicationbooleanprojectsintegercreated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/repos/connections" \
-H "Authorization: Bearer $KEY"- Credential
- An API key or a dashboard session
- Roles
- owner, admin
Request bodyapplication/json
providerstringrequiredone of
github,gitlabhoststringGitLab only: a self-hosted GitLab's https address
application_idstringsecretstring
Response
200object
providerstringidstringauthorize_urlstring
Errors
| Status | Description |
|---|---|
| 400 | bad_provider, bad_host, needs_application, bad_application |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
| 503 | not_configured: connecting GitHub is not set up on this platform |
Example
curl -X POST "https://api.ibel.ai/v1/repos/connections" \
-H "Authorization: Bearer $KEY" \
-d '{"provider":"github"}'/v1/repos/connections/finishFinish connecting GitHub or GitLab#
Called by the dashboard when the browser comes back from the Git host with ?finish=<ticket>. Only the person who began the connection, in the team it was begun for, can finish it, once.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin
Request bodyapplication/json
ticketstringrequired
Response
200object
connectedstring (uuid)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: expired, failed |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden, not_starter, not_yours |
| 409 | Conflict: taken |
| 500 | internal: an unexpected failure |
| 502 | The Git host did not answer: failed |
Example
curl -X POST "https://api.ibel.ai/v1/repos/connections/finish" \
-H "Authorization: Bearer $KEY" \
-d '{"ticket":"…"}'/v1/repos/connections/{id}Remove a Git connection#
- Credential
- An API key or a dashboard session
- Roles
- owner, admin
Parameters
idstring (uuid)pathrequiredunlinkbooleanqueryalso unlink the projects that use it
Response
200object
idstringdeletedbooleanunlinkedobject[]kindstringnamestring
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found |
| 409 | in_use: projects are linked; pass unlink=true |
| 500 | internal: an unexpected failure |
Example
curl -X DELETE "https://api.ibel.ai/v1/repos/connections/88e2fe1d-6d75-4de5-8c8f-27380ec66903" \
-H "Authorization: Bearer $KEY"/v1/repos/connections/{id}/repositoriesRepositories a connection can reach#
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
idstring (uuid)pathrequiredqstringquerypart of a repository name
Response
200object
repositoriesobject[]idstringnamestringdefault_branchstringprivatebooleanprojectsobject[]kindstringnamestring
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found |
| 500 | internal: an unexpected failure |
| 502 | provider: the Git host did not answer |
Example
curl "https://api.ibel.ai/v1/repos/connections/88e2fe1d-6d75-4de5-8c8f-27380ec66903/repositories" \
-H "Authorization: Bearer $KEY"/v1/repos/importMake a project from a repository#
Creates the project, links it and builds the production branch.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Request bodyapplication/json
namestringrequiredkindstringone of
app,functionconnectionstringrequiredrepostringrequiredthe repository's id from the repositories list
production_branchstringpreviewsboolean
Response
201objectCreated
projectobjectkindstringnamestring
repoobjectconnectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
buildstring | nullcommitstring | null
Errors
| Status | Description |
|---|---|
| 400 | bad_name, bad_kind, bad_connection, bad_repo, bad_branch |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 409 | name_taken |
| 500 | internal: an unexpected failure |
Example
curl -X POST "https://api.ibel.ai/v1/repos/import" \
-H "Authorization: Bearer $KEY" \
-d '{"name":"my-api","connection":"…","repo":"…"}'/v1/apps/{name}/repoThe repository a project is built from#
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Response
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/apps/my-api/repo" \
-H "Authorization: Bearer $KEY"/v1/apps/{name}/repoLink a project to a repository#
Replaces an earlier link. GitLab: adds a webhook to the project.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Request bodyapplication/json
connectionstringrequiredrepostringrequiredproduction_branchstringpreviewsboolean
Response
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 400 | bad_connection, bad_repo, bad_branch, bad_previews |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found |
| 500 | internal: an unexpected failure |
Example
curl -X PUT "https://api.ibel.ai/v1/apps/my-api/repo" \
-H "Authorization: Bearer $KEY" \
-d '{"connection":"…","repo":"…"}'/v1/apps/{name}/repoStop building a project from its repository#
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Response
200object
unlinkedboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
Example
curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/repo" \
-H "Authorization: Bearer $KEY"/v1/apps/{name}/repo/buildsBuild a branch of the linked repository now#
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Request bodyapplication/json
branchstringdefault: the production branch
Response
201objectCreated
buildstringbranchstringcommitstringproductionboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_linked, no_branch |
| 409 | not_built |
| 500 | internal: an unexpected failure |
Example
curl -X POST "https://api.ibel.ai/v1/apps/my-api/repo/builds" \
-H "Authorization: Bearer $KEY" \
-d '{"branch":"dev"}'/v1/functions/{name}/repoThe repository a project is built from#
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Response
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/functions/my-api/repo" \
-H "Authorization: Bearer $KEY"/v1/functions/{name}/repoLink a project to a repository#
Replaces an earlier link. GitLab: adds a webhook to the project.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Request bodyapplication/json
connectionstringrequiredrepostringrequiredproduction_branchstringpreviewsboolean
Response
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 400 | bad_connection, bad_repo, bad_branch, bad_previews |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found |
| 500 | internal: an unexpected failure |
Example
curl -X PUT "https://api.ibel.ai/v1/functions/my-api/repo" \
-H "Authorization: Bearer $KEY" \
-d '{"connection":"…","repo":"…"}'/v1/functions/{name}/repoStop building a project from its repository#
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Response
200object
unlinkedboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
Example
curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/repo" \
-H "Authorization: Bearer $KEY"/v1/functions/{name}/repo/buildsBuild a branch of the linked repository now#
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
namestringpathrequiredthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
Request bodyapplication/json
branchstringdefault: the production branch
Response
201objectCreated
buildstringbranchstringcommitstringproductionboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_linked, no_branch |
| 409 | not_built |
| 500 | internal: an unexpected failure |
Example
curl -X POST "https://api.ibel.ai/v1/functions/my-api/repo/builds" \
-H "Authorization: Bearer $KEY" \
-d '{"branch":"dev"}'/v1/repos/webhooks/githubWebhook from GitHub#
Called by GitHub; verified by X-Hub-Signature-256 (HMAC-SHA256 of the raw body). Roles: none (signature).
- Credential
- None
Parameters
X-Hub-Signature-256stringheaderrequiredsha256=<hex>
X-GitHub-Eventstringheaderrequiredthe event type
Request bodyapplication/json
object
Response
202objectAccepted
okbooleanresultstring
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
Example
curl -X POST "https://api.ibel.ai/v1/repos/webhooks/github" \
-d '{}'/v1/repos/webhooks/gitlab/{link}Webhook from GitLab#
Called by GitLab; verified by X-Gitlab-Token, one secret per linked project. Roles: none (token).
- Credential
- None
Parameters
linkstring (uuid)pathrequiredX-Gitlab-Tokenstringheaderrequiredthe project's hook secret
X-Gitlab-EventstringheaderrequiredPush Hook or Merge Request Hook
Request bodyapplication/json
object
Response
202objectAccepted
okbooleanresultstring
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
Example
curl -X POST "https://api.ibel.ai/v1/repos/webhooks/gitlab/link" \
-d '{}'/v1/repos/callback/githubReturn from Github's approval page#
Connects nothing itself: redirects to the dashboard's Settings → Git with a one-time finish=<ticket> (finished there with the person's session, POST /v1/repos/connections/finish) or error=<code>. Roles: none (signed state).
- Credential
- None
Response
302Redirect to the dashboard
Errors
| Status | Description |
|---|---|
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/repos/callback/github"/v1/repos/callback/gitlabReturn from Gitlab's approval page#
Connects nothing itself: redirects to the dashboard's Settings → Git with a one-time finish=<ticket> (finished there with the person's session, POST /v1/repos/connections/finish) or error=<code>. Roles: none (signed state).
- Credential
- None
Response
302Redirect to the dashboard
Errors
| Status | Description |
|---|---|
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/repos/callback/gitlab"