{% extends "docs/base.html" %} {% block docs_content %}
Create a team-owned or personal repository.
POST /api/v1/teams/{team_slug}/repos
POST /api/v1/users/{username}/repos
JSON body:
name (required)description (optional, defaults to empty string)about (optional, defaults to empty string)slug (required)visibility (required): public or privatedefault_branch (required)public_repo_pull_policy (optional, default any): any, team, or owner. team is only valid for public team repos. Private repos ignore this policy.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"
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"
}
403 Forbidden when caller lacks owner scope access.404 Not Found when owner user/team does not exist.409 Conflict for duplicate slug in owner scope or an invalid public_repo_pull_policy for the owner type.Common auth errors are documented on the API overview page.