Create a team
const url = 'https://gitea.com/api/v1/orgs/example/teams';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of the organization
Request Body
Section titled “Request Body”CreateTeamOption options for creating a team
object
Whether the team can create repositories in the organization
The description of the team
Whether the team has access to all repositories in the organization
Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
Example
[ "repo.actions", "repo.packages", "repo.code", "repo.issues", "repo.ext_issues", "repo.wiki", "repo.pulls", "repo.releases", "repo.projects", "repo.ext_wiki"]object
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"}Team visibility within the organization. Defaults to “private”.
Responses
Section titled “Responses”Team
Team represents a team in an organization
object
Whether the team can create repositories in the organization
The description of the team
The unique identifier of the team
Whether the team has access to all repositories in the organization
The name of the team
Organization represents an organization
object
The URL of the organization’s avatar
The description of the organization
The email address of the organization
The full display name of the organization
The unique identifier of the organization
The location of the organization
The name of the organization
Whether repository administrators can change team access
Username of the organization deprecated
The visibility level of the organization (public, limited, private)
The website URL of the organization
Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
object
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.
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
APIValidationError is error format response related to input validation