Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of the next version, still under development. See the latest release.

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

PATCH
/repos/{owner}/{repo}
curl --request PATCH \
--url https://gitea.com/api/v1/repos/example/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "allow_fast_forward_only_merge": true, "allow_manual_merge": true, "allow_merge_commits": true, "allow_merge_update": true, "allow_rebase": true, "allow_rebase_explicit": true, "allow_rebase_update": true, "allow_squash_merge": true, "archived": true, "autodetect_manual_merge": true, "default_allow_maintainer_edit": true, "default_branch": "example", "default_delete_branch_after_merge": true, "default_merge_style": "example", "default_update_style": "example", "description": "example", "enable_prune": true, "external_tracker": { "external_tracker_format": "example", "external_tracker_regexp_pattern": "example", "external_tracker_style": "example", "external_tracker_url": "https://example.com" }, "external_wiki": { "external_wiki_url": "https://example.com" }, "has_actions": true, "has_code": true, "has_issues": true, "has_packages": true, "has_projects": true, "has_pull_requests": true, "has_releases": true, "has_wiki": true, "ignore_whitespace_conflicts": true, "internal_tracker": { "allow_only_contributors_to_track_time": true, "enable_issue_dependencies": true, "enable_time_tracker": true }, "mirror_interval": "example", "mirror_password": "example", "mirror_token": "example", "mirror_username": "example", "name": "example", "private": true, "projects_mode": "example", "template": true, "website": "example" }'
owner
required
string

Owner of the repo to edit

repo
required
string

Name of the repo to edit

Properties of a repo that you can edit

Media typeapplication/json

EditRepoOption options when editing a repository’s properties

object
allow_fast_forward_only_merge

Either true to allow fast-forward-only merging pull requests, or false to prevent fast-forward-only merging.

boolean
allow_manual_merge

Either true to allow mark pr as merged manually, or false to prevent it.

boolean
allow_merge_commits

Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits.

boolean
allow_merge_update

Either true to allow updating pull request branch by merge, or false to prevent it.

boolean
allow_rebase

Either true to allow rebase-merging pull requests, or false to prevent rebase-merging.

boolean
allow_rebase_explicit

Either true to allow rebase with explicit merge commits (–no-ff), or false to prevent rebase with explicit merge commits.

boolean
allow_rebase_update

Either true to allow updating pull request branch by rebase, or false to prevent it.

boolean
allow_squash_merge

Either true to allow squash-merging pull requests, or false to prevent squash-merging.

boolean
archived

Set to true to archive this repository.

boolean
autodetect_manual_merge

Either true to enable AutodetectManualMerge, or false to prevent it. Note: In some special cases, misjudgments can occur.

boolean
default_allow_maintainer_edit

Set to true to allow edits from maintainers by default

boolean
default_branch

Sets the default branch for this repository.

string
default_delete_branch_after_merge

Set to true to delete pr branch after merge by default

boolean
default_merge_style

Set to a merge style to be used by this repository: “merge”, “rebase”, “rebase-merge”, “squash”, or “fast-forward-only”.

string
default_update_style

Set to an update style to be used by this repository: “merge” or “rebase”.

string
description

A short description of the repository.

string
enable_prune

Enable prune - remove obsolete remote-tracking references when mirroring

boolean
external_tracker

ExternalTracker represents settings for external tracker

object
external_tracker_format

External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.

string
external_tracker_regexp_pattern

External Issue Tracker issue regular expression

string
external_tracker_style

External Issue Tracker Number Format, either numeric, alphanumeric, or regexp

string
external_tracker_url

URL of external issue tracker.

string format: uri
external_wiki

ExternalWiki represents setting for external wiki

object
external_wiki_url

URL of external wiki.

string format: uri
has_actions

Either true to enable actions unit, or false to disable them.

boolean
has_code

Either true to enable code for this repository or false to disable it.

boolean
has_issues

Either true to enable issues for this repository or false to disable them.

boolean
has_packages

Either true to enable packages unit, or false to disable them.

boolean
has_projects

Either true to enable project unit, or false to disable them.

boolean
has_pull_requests

