docs: migrate to Mintlify (#8154)

This commit is contained in:
ᴊᴏᴇ ᴄʜᴇɴ
2026-02-07 17:32:52 -05:00
committed by GitHub
parent edc1478f6b
commit 9dd3e58f7b
142 changed files with 9544 additions and 82 deletions

View File

@@ -0,0 +1,4 @@
---
title: "Add or update team repository"
openapi: "PUT /admin/teams/{teamid}/repos/{reponame}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Add team membership"
openapi: "PUT /admin/teams/{teamid}/members/{username}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a new user"
openapi: "POST /admin/users"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a public key for a user"
openapi: "POST /admin/users/{username}/keys"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a repository for a user"
openapi: "POST /admin/users/{username}/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a team"
openapi: "POST /admin/orgs/{orgname}/teams"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create an organization"
openapi: "POST /admin/users/{username}/orgs"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a user"
openapi: "DELETE /admin/users/{username}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit an existing user"
openapi: "PATCH /admin/users/{username}"
---

View File

@@ -0,0 +1,4 @@
---
title: "List all members of a team"
openapi: "GET /admin/teams/{teamid}/members"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove team membership"
openapi: "DELETE /admin/teams/{teamid}/members/{username}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove team repository"
openapi: "DELETE /admin/teams/{teamid}/repos/{reponame}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Add a collaborator"
openapi: "PUT /repos/{owner}/{repo}/collaborators/{collaborator}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Add a deploy key"
openapi: "POST /repos/{owner}/{repo}/keys"
---

View File

@@ -0,0 +1,4 @@
---
title: "Check if a user is a collaborator"
openapi: "GET /repos/{owner}/{repo}/collaborators/{collaborator}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a deploy key"
openapi: "GET /repos/{owner}/{repo}/keys/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "List collaborators"
openapi: "GET /repos/{owner}/{repo}/collaborators"
---

View File

@@ -0,0 +1,4 @@
---
title: "List deploy keys"
openapi: "GET /repos/{owner}/{repo}/keys"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove a collaborator"
openapi: "DELETE /repos/{owner}/{repo}/collaborators/{collaborator}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove a deploy key"
openapi: "DELETE /repos/{owner}/{repo}/keys/{id}"
---

View File

@@ -0,0 +1,116 @@
---
title: "Introduction"
sidebarTitle: "Introduction"
description: "Overview of the Gogs API including authentication, pagination, and schema"
---
The Gogs API provides a RESTful interface for interacting with your Gogs instance programmatically. It aims to follow a format similar to the [GitHub REST API v3](https://developer.github.com/v3/).
<Info>
The API is bundled with every Gogs installation. No additional setup is required.
</Info>
<Warning>
The API is still in its early stages. Content and endpoints are subject to change.
</Warning>
## Current version
All Gogs APIs are under **v1** using the request path prefix `/api/v1`.
```
https://gogs.example.com/api/v1
```
## Schema
All data is sent and received as **JSON** unless specified otherwise.
```http
HTTP/2 200
Content-Type: application/json; charset=UTF-8
```
All timestamps are returned in **RFC 3339** format:
```
YYYY-MM-DDTHH:MM:SSZ
2006-01-02T15:04:05Z07:00
```
## Authentication
There are two ways to authenticate through the Gogs API. Requests that require authentication will return `404 Not Found` instead of `403 Forbidden` in some places. This is to prevent the accidental leakage of private resources to unauthorized users.
<Tabs>
<Tab title="Basic authentication">
Basic authentication is used to obtain access tokens. Supply your username (you will be prompted for your password):
```bash
curl -u "alice" https://gogs.example.com/api/v1/users/alice/tokens
```
<Warning>
Basic authentication should only be used to generate access tokens. Do not use it for regular API requests.
</Warning>
</Tab>
<Tab title="Access token">
Personal access tokens are the recommended way to authenticate. They can be sent via a request **header** or a **URL query parameter**.
**Using a header:**
```bash
curl -H "Authorization: token {YOUR_ACCESS_TOKEN}" https://gogs.example.com/api/v1/user/repos
```
**Using a query parameter:**
```bash
curl https://gogs.example.com/api/v1/user/repos?token={YOUR_ACCESS_TOKEN}
```
<Tip>
Using the `Authorization` header is preferred over the query parameter, as URLs may be logged by proxies and servers.
</Tip>
</Tab>
</Tabs>
## Pagination
API responses that return multiple items are paginated. You can specify further pages with the `?page` query parameter.
```bash
curl https://gogs.example.com/api/v1/repos/alice/hello/issues?page=1
```
Page numbering is **1-based**. Omitting the `?page` parameter returns the first page.
### Link header
Pagination info is included in the [Link header](http://tools.ietf.org/html/rfc5988) of each response. Use this to navigate between pages programmatically.
```http
Link: <https://gogs.example.com/api/v1/repos/alice/hello/issues?page=3>; rel="next",
<https://gogs.example.com/api/v1/repos/alice/hello/issues?page=50>; rel="last"
```
The possible `rel` values are:
| Name | Description |
|---|---|
| `next` | The link relation for the immediate next page of results. |
| `last` | The link relation for the last page of results. |
| `first` | The link relation for the first page of results. |
| `prev` | The link relation for the immediate previous page of results. |
<Tip>
Always use the Link header values to navigate between pages rather than constructing URLs manually.
</Tip>
## SDKs
The following best-effort-maintained SDKs are available:
| Language | Repository |
|---|---|
| Go | [gogs/go-gogs-client](https://github.com/gogs/go-gogs-client) |

View File

@@ -0,0 +1,4 @@
---
title: "Add labels to an issue"
openapi: "POST /repos/{owner}/{repo}/issues/{index}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a comment"
openapi: "POST /repos/{owner}/{repo}/issues/{index}/comments"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a label"
openapi: "POST /repos/{owner}/{repo}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a milestone"
openapi: "POST /repos/{owner}/{repo}/milestones"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create an issue"
openapi: "POST /repos/{owner}/{repo}/issues"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a comment"
openapi: "DELETE /repos/{owner}/{repo}/issues/{index}/comments/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a label"
openapi: "DELETE /repos/{owner}/{repo}/labels/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a milestone"
openapi: "DELETE /repos/{owner}/{repo}/milestones/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit a comment"
openapi: "PATCH /repos/{owner}/{repo}/issues/{index}/comments/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit a milestone"
openapi: "PATCH /repos/{owner}/{repo}/milestones/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit an issue"
openapi: "PATCH /repos/{owner}/{repo}/issues/{index}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single issue"
openapi: "GET /repos/{owner}/{repo}/issues/{index}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single label"
openapi: "GET /repos/{owner}/{repo}/labels/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single milestone"
openapi: "GET /repos/{owner}/{repo}/milestones/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "List all labels for a repository"
openapi: "GET /repos/{owner}/{repo}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "List comments in a repository"
openapi: "GET /repos/{owner}/{repo}/issues/comments"
---

View File

@@ -0,0 +1,4 @@
---
title: "List comments on an issue"
openapi: "GET /repos/{owner}/{repo}/issues/{index}/comments"
---

View File

@@ -0,0 +1,4 @@
---
title: "List issues for a repository"
openapi: "GET /repos/{owner}/{repo}/issues"
---

View File

@@ -0,0 +1,4 @@
---
title: "List labels on an issue"
openapi: "GET /repos/{owner}/{repo}/issues/{index}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "List milestones for a repository"
openapi: "GET /repos/{owner}/{repo}/milestones"
---

View File

@@ -0,0 +1,4 @@
---
title: "List user issues"
openapi: "GET /user/issues"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove a label from an issue"
openapi: "DELETE /repos/{owner}/{repo}/issues/{index}/labels/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Remove all labels from an issue"
openapi: "DELETE /repos/{owner}/{repo}/issues/{index}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "Replace all labels for an issue"
openapi: "PUT /repos/{owner}/{repo}/issues/{index}/labels"
---

View File

@@ -0,0 +1,4 @@
---
title: "Update a label"
openapi: "PATCH /repos/{owner}/{repo}/labels/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a git blob"
openapi: "GET /repos/{owner}/{repo}/git/blobs/{sha}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a tree"
openapi: "GET /repos/{owner}/{repo}/git/trees/{sha}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Render a Markdown document in raw mode"
openapi: "POST /markdown/raw"
---

View File

@@ -0,0 +1,4 @@
---
title: "Render a Markdown document"
openapi: "POST /markdown"
---

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
---
title: "Create an organization"
openapi: "POST /user/orgs"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit an organization"
openapi: "PATCH /orgs/{orgname}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get an organization"
openapi: "GET /orgs/{orgname}"
---

View File

@@ -0,0 +1,4 @@
---
title: "List teams of an organization"
openapi: "GET /orgs/{orgname}/teams"
---

View File

@@ -0,0 +1,4 @@
---
title: "List user organizations"
openapi: "GET /users/{username}/orgs"
---

View File

@@ -0,0 +1,4 @@
---
title: "List your organizations"
openapi: "GET /user/orgs"
---

View File

@@ -0,0 +1,4 @@
---
title: "List releases"
openapi: "GET /repos/{owner}/{repo}/releases"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a repository in an organization"
openapi: "POST /org/{org}/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a repository"
openapi: "POST /user/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create or update a file"
openapi: "PUT /repos/{owner}/{repo}/contents/{path}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a repository"
openapi: "DELETE /repos/{owner}/{repo}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Download archive"
openapi: "GET /repos/{owner}/{repo}/archive/{archive}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Download raw content"
openapi: "GET /repos/{owner}/{repo}/raw/{ref}/{filepath}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit issue tracker settings"
openapi: "PATCH /repos/{owner}/{repo}/issue-tracker"
---

View File

@@ -0,0 +1,4 @@
---
title: "Edit wiki settings"
openapi: "PATCH /repos/{owner}/{repo}/wiki"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a branch"
openapi: "GET /repos/{owner}/{repo}/branches/{branch}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a repository"
openapi: "GET /repos/{owner}/{repo}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single commit"
openapi: "GET /repos/{owner}/{repo}/commits/{sha}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get contents"
openapi: "GET /repos/{owner}/{repo}/contents/{path}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get editorconfig definition"
openapi: "GET /repos/{owner}/{repo}/editorconfig/{filename}"
---

View File

@@ -0,0 +1,4 @@
---
title: "List all commits"
openapi: "GET /repos/{owner}/{repo}/commits"
---

View File

@@ -0,0 +1,4 @@
---
title: "List branches"
openapi: "GET /repos/{owner}/{repo}/branches"
---

View File

@@ -0,0 +1,4 @@
---
title: "List forks"
openapi: "GET /repos/{owner}/{repo}/forks"
---

View File

@@ -0,0 +1,4 @@
---
title: "List organization repositories"
openapi: "GET /orgs/{orgname}/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "List tags"
openapi: "GET /repos/{owner}/{repo}/tags"
---

View File

@@ -0,0 +1,4 @@
---
title: "List user repositories"
openapi: "GET /users/{username}/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "List your repositories"
openapi: "GET /user/repos"
---

View File

@@ -0,0 +1,4 @@
---
title: "Migrate a repository"
openapi: "POST /repos/migrate"
---

View File

@@ -0,0 +1,4 @@
---
title: "Mirror sync"
openapi: "POST /repos/{owner}/{repo}/mirror-sync"
---

View File

@@ -0,0 +1,4 @@
---
title: "Search repositories"
openapi: "GET /repos/search"
---

View File

@@ -0,0 +1,4 @@
---
title: "Add email addresses"
openapi: "POST /user/emails"
---

View File

@@ -0,0 +1,4 @@
---
title: "Check if a user follows another"
openapi: "GET /users/{username}/following/{target}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Check if you follow a user"
openapi: "GET /user/following/{target}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create a public key"
openapi: "POST /user/keys"
---

View File

@@ -0,0 +1,4 @@
---
title: "Create an access token"
openapi: "POST /users/{username}/tokens"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete a public key"
openapi: "DELETE /user/keys/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Delete email addresses"
openapi: "DELETE /user/emails"
---

View File

@@ -0,0 +1,4 @@
---
title: "Follow a user"
openapi: "PUT /user/following/{target}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single public key"
openapi: "GET /user/keys/{id}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get a single user"
openapi: "GET /users/{username}"
---

View File

@@ -0,0 +1,4 @@
---
title: "Get the authenticated user"
openapi: "GET /user"
---

View File

@@ -0,0 +1,4 @@
---
title: "List access tokens"
openapi: "GET /users/{username}/tokens"
---

View File

@@ -0,0 +1,4 @@
---
title: "List email addresses"
openapi: "GET /user/emails"
---

View File

@@ -0,0 +1,4 @@
---
title: "List followers of a user"
openapi: "GET /users/{username}/followers"
---

View File

@@ -0,0 +1,4 @@
---
title: "List public keys for a user"
openapi: "GET /users/{username}/keys"
---

View File

@@ -0,0 +1,4 @@
---
title: "List users followed by a user"
openapi: "GET /users/{username}/following"
---

View File

@@ -0,0 +1,4 @@
---
title: "List who you are following"
openapi: "GET /user/following"
---

View File

@@ -0,0 +1,4 @@
---
title: "List your followers"
openapi: "GET /user/followers"
---

View File

@@ -0,0 +1,4 @@
---
title: "List your public keys"
openapi: "GET /user/keys"
---

Some files were not shown because too many files have changed in this diff Show More