Create repo
Create a team-owned or personal repository.
Endpoints
POST /api/v1/teams/{team_slug}/repos
POST /api/v1/users/{username}/repos
Authenticated
Request
JSON body:
name(required)description(optional, defaults to empty string)about(optional, defaults to empty string)slug(required)visibility(required):publicorprivatedefault_branch(required)public_repo_pull_policy(optional, defaultany):any,team, orowner.teamis only valid for public team repos. Private repos ignore this policy.
Usage
curl --request POST \
--header "Authorization: Bearer $PEARING_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{"name": "Website", "description": "Customer-facing marketing site", "about": "# Website\n\nCustomer-facing marketing site.", "slug": "website", "visibility": "private", "default_branch": "main"}' \
"$PEARING_API_URL/v1/teams/platform/repos"
Success
201 Created with the created repo record, including created_by_uuid and created_by_username.
{
"uuid": "...",
"name": "Website",
"description": "Customer-facing marketing site",
"about": "# Website\n\nCustomer-facing marketing site.",
"slug": "website",
"clone_url": "https://git.example.com/teams/platform/website.git",
"visibility": "private",
"default_branch": "main",
"public_repo_pull_policy": "any",
"max_disk_bytes": 1073741824,
"disk_bytes": 0,
"is_active": true,
"created_at": "2026-03-09T12:00:00Z"
}
Errors
403 Forbiddenwhen caller lacks owner scope access.404 Not Foundwhen owner user/team does not exist.409 Conflictfor duplicate slug in owner scope or an invalidpublic_repo_pull_policyfor the owner type.
Common auth errors are documented on the API overview page.