{
"consumes": [
"application/json",
"text/plain"
],
"produces": [
"text/html"
"schemes": [
"http",
"https"
"swagger": "2.0",
"info": {
"description": "This provide API interface to communicate with this Gitea instance.",
"title": "Gitea API.",
"termsOfService": "there are no TOS at this moment, use at your own risk we take no responsibility",
"license": {
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
},
"version": "1.1.1"
"basePath": "/api/v1",
"paths": {
"/admin/users": {
"post": {
"application/json"
"tags": [
"admin"
"operationId": "adminCreateUser",
"parameters": [
"x-go-name": "SourceID",
"name": "source_id",
"in": "body",
"schema": {
"type": "integer",
"format": "int64"
}
"x-go-name": "LoginName",
"name": "login_name",
"type": "string"
"x-go-name": "Username",
"name": "username",
"x-go-name": "FullName",
"name": "full_name",
"x-go-name": "Email",
"name": "email",
"x-go-name": "Password",
"name": "password",
"x-go-name": "SendNotify",
"name": "send_notify",
"type": "boolean"
"responses": {
"201": {
"$ref": "#/responses/User"
"403": {
"$ref": "#/responses/forbidden"
"422": {
"$ref": "#/responses/validationError"
"500": {
"$ref": "#/responses/error"
"/admin/users/{username}": {
"delete": {
"operationId": "adminDeleteUser",
"204": {
"$ref": "#/responses/empty"
"patch": {
"operationId": "adminEditUser",
"x-go-name": "Website",
"name": "website",
"x-go-name": "Location",
"name": "location",
"x-go-name": "Active",
"name": "active",
"x-go-name": "Admin",
"name": "admin",
"x-go-name": "AllowGitHook",
"name": "allow_git_hook",
"x-go-name": "AllowImportLocal",
"name": "allow_import_local",
"x-go-name": "MaxRepoCreation",
"name": "max_repo_creation",
"200": {
"/admin/users/{username}/keys": {
"operationId": "adminCreatePublicKey",
"uniqueItems": true,
"x-go-name": "Title",
"description": "Title of the key to add",
"name": "title",
"required": true,
"x-go-name": "Key",
"description": "An armored SSH key to add",
"name": "key",
"$ref": "#/responses/PublicKey"
"/admin/users/{username}/orgs": {
"operationId": "adminCreateOrg",
"x-go-name": "UserName",
"x-go-name": "Description",
"name": "description",
"$ref": "#/responses/Organization"
"/admin/users/{username}/repos": {
"operationId": "adminCreateRepo",
"x-go-name": "Name",
"description": "Name of the repository to create",
"name": "name",
"description": "Description of the repository to create",
"x-go-name": "Private",
"description": "Is the repository to create private ?",
"name": "private",
"x-go-name": "AutoInit",
"description": "Init the repository to create ?",
"name": "auto_init",
"x-go-name": "Gitignores",
"description": "Gitignores to use",
"name": "gitignores",
"x-go-name": "License",
"description": "License to use",
"name": "license",
"x-go-name": "Readme",
"description": "Readme of the repository to create",
"name": "readme",
"$ref": "#/responses/Repository"
"/markdown": {
"miscellaneous"
"operationId": "renderMarkdown",
"description": "Text markdown to render",
"name": "Text",
"description": "Mode to render",
"name": "Mode",
"description": "Context to render",
"name": "Context",
"description": "Is it a wiki page ?",
"name": "Wiki",
"$ref": "#/responses/MarkdownRender"
"/markdown/raw": {
"operationId": "renderMarkdownRaw",
"/org/{org}/repos": {
"organization"
"operationId": "createOrgRepo",
"/orgs/{orgname}/hooks": {
"get": {
"operationId": "orgListHooks",
"$ref": "#/responses/HookList"
"/orgs/{orgname}/hooks/": {
"operationId": "orgCreateHook",
"x-go-name": "Type",
"name": "type",
"x-go-name": "Config",
"name": "config",
"type": "object",
"additionalProperties": {
"x-go-name": "Events",
"name": "events",
"type": "array",
"items": {
"$ref": "#/responses/Hook"
"/orgs/{orgname}/hooks/{id}": {
"operationId": "orgGetHook",
"404": {
"$ref": "#/responses/notFound"
"operationId": "orgDeleteHook",
"operationId": "orgEditHook",
"/orgs/{orgname}/members": {
"operationId": "orgListMembers",
"$ref": "#/responses/UserList"
"/orgs/{orgname}/members/{username}": {
"operationId": "orgIsMember",
"302": {
"$ref": "#/responses/redirect"
"operationId": "orgDeleteMember",
"/orgs/{orgname}/public_members": {
"operationId": "orgListPublicMembers",
"/orgs/{orgname}/public_members/{username}": {
"operationId": "orgIsPublicMember",
"put": {
"operationId": "orgPublicizeMember",
"operationId": "orgConcealMember",
"/orgs/{orgname}/repos": {
"operationId": "orgListRepos",
"$ref": "#/responses/RepositoryList"
"/repos/migrate": {
"repository"
"operationId": "repoMigrate",
"x-go-name": "CloneAddr",
"name": "clone_addr",
"x-go-name": "AuthUsername",
"name": "auth_username",
"x-go-name": "AuthPassword",
"name": "auth_password",
"x-go-name": "UID",
"name": "uid",
"x-go-name": "RepoName",
"name": "repo_name",
"x-go-name": "Mirror",
"name": "mirror",
"/repos/search": {
"operationId": "repoSearch",
"type": "string",
"x-go-name": "Keyword",
"description": "Keyword to search",
"name": "q",
"in": "query"
"format": "int64",
"x-go-name": "OwnerID",
"description": "Owner in we search search",
"x-go-name": "PageSize",
"description": "Limit of result\n\nmaximum: setting.ExplorePagingNum",
"name": "limit",
"$ref": "#/responses/SearchResults"
"$ref": "#/responses/SearchError"
"/repos/{owner}/{repo}/forks": {
"operationId": "listForks",
"operationId": "createFork",
"x-go-name": "Organization",
"name": "organization",
"202": {
"/repos/{username}/{reponame}": {
"operationId": "repoGet",
"operationId": "repoDelete",
"/repos/{username}/{reponame}/hooks": {
"operationId": "repoListHooks",
"operationId": "repoCreateHook",
"/repos/{username}/{reponame}/hooks/{id}": {
"operationId": "repoDeleteHook",
"operationId": "repoEditHook",
"/repos/{username}/{reponame}/mirror-sync": {
"operationId": "repoMirrorSync",
"/repos/{username}/{reponame}/subscription": {
"operationId": "userCurrentCheckSubscription",
"$ref": "#/responses/WatchInfo"
"operationId": "userCurrentPutSubscription",
"operationId": "userCurrentDeleteSubscription",
"/repositories/{id}": {
"operationId": "repoGetByID",
"/user": {
"user"
"operationId": "userGetCurrent",
"/user/followers": {
"operationId": "userCurrentListFollowers",
"/user/following": {
"operationId": "userCurrentListFollowing",
"/user/following/{username}": {
"operationId": "userCurrentCheckFollowing",
"operationId": "userCurrentPutFollow",
"operationId": "userCurrentDeleteFollow",
"/user/gpg_keys": {
"operationId": "userCurrentListGPGKeys",
"$ref": "#/responses/GPGKeyList"
"operationId": "userCurrentPostGPGKey",
"x-go-name": "ArmoredKey",
"description": "An armored GPG key to add",
"name": "armored_public_key",
"$ref": "#/responses/GPGKey"
"/user/gpg_keys/{id}": {
"operationId": "userCurrentGetGPGKey",
"operationId": "userCurrentDeleteGPGKey",
"/user/keys": {
"operationId": "userCurrentListKeys",
"$ref": "#/responses/PublicKeyList"
"operationId": "userCurrentPostKey",
"/user/keys/{id}": {
"operationId": "userCurrentGetKey",
"operationId": "userCurrentDeleteKey",
"/user/repos": {
"operationId": "userCurrentListRepos",
"repository",
"operationId": "createCurrentUserRepo",
"/user/starred": {
"operationId": "userCurrentListStarred",
"/user/starred/{username}/{reponame}": {
"operationId": "userCurrentCheckStarring",
"operationId": "userCurrentPutStar",
"operationId": "userCurrentDeleteStar",
"/user/subscriptions": {
"operationId": "userCurrentListSubscriptions",
"/users/:username/followers": {
"operationId": "userListFollowers",
"/users/search": {
"operationId": "userSearch",
"/users/{username}": {
"operationId": "userGet",
"/users/{username}/following": {
"operationId": "userListFollowing",
"/users/{username}/following/:target": {
"operationId": "userCheckFollowing",
"/users/{username}/gpg_keys": {
"operationId": "userListGPGKeys",
"/users/{username}/keys": {
"operationId": "userListKeys",
"/users/{username}/repos": {
"operationId": "userListRepos",
"/users/{username}/starred": {
"operationId": "userListStarred",
"/users/{username}/subscriptions": {
"operationId": "userListSubscriptions",
"/users/{username}/tokens": {
"operationId": "userGetTokens",
"$ref": "#/responses/AccessTokenList"
"/version": {
"description": "This show current running Gitea application version.",
"summary": "Return Gitea running version.",
"operationId": "getVersion",
"$ref": "#/responses/ServerVersion"
"definitions": {
"GPGKey": {
"description": "GPGKey a user GPG key to sign commit and tag in repository",
"properties": {
"can_certify": {
"type": "boolean",
"x-go-name": "CanCertify"
"can_encrypt_comms": {
"x-go-name": "CanEncryptComms"
"can_encrypt_storage": {
"x-go-name": "CanEncryptStorage"
"can_sign": {
"x-go-name": "CanSign"
"created_at": {
"x-go-name": "Created"
"emails": {
"$ref": "#/definitions/GPGKeyEmail"
"x-go-name": "Emails"
"expires_at": {
"x-go-name": "Expires"
"id": {
"x-go-name": "ID"
"key_id": {
"x-go-name": "KeyID"
"primary_key_id": {
"x-go-name": "PrimaryKeyID"
"public_key": {
"x-go-name": "PublicKey"
"subkeys": {
"type": "object"
"x-go-name": "SubsKey"
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
"GPGKeyEmail": {
"description": "GPGKeyEmail an email attached to a GPGKey",
"email": {
"x-go-name": "Email"
"verified": {
"x-go-name": "Verified"
"Permission": {
"title": "Permission represents a API permission.",
"admin": {
"x-go-name": "Admin"
"pull": {
"x-go-name": "Pull"
"push": {
"x-go-name": "Push"
"Repository": {
"title": "Repository represents a API repository.",
"clone_url": {
"x-go-name": "CloneURL"
"default_branch": {
"x-go-name": "DefaultBranch"
"description": {
"x-go-name": "Description"
"empty": {
"x-go-name": "Empty"
"fork": {
"x-go-name": "Fork"
"forks_count": {
"x-go-name": "Forks"
"full_name": {
"x-go-name": "FullName"
"html_url": {
"x-go-name": "HTMLURL"
"mirror": {
"x-go-name": "Mirror"
"name": {
"x-go-name": "Name"
"open_issues_count": {
"x-go-name": "OpenIssues"
"owner": {
"$ref": "#/definitions/User"
"parent": {
"permissions": {
"$ref": "#/definitions/Permission"
"private": {
"x-go-name": "Private"
"size": {
"x-go-name": "Size"
"ssh_url": {
"x-go-name": "SSHURL"
"stars_count": {
"x-go-name": "Stars"
"updated_at": {
"x-go-name": "Updated"
"watchers_count": {
"x-go-name": "Watchers"
"website": {
"x-go-name": "Website"
"User": {
"title": "User represents a API user.",
"avatar_url": {
"x-go-name": "AvatarURL"
"login": {
"x-go-name": "UserName"
"AccessToken": {
"description": "AccessToken represents a API access token.",
"headers": {
"sha1": {
"AccessTokenList": {
"description": "AccessTokenList represents a list of API access token."
"created_at": {},
"expires_at": {},
"GPGKeyList": {
"description": "GPGKeyList represents a list of GPGKey"
"Hook": {
"description": "Hook a hook is a web hook when one repository changed",
"active": {
"config": {},
"events": {
"type": {
"updated_at": {}
"HookList": {
"description": "HookList represents a list of API hook."
"MarkdownRender": {
"description": "MarkdownRender is a rendered markdown document"
"Organization": {
"description": "Organization a group of some repositories, users and teams",
"location": {
"username": {
"PublicKey": {
"description": "PublicKey publickey is a user key to push code to repository",
"key": {
"title": {
"url": {
"PublicKeyList": {
"description": "PublicKeyList represents a list of PublicKey"
"description": "Repository represents a API repository.",
"owner": {},
"parent": {},
"permissions": {},
"updated_at": {},
"RepositoryList": {
"description": "RepositoryList represents a list of API repository."
"SearchError": {
"description": "SearchError error of failing search",
"error": {
"ok": {
"SearchResults": {
"description": "SearchResults results of search",
"data": {
"$ref": "#/definitions/Repository"
"ServerVersion": {
"description": "ServerVersion wraps the version of the server",
"Version": {
"TrackedTime": {
"description": "TrackedTime worked time for an issue / pr",
"created": {},
"issue_id": {
"time": {
"description": "Time in seconds"
"user_id": {
"TrackedTimes": {
"description": "TrackedTimes represent a list of tracked times"
"description": "User represents a API user.",
"UserList": {
"description": "UserList represents a list of API user."
"WatchInfo": {
"description": "WatchInfo represents a API watch status of one repository",
"ignored": {
"reason": {},
"repository_url": {
"subscribed": {
"description": "APIEmpty is an empty response"
"description": "APIError is error format response",
"message": {
"forbidden": {
"description": "APIForbiddenError is a forbidden error response",
"notFound": {
"description": "APINotFound is a not found empty response"
"redirect": {
"description": "APIRedirect is a redirect response"
"validationError": {
"description": "APIValidationError is error format response related to input validation",
"securityDefinitions": {
"type": "apiKey",
"name": "access_token",
"AuthorizationHeaderToken": {
"name": "Authorization",
"in": "header"
"BasicAuth": {
"type": "basic"
"Token": {
"name": "token",
"security": [
"BasicAuth": [
"[]"
]
"Token": [
"AccessToken": [
"AuthorizationHeaderToken": [