Forks a granted repository.
Forks a granted repository. GitHub's fork is ASYNCHRONOUS: it answers 202 with the target repo and populates it in the background, and it answers the same…
POST /v1/integrations/github/fork
| Address | https://api.hanzo.ai/v1/integrations/github/fork |
| Method | POST |
| Operation | post_integrations_github_fork |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Forks a granted repository.
GitHub's fork is ASYNCHRONOUS: it answers 202 with the target repo and populates it in the background, and it answers the same 202 when the fork already exists. So this reports what GitHub said rather than waiting — a call that blocked until the clone finished would time out on a large repository and tell the caller nothing it does not already know.
Request
2 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
org | body | string | — | Org is the GitHub account to fork INTO; empty forks to the installation's own account, which is the common case. |
repo | body | string | — | Repo is a repository the org's installation was GRANTED, by name. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | githubForkOut | ok |
200 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
clone_url | body | string | — | CloneURL is the fork's https git remote. |
default_branch | body | string | — | DefaultBranch is the branch the fork checks out, inherited from upstream. |
existing | body | boolean | — | Existing reports that the fork was already there. |
full_name | body | string | — | FullName is the fork's "owner/repo". |
html_url | body | string | — | HTMLURL is the fork's page on github.com. |
Failure carries the platform error shape — see Errors.
Examples
hanzo integrations github forkimport { Configuration, IntegrationsApi } from 'hanzoai';
const api = new IntegrationsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postIntegrationsGithubFork({ org: "<org>", repo: "<repo>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IntegrationsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IntegrationsApi(client).post_integrations_github_fork(org="<org>", repo="<repo>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.IntegrationsAPI.PostIntegrationsGithubFork(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, integrations_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = integrations_api::post_integrations_github_fork(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IntegrationsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new IntegrationsApi(client).postIntegrationsGithubFork();curl -X POST https://api.hanzo.ai/v1/integrations/github/fork \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"org": "<org>",
"repo": "<repo>"
}'The door reaches integrations through the integrations tool, which names its 45 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_connectors"
}
}
}'How is this guide?