The API is bundled with every Gogs installation. No additional setup is required.
Current version
All Gogs APIs are under v1 using the request path prefix/api/v1.
Schema
All data is sent and received as JSON unless specified otherwise.Authentication
There are two ways to authenticate through the Gogs API. Requests that require authentication will return404 Not Found instead of 403 Forbidden in some places. This is to prevent the accidental leakage of private resources to unauthorized users.
- Basic authentication
- Access token
Basic authentication is used to obtain access tokens. Supply your username (you will be prompted for your password):
Pagination
API responses that return multiple items are paginated. You can specify further pages with the?page query parameter.
?page parameter returns the first page.
Link header
Pagination info is included in the Link header of each response. Use this to navigate between pages programmatically.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. |
SDKs
The following best-effort-maintained SDKs are available:| Language | Repository |
|---|---|
| Go | gogs/go-gogs-client |