Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This is a set of documents which describes Gogs API usage, since it's still in early stage:
- Content of documentation and APIs are subject to change.
- We do not provide documentation in other languages.
- Aim to be format similar to GitHub v3 APIs.
The following list syncs with
develop branch of Gogs (
[-] means planned but feature itself has not been implemented yet in Gogs).
- [-] Notifications
- [-] Gists
- [-] Review Comments
- [-] Comments
- Deploy Keys
- Public Keys
- [-] Stats
- [-] Configuration
If you have any questions or concern, please file an issue.
All Gogs APIs are under v1 using request path prefix
Parameters of all requests use POST method can be passed through a normal HTML form or JSON data, but sending JSON is recommended.
There are three ways to authenticate through Gogs API v1. 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 repositories to unauthorized users.
$ curl -u "unknwon" https://try.gogs.io/api/v1/users/unknwon/tokens
Basic authentication can be used for all Gogs APIs.
Personal access tokens are easier to manage and use, but except for few APIs(e.g. API to generate or get a access token), and they can be sent in header or URL query.
$ curl -H "Authorization: token ACCESS-TOKEN" https://try.gogs.io/api/v1/user/repos $ curl https://try.gogs.io/api/v1/user/repos?token=ACCESS-TOKEN
- The style of documentation is heavily influenced by GitHub Developer.