Skip to main content
Use Gitea through Corsair: one client, typed API calls, and incoming webhooks. Gitea is self-hosted, so each account stores two things: an access token and the instance_url of the site it belongs to (https://gitea.com, https://codeberg.org or your own https://git.example.com, with or without /api/v1). Forgejo and Codeberg serve the same API v1, so the plugin works there too. A route an older or forked server lacks answers 404 page not found, and a body field it doesn’t know is ignored rather than refused: the stale-edit check content_version on issues.update and pulls.update only works on servers that include go-gitea/gitea#37035. Create the token at <instance>/user/settings/applications with the scopes you need (read:/write: repository, issue, organization, user, notification, package, misc, and admin for the site-admin routes); it is sent as Authorization: token <token>. SDK users can pass instanceUrl in the plugin options instead of storing it; with a stored token it must match the stored instance (the token is never sent to another host), else pass key too.
  • Repository routes take owner and repo. Branches, refs, tags and file paths keep their slashes (feature/login, docs/README.md).
  • Lists page with page (1-based) and limit; the plugin sends 50 when limit is left out. Gitea clamps limit to the instance’s MAX_RESPONSE_ITEMS (50 unless an admin lowered it), so a short page doesn’t mean the list ended. Paged lists return { items, next_page }, with next_page set while a page has entries: step page until it is null.
  • Files. contents.get returns a file’s metadata and base64 content; contents.raw, contents.media, repos.downloadArchive and the Actions log and artifact downloads return the bytes as a file. Diffs, patches, signing keys and rendered markdown come back as { text }.
  • Risk. Every delete is destructive, as are site-admin changes to users and organizations, merging a pull request, moving a branch to another commit (branches.setCommit), applying a patch, transfers, renaming an organization and overwriting Actions secrets. admin.* needs a site-admin token.
  • Webhooks. Register one with webhooks.create (or orgs.hooks.create, user.hooks.create, admin.hooks.create) using type: gitea and a config.secret, point it at your Corsair webhook URL, and give the plugin the same secret as webhookSecret (or store it as the account’s webhook signature). Deliveries are checked against X-Gitea-Signature (HMAC-SHA256 of the body) and routed by X-Gitea-Event-Type to push, refCreated, refDeleted, fork, issues, issueComment, pullRequest, pullRequestReview, release, wiki, repository, status, workflowRun, workflowJob and package.
  • Not wrapped: four routes the swagger marks deprecated (each has a replacement), and users.tokens list, create and delete, which Gitea only accepts with the account password (BasicAuth), not a token.
What you get:
  • 530 typed API operations
  • 15 incoming webhook event types

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

4

Connect a tenant

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.

Example API calls

Get a repository
Create an issue
See the full list on the API page.

Webhooks

This plugin registers 15 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then use webhookHooks on the plugin factory. See Webhooks for every event path and payload shape, and Webhooks concept for routing.

What’s next

API reference

Every gitea.api.* operation with input and output types.

Webhooks

Event paths, payloads, and webhookHooks examples.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.