Organization Administration

April 14, 2020 ยท View on GitHub

Create a new organization

POST /admin/users/:username/orgs

Parameters

NameTypeDescription
usernamestringRequired Organization user name
full_namestringFull name of organization
descriptionstringDescription to the organization
websitestringOfficial website
locationstringOrganization location

Example

{
  "username": "gogs",
  "full_name": "Gogs",
  "description": "Gogs is a painless self-hosted Git Service.",
  "website": "https://gogs.io",
  "location": "USA"
}

Response

Status: 201 Created
{
  "id": 7,
  "username": "gogs",
  "full_name": "Gogs",
  "avatar_url": "/avatars/7",
  "description": "Gogs is a painless self-hosted Git Service.",
  "website": "https://gogs.io",
  "location": "USA"
}

Create team of an organization

POST /admin/orgs/:orgname/teams

Parameters

NameTypeDescription
namestringRequired Team name
descriptionstringDescription to the team
permissionstringTeam permission, can be read, write or admin, default is read

Example

{
  "name": "new-team",
  "description": "A new team created by API",
  "permission": "write"
}

Response

Status: 201 Created
{
  "id": 12,
  "name": "new-team",
  "description": "A new team created by API",
  "permission": "write"
}