Skip to main content
POST
/
org
/
{org}
/
repos
Create a repository in an organization
curl --request POST \
  --url https://gogs.example.com/api/v1/org/{org}/repos \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "private": false,
  "auto_init": false,
  "gitignores": "<string>",
  "license": "<string>",
  "readme": "Default"
}
'
{
  "id": 123,
  "owner": {
    "id": 123,
    "username": "<string>",
    "login": "<string>",
    "full_name": "<string>",
    "email": "[email protected]",
    "avatar_url": "<string>"
  },
  "name": "<string>",
  "full_name": "<string>",
  "description": "<string>",
  "private": true,
  "fork": true,
  "parent": "<unknown>",
  "empty": true,
  "mirror": true,
  "size": 123,
  "html_url": "<string>",
  "ssh_url": "<string>",
  "clone_url": "<string>",
  "website": "<string>",
  "stars_count": 123,
  "forks_count": 123,
  "watchers_count": 123,
  "open_issues_count": 123,
  "default_branch": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "permissions": {
    "admin": true,
    "push": true,
    "pull": true
  }
}

Authorizations

Authorization
string
header
required

Personal access token. Use format: token {YOUR_ACCESS_TOKEN}

Path Parameters

org
string
required

Organization name

Body

application/json
name
string
required
description
string
private
boolean
default:false
auto_init
boolean
default:false
gitignores
string
license
string
readme
string
default:Default

Response

Created

id
integer
owner
object
name
string
full_name
string
description
string
private
boolean
fork
boolean
parent
object

Present when fork is true

empty
boolean
mirror
boolean
size
integer
html_url
string
ssh_url
string
clone_url
string
website
string
stars_count
integer
forks_count
integer
watchers_count
integer
open_issues_count
integer
default_branch
string
created_at
string<date-time>
updated_at
string<date-time>
permissions
object