Skip to main content
The Gitea API provides comprehensive endpoints for managing repositories, including creating, retrieving, updating, and deleting repositories.

Search Repositories

Search for repositories based on various criteria.

Query Parameters

q
string
Keyword to search for
topic
boolean
Limit search to repositories with keyword as topic
includeDesc
boolean
Include search of keyword within repository description
uid
integer
Search only for repos that the user with the given id owns or contributes to
private
boolean
default:"true"
Include private repositories this user has access to
archived
boolean
Show only archived, non-archived or all repositories
mode
string
Type of repository to search for. Supported values: fork, source, mirror, collaborative
sort
string
default:"alpha"
Sort repos by attribute. Supported values: alpha, created, updated, size, git_size, lfs_size, stars, forks, id
order
string
default:"asc"
Sort order: asc (ascending) or desc (descending)
page
integer
default:"1"
Page number of results to return (1-based)
limit
integer
Page size of results

Response

ok
boolean
Indicates if the search was successful
data
array
Array of repository objects matching the search criteria
id
integer
Repository ID
name
string
Repository name
full_name
string
Full repository name including owner
description
string
Repository description
private
boolean
Whether the repository is private
fork
boolean
Whether the repository is a fork
stars_count
integer
Number of stars
forks_count
integer
Number of forks

Create Repository

Create a new repository for the authenticated user.

Request Body

name
string
required
Name of the repository to create (unique)
description
string
Description of the repository
private
boolean
default:"false"
Whether the repository is private
auto_init
boolean
default:"false"
Whether the repository should be auto-initialized
gitignores
string
Gitignores to use
license
string
License to use
readme
string
default:"Default"
Readme template to use
default_branch
string
Default branch name (used when initializing)
trust_model
string
Trust model. Supported values: default, collaborator, committer, collaboratorcommitter

Create Organization Repository

Create a new repository in an organization.

Path Parameters

org
string
required
Name of the organization

Request Body

Same as Create Repository endpoint.

Get Repository

Get a repository by owner and repository name.

Path Parameters

owner
string
required
Owner of the repository
repo
string
required
Name of the repository

Response

id
integer
Repository ID
name
string
Repository name
full_name
string
Full repository name (owner/repo)
description
string
Repository description
private
boolean
Whether the repository is private
fork
boolean
Whether the repository is a fork
html_url
string
Web URL to view the repository
clone_url
string
HTTPS clone URL
ssh_url
string
SSH clone URL
default_branch
string
Default branch name
permissions
object
User permissions for this repository
admin
boolean
Whether the user is an administrator
push
boolean
Whether the user can push
pull
boolean
Whether the user can pull

Get Repository by ID

Get a repository by its ID.

Path Parameters

id
integer
required
ID of the repository

Update Repository

Edit a repository’s properties. Only fields that are set will be changed.

Path Parameters

owner
string
required
Owner of the repository
repo
string
required
Name of the repository

Request Body

name
string
New name for the repository
description
string
New description
website
string
Repository website URL
private
boolean
Make repository private or public
default_branch
string
Set default branch
archived
boolean
Archive or unarchive the repository
has_issues
boolean
Enable or disable issues
has_wiki
boolean
Enable or disable wiki
has_pull_requests
boolean
Enable or disable pull requests

Delete Repository

Delete a repository permanently.

Path Parameters

owner
string
required
Owner of the repository
repo
string
required
Name of the repository to delete
Deleting a repository is permanent and cannot be undone. All issues, pull requests, releases, and other data will be deleted.

Generate Repository from Template

Create a repository from a template repository.

Path Parameters

template_owner
string
required
Owner of the template repository
template_repo
string
required
Name of the template repository

Request Body

name
string
required
Name of the new repository
owner
string
Owner of the new repository (defaults to authenticated user)
description
string
Description of the new repository
private
boolean
Whether the new repository should be private
git_content
boolean
default:"true"
Include git content from template
topics
boolean
default:"true"
Include topics from template
git_hooks
boolean
default:"false"
Include git hooks from template
webhooks
boolean
default:"false"
Include webhooks from template
avatar
boolean
default:"false"
Include avatar from template
labels
boolean
default:"true"
Include labels from template

List Repository Activity Feeds

Get activity feeds for a repository.

Path Parameters

owner
string
required
Owner of the repository
repo
string
required
Name of the repository

Query Parameters

date
string
Date of activities to find (format: YYYY-MM-DD)
page
integer
default:"1"
Page number of results
limit
integer
Page size of results