Either true to allow pull requests, or false to prevent pull request.

boolean
has_releases

Either true to enable releases unit, or false to disable them.

boolean
has_wiki

Either true to enable the wiki for this repository or false to disable it.

boolean
ignore_whitespace_conflicts

Either true to ignore whitespace for conflicts, or false to not ignore whitespace.

boolean
internal_tracker

InternalTracker represents settings for internal tracker

object
allow_only_contributors_to_track_time

Let only contributors track time (Built-in issue tracker)

boolean
enable_issue_dependencies

Enable dependencies for issues and pull requests (Built-in issue tracker)

boolean
enable_time_tracker

Enable time tracking (Built-in issue tracker)

boolean
mirror_interval

Set to a string like 8h30m0s to set the mirror interval time

string
mirror_password

Authentication password for the remote repository (mirrors)

string
mirror_token

Authentication token for the remote repository (mirrors)

string
mirror_username

Authentication username for the remote repository (mirrors)

string
name

Name of the repository

string
unique items
private

Either true to make the repository private or false to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private.

boolean
projects_mode

repo to only allow repo-level projects, owner to only allow owner projects, all to allow both.

string
template

Either true to make this repository a template or false to make it a normal repository

boolean
website

A URL with more information about the repository.

string
Examplegenerated
{
"allow_fast_forward_only_merge": true,
"allow_manual_merge": true,
"allow_merge_commits": true,
"allow_merge_update": true,
"allow_rebase": true,
"allow_rebase_explicit": true,
"allow_rebase_update": true,
"allow_squash_merge": true,
"archived": true,
"autodetect_manual_merge": true,
"default_allow_maintainer_edit": true,
"default_branch": "example",
"default_delete_branch_after_merge": true,
"default_merge_style": "example",
"default_update_style": "example",
"description": "example",
"enable_prune": true,
"external_tracker": {
"external_tracker_format": "example",
"external_tracker_regexp_pattern": "example",
"external_tracker_style": "example",
"external_tracker_url": "https://example.com"
},
"external_wiki": {
"external_wiki_url": "https://example.com"
},
"has_actions": true,
"has_code": true,
"has_issues": true,
"has_packages": true,
"has_projects": true,
"has_pull_requests": true,
"has_releases": true,
"has_wiki": true,
"ignore_whitespace_conflicts": true,
"internal_tracker": {
"allow_only_contributors_to_track_time": true,
"enable_issue_dependencies": true,
"enable_time_tracker": true
},
"mirror_interval": "example",
"mirror_password": "example",
"mirror_token": "example",
"mirror_username": "example",
"name": "example",
"private": true,
"projects_mode": "example",
"template": true,
"website": "example"
}

Repository

Media typeapplication/json

Repository represents a repository

object
allow_fast_forward_only_merge
boolean
allow_manual_merge
boolean
allow_merge_commits
boolean
allow_merge_update
boolean
allow_rebase
boolean
allow_rebase_explicit
boolean
allow_rebase_update
boolean
allow_squash_merge
boolean
archived
boolean
archived_at
string format: date-time
autodetect_manual_merge
boolean
avatar_url
string format: uri
branch_count
integer format: int64
clone_url
string format: uri
created_at
string format: date-time
default_allow_maintainer_edit
boolean
default_branch
string
default_delete_branch_after_merge
boolean
default_merge_style
string
default_target_branch
string
default_update_style
string
description
string
empty
boolean
external_tracker

ExternalTracker represents settings for external tracker

object
external_tracker_format

External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.

string
external_tracker_regexp_pattern

External Issue Tracker issue regular expression

string
external_tracker_style

External Issue Tracker Number Format, either numeric, alphanumeric, or regexp

string
external_tracker_url

URL of external issue tracker.

string format: uri
external_wiki

ExternalWiki represents setting for external wiki

object
external_wiki_url

URL of external wiki.

string format: uri
fork
boolean
forks_count
integer format: int64
full_name
string
has_actions
boolean
has_code
boolean
has_issues
boolean
has_packages
boolean
has_projects
boolean
has_pull_requests
boolean
has_releases
boolean
has_wiki
boolean
html_url
string format: uri
id
integer format: int64
ignore_whitespace_conflicts
boolean
internal
boolean
internal_tracker

