2022 TLDR;
Bitbucket cloud 2.0 API with minimal required fields (API Ref) as far as I can tell:
POST https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/forks
{
"is_private": true,
"scm": "git",
"name": {new_workspace},
"workspace":{
"slug":{new_reposlug}
}
}
For example, imagine you have repo foo
in workspace sandbox
. And you want to make a fork foo-fork
in the same workspace.
POST https://api.bitbucket.org/2.0/repositories/sandbox/foo/forks
{
"is_private": true,
"scm": "git",
"name": "foo-fork",
"workspace":{
"slug":"sandbox"
}
}
The response is quite large and will show al the other optional request fields