跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 25.6.2, which is no longer the latest release. See the latest release.

Create a team

POST
/orgs/{org}/teams
curl --request POST \
--url https://gitea.example.com/api/v1/orgs/example/teams \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "can_create_org_repo": true, "description": "example", "includes_all_repositories": true, "name": "example", "permission": "read", "units": [ "repo.actions", "repo.code", "repo.issues", "repo.ext_issues", "repo.wiki", "repo.ext_wiki", "repo.pulls", "repo.releases", "repo.projects", "repo.ext_wiki" ], "units_map": "{\"repo.actions\",\"repo.packages\",\"repo.code\":\"read\",\"repo.issues\":\"write\",\"repo.ext_issues\":\"none\",\"repo.wiki\":\"admin\",\"repo.pulls\":\"owner\",\"repo.releases\":\"none\",\"repo.projects\":\"none\",\"repo.ext_wiki\":\"none\"}" }'
org
required
string

Name of the organization

Media typeapplication/json

CreateTeamOption options for creating a team

object
can_create_org_repo

Whether the team can create repositories in the organization

boolean
description

The description of the team

string
includes_all_repositories

Whether the team has access to all repositories in the organization

boolean
name
required
string
permission
string
Allowed values: read write admin
units
Array<string>
Example
[
"repo.actions",
"repo.code",
"repo.issues",
"repo.ext_issues",
"repo.wiki",
"repo.ext_wiki",
"repo.pulls",
"repo.releases",
"repo.projects",
"repo.ext_wiki"
]
units_map
object
key
additional properties
string
Example
{"repo.actions","repo.packages","repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}

Team

Media typeapplication/json

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
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
website

The website URL of the organization

string
permission
string
Allowed values: none read write admin owner
units
Array<string>
units_map
object
key
additional properties
string
Example
{
"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"
}
}

APINotFound is a not found empty response

Media typeapplication/json

APIValidationError is error format response related to input validation

Media typeapplication/json
message
string
url
string