ریپازیتوریهای Git
اتصال GitHub و GitLab، متصل کردن پروژه به ریپازیتوری، بیلد با هر push و وبهوکهای Git.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پاسخ
200object
githubobjectavailableboolean
gitlabobjectavailablebooleandefault_hoststringhostsstring[]custom_hostsboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/repos/config" \
-H "Authorization: Bearer $KEY"/v1/repos/connectionsThe team's Git connections#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پاسخ
200object
connectionsobject[]idstring (uuid)providerstringone of
github,gitlabhoststringloginstring | nullstatusstringone of
active,revokedown_applicationbooleanprojectsintegercreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/repos/connections" \
-H "Authorization: Bearer $KEY"- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین
بدنهٔ درخواستapplication/json
providerstringالزامیone of
github,gitlabhoststringGitLab only: a self-hosted GitLab's https address
application_idstringsecretstring
پاسخ
200object
providerstringidstringauthorize_urlstring
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین
بدنهٔ درخواستapplication/json
ticketstringالزامی
پاسخ
200object
connectedstring (uuid)
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین
پارامترها
idstring (uuid)مسیرالزامیunlinkbooleanکوئریalso unlink the projects that use it
پاسخ
200object
idstringdeletedbooleanunlinkedobject[]kindstringnamestring
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
idstring (uuid)مسیرالزامیqstringکوئریpart of a repository name
پاسخ
200object
repositoriesobject[]idstringnamestringdefault_branchstringprivatebooleanprojectsobject[]kindstringnamestring
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
بدنهٔ درخواستapplication/json
namestringالزامیkindstringone of
app,functionconnectionstringالزامیrepostringالزامیthe repository's id from the repositories list
production_branchstringpreviewsboolean
پاسخ
201objectCreated
projectobjectkindstringnamestring
repoobjectconnectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
buildstring | nullcommitstring | null
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
پاسخ
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
بدنهٔ درخواستapplication/json
connectionstringالزامیrepostringالزامیproduction_branchstringpreviewsboolean
پاسخ
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
پاسخ
200object
unlinkedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
بدنهٔ درخواستapplication/json
branchstringdefault: the production branch
پاسخ
201objectCreated
buildstringbranchstringcommitstringproductionboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
پاسخ
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
نمونه
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.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
بدنهٔ درخواستapplication/json
connectionstringالزامیrepostringالزامیproduction_branchstringpreviewsboolean
پاسخ
200object
connectionstringproviderstringhoststringrepostringrepo_idstringproduction_branchstringpreviewsbooleancreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
پاسخ
200object
unlinkedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | not_found, not_linked |
| 500 | internal: an unexpected failure |
نمونه
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#
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
namestringمسیرالزامیthe function's or app's name
pattern
^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$· up to 63 characters
بدنهٔ درخواستapplication/json
branchstringdefault: the production branch
پاسخ
201objectCreated
buildstringbranchstringcommitstringproductionboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 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 |
نمونه
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).
- دسترسی
- بدون اعتبارنامه
پارامترها
X-Hub-Signature-256stringheaderالزامیsha256=<hex>
X-GitHub-Eventstringheaderالزامیthe event type
بدنهٔ درخواستapplication/json
object
پاسخ
202objectAccepted
okbooleanresultstring
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
نمونه
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).
- دسترسی
- بدون اعتبارنامه
پارامترها
linkstring (uuid)مسیرالزامیX-Gitlab-Tokenstringheaderالزامیthe project's hook secret
X-Gitlab-EventstringheaderالزامیPush Hook or Merge Request Hook
بدنهٔ درخواستapplication/json
object
پاسخ
202objectAccepted
okbooleanresultstring
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 500 | internal: an unexpected failure |
نمونه
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).
- دسترسی
- بدون اعتبارنامه
پاسخ
302Redirect to the dashboard
خطاها
| وضعیت | توضیح |
|---|---|
| 500 | internal: an unexpected failure |
نمونه
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).
- دسترسی
- بدون اعتبارنامه
پاسخ
302Redirect to the dashboard
خطاها
| وضعیت | توضیح |
|---|---|
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/repos/callback/gitlab"