InternalTracker represents settings for internal tracker

object
allow_only_contributors_to_track_time

Let only contributors track time (Built-in issue tracker)

boolean
enable_issue_dependencies

Enable dependencies for issues and pull requests (Built-in issue tracker)

boolean
enable_time_tracker

Enable time tracking (Built-in issue tracker)

boolean
language
string
languages_url
string format: uri
licenses
Array<string>
link
string
mirror
boolean
mirror_interval
string
mirror_last_sync_at
string format: date-time
mirror_updated
string format: date-time
name
string
object_format_name

ObjectFormatName of the underlying git repository

string
Allowed values: sha1 sha256
open_issues_count
integer format: int64
open_pr_counter
integer format: int64
original_url
string format: uri
owner

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string format: uri
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string format: uri
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

Login of the user, same as username

string
login_name

Identifier of the user, provided by the external authenticator (if configured)

string
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
Allowed values: public limited private
website

The user’s website

string
parent
object recursive
permissions

Permission represents a set of permissions

object
admin
boolean
pull
boolean
push
boolean
private
boolean
projects_mode
string
release_counter
integer format: int64
repo_transfer

RepoTransfer represents a pending repo transfer

object
doer

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string format: uri
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string format: uri
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

Login of the user, same as username

string
login_name

Identifier of the user, provided by the external authenticator (if configured)

string
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
Allowed values: public limited private
website

The user’s website

string
recipient

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string format: uri
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string format: uri
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

Login of the user, same as username

string
login_name

Identifier of the user, provided by the external authenticator (if configured)

string
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
Allowed values: public limited private
website

The user’s website

string
teams
Array<object>

Team represents a team in an organization

object
can_create_org_repo

Whether the team can create repositories in the organization

boolean
description

The description of the team

string
id

The unique identifier of the team

integer format: int64
includes_all_repositories

Whether the team has access to all repositories in the organization

boolean
name

The name of the team

string
organization

Organization represents an organization

object
avatar_url

The URL of the organization’s avatar

string format: uri
description

The description of the organization

string
email

The email address of the organization

string
full_name

The full display name of the organization

string
id

The unique identifier of the organization

integer format: int64
location

The location of the organization

string
name

The name of the organization

string
repo_admin_change_team_access

Whether repository administrators can change team access

boolean
username

Username of the organization deprecated

string
visibility

The visibility level of the organization (public, limited, private)

string
Allowed values: public limited private
website

The website URL of the organization

string
permission
string
Allowed values: none read write admin owner
units

Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.

Array<string>
units_map
object
key
additional properties
string
visibility

Team visibility within the organization. “private” teams are only listable by members and org owners; “limited” teams are listable by any organization member; “public” teams are listable by any signed-in user.

string
Allowed values: public limited private
size
integer format: int64
ssh_url
string format: uri
stars_count
integer format: int64
template
boolean
topics
Array<string>
updated_at
string format: date-time
url
string format: uri
watchers_count
integer format: int64
website
string
Example
{
"object_format_name": "sha1",
"owner": {
"visibility": "public"
},
"repo_transfer": {
"doer": {
"visibility": "public"
},
"recipient": {
"visibility": "public"
},
"teams": [
{
"organization": {
"visibility": "public"
},
"permission": "none",
"units": [
"repo.code",
"repo.issues",
"repo.ext_issues",
"repo.wiki",
"repo.pulls",
"repo.releases",
"repo.projects",
"repo.ext_wiki"
],
"units_map": {
"repo.code": "read",
"repo.ext_issues": "none",
"repo.ext_wiki": "none",
"repo.issues": "write",
"repo.projects": "none",
"repo.pulls": "owner",
"repo.releases": "none",
"repo.wiki": "admin"
},
"visibility": "public"
}
]
}
}

APIForbiddenError is a forbidden error response

message
string
url
string

APINotFound is a not found empty response

APIValidationError is error format response related to input validation

message
string
url
string