Hanzo
OpenapiIntegrations

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

Addresshttps://api.hanzo.ai/v1/integrations/github/fork
MethodPOST
Operationpost_integrations_github_fork
AuthAuthorization: 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).

FieldInTypeRequiredDescription
orgbodystringOrg is the GitHub account to fork INTO; empty forks to the installation's own account, which is the common case.
repobodystringRepo is a repository the org's installation was GRANTED, by name.

Response

StatusBodyMeaning
200githubForkOutok

200 body — 5 fields.

FieldInTypeAlwaysDescription
clone_urlbodystringCloneURL is the fork's https git remote.
default_branchbodystringDefaultBranch is the branch the fork checks out, inherited from upstream.
existingbodybooleanExisting reports that the fork was already there.
full_namebodystringFullName is the fork's "owner/repo".
html_urlbodystringHTMLURL is the fork's page on github.com.

Failure carries the platform error shape — see Errors.

Examples

hanzo integrations github fork

Integrations API · All Hanzo APIs · Interactive reference

How is this guide?

On this page