跳转到内容
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.

Create a team

POST
/orgs/{org}/teams
curl --request POST \
--url https://gitea.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.packages", "repo.code", "repo.issues", "repo.ext_issues", "repo.wiki", "repo.pulls", "repo.releases", "repo.projects", "repo.ext_wiki" ], "units_map": { "repo.actions": "read", "repo.code": "read", "repo.ext_issues": "none", "repo.ext_wiki": "none", "repo.issues": "write", "repo.packages": "read", "repo.projects": "none", "repo.pulls": "owner", "repo.releases": "none", "repo.wiki": "admin" }, "visibility": "public" }'
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

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

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

Team visibility within the organization. Defaults to “private”.

string
Allowed values: public limited private

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
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
Example
{
"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"
}

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