How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Forgejo admin API

The admin API from Forgejo — 34 operation(s) for admin.

Forgejo admin API is one of 10 APIs that Forgejo publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Admin. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 51 operations across 34 paths, and defines 52 schemas. It is described by OpenAPI 2.0, at version 16.0.0-dev-465-4b83448b7d+gitea-1.22.0.

Requests are made against the base URL https://code.forgejo.org/api/v1.

51 operations 34 paths 52 schemas 11 DELETE22 GET3 PATCH13 POST2 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 2.0
API Version
16.0.0-dev-465-4b83448b7d+gitea-1.22.0
Base URL
https://code.forgejo.org/api/v1
Authentication
API Key, basic, API Key, API Key, API Key
Resource Areas
1

Authentication & Security 5

Forgejo admin API declares 5 security schemes for authenticating requests. An API key is passed in the header as Authorization (AuthorizationHeaderToken). It defines a basic scheme (BasicAuth). An API key is passed in the header as Sudo (SudoHeader). An API key is passed in the query as sudo (SudoParam). An API key is passed in the header as X-FORGEJO-OTP (TOTPHeader). By default, every request must be authenticated.

  • AuthorizationHeaderToken — API tokens must be prepended with "token" followed by a space.
  • SudoHeader — Sudo API request as the user provided as the key. Admin privileges are required.
  • SudoParam — Sudo API request as the user provided as the key. Admin privileges are required.
  • TOTPHeader — Must be used in combination with BasicAuth if two-factor authentication is enabled.

Paths & Operations 51

Across 34 paths, the API surfaces 51 operations — 11 DELETE, 22 GET, 3 PATCH, 13 POST, 2 PUT. Each is listed below with its method, path, parameters, and response codes.

admin 51
GET
/admin/actions/runners
Get all runners, no matter whether they are global runners or scoped to an organization, user, or repository
getAdminRunners 3 params → 200400404
POST
/admin/actions/runners
Register a new global runner
registerAdminRunner 1 param → 201400401404
GET
/admin/actions/runners/jobs
Get action run jobs
adminGetActionRunJobs 1 param → 200403
GET
/admin/actions/runners/registration-tokendeprecated
Get a runner registration token for registering global runners
adminGetRunnerRegistrationToken → 200
GET
/admin/actions/runners/{runner_id}
Get a particular runner, no matter whether it is a global runner or scoped to an organization, user, or repository
getAdminRunner 1 param → 200400404
DELETE
/admin/actions/runners/{runner_id}
Delete a particular runner, no matter whether it is a global runner or scoped to an organization, user, or repository
deleteAdminRunner 1 param → 204400404
GET
/admin/cron
List cron tasks
adminCronList 2 params → 200403
POST
/admin/cron/{task}
Run cron task
adminCronRun 1 param → 204404
GET
/admin/emails
List all users' email addresses
adminGetAllEmails 2 params → 200403
GET
/admin/emails/search
Search users' email addresses
adminSearchEmails 3 params → 200403
GET
/admin/hooks
List global (system) webhooks
adminListHooks 2 params → 200
POST
/admin/hooks
Create a hook
adminCreateHook 1 param → 201
GET
/admin/hooks/{id}
Get a hook
adminGetHook 1 param → 200
DELETE
/admin/hooks/{id}
Delete a hook
adminDeleteHook 1 param → 204
PATCH
/admin/hooks/{id}
Update a hook
adminEditHook 2 params → 200
GET
/admin/orgs
List all organizations
adminGetAllOrgs 2 params → 200403
GET
/admin/quota/groups
List the available quota groups
adminListQuotaGroups → 200403
POST
/admin/quota/groups
Create a new quota group
adminCreateQuotaGroup 1 param → 201400403409422
GET
/admin/quota/groups/{quotagroup}
Get information about the quota group
adminGetQuotaGroup 1 param → 200400403404
DELETE
/admin/quota/groups/{quotagroup}
Delete a quota group
adminDeleteQuotaGroup 1 param → 204400403404
PUT
/admin/quota/groups/{quotagroup}/rules/{quotarule}
Adds a rule to a quota group
adminAddRuleToQuotaGroup 2 params → 204400403404409422
DELETE
/admin/quota/groups/{quotagroup}/rules/{quotarule}
Removes a rule from a quota group
adminRemoveRuleFromQuotaGroup 2 params → 201400403404
GET
/admin/quota/groups/{quotagroup}/users
List users in a quota group
adminListUsersInQuotaGroup 1 param → 200400403404
PUT
/admin/quota/groups/{quotagroup}/users/{username}
Add a user to a quota group
adminAddUserToQuotaGroup 2 params → 204400403404409422
DELETE
/admin/quota/groups/{quotagroup}/users/{username}
Remove a user from a quota group
adminRemoveUserFromQuotaGroup 2 params → 204400403404
GET
/admin/quota/rules
List the available quota rules
adminListQuotaRules → 200403
POST
/admin/quota/rules
Create a new quota rule
adminCreateQuotaRule 1 param → 201400403409422
GET
/admin/quota/rules/{quotarule}
Get information about a quota rule
adminGetQuotaRule 1 param → 200400403404
DELETE
/admin/quota/rules/{quotarule}
Deletes a quota rule
adminDeleteQuotaRule 1 param → 204400403404
PATCH
/admin/quota/rules/{quotarule}
Change an existing quota rule
adminEditQuotaRule 2 params → 200400403404422
GET
/admin/runners/jobsdeprecated
Search action jobs according to filter conditions
adminSearchRunJobs 1 param → 200403
GET
/admin/runners/registration-tokendeprecated
Get a runner registration token for registering global runners
adminGetRegistrationToken → 200
GET
/admin/unadopted
List unadopted repositories
adminUnadoptedList 3 params → 200403
POST
/admin/unadopted/{owner}/{repo}
Adopt unadopted files as a repository
adminAdoptRepository 2 params → 204403404
DELETE
/admin/unadopted/{owner}/{repo}
Delete unadopted files
adminDeleteUnadoptedRepository 2 params → 204403
GET
/admin/users
Search users according filter conditions
adminSearchUsers 6 params → 200403
POST
/admin/users
Create a user account
adminCreateUser 1 param → 201400403422
DELETE
/admin/users/{username}
Delete user account
adminDeleteUser 2 params → 204403404422
PATCH
/admin/users/{username}
Edit an existing user
adminEditUser 2 params → 200400403422
GET
/admin/users/{username}/emails
List all email addresses for a user
adminListUserEmails 1 param → 200403404
DELETE
/admin/users/{username}/emails
Delete email addresses from a user's account
adminDeleteUserEmails 2 params → 204403422
POST
/admin/users/{username}/keys
Add an SSH public key to user's account
adminCreatePublicKey 2 params → 201403422
DELETE
/admin/users/{username}/keys/{id}
Remove a public key from user's account
adminDeleteUserPublicKey 2 params → 204403404
POST
/admin/users/{username}/orgs
Create an organization
adminCreateOrg 2 params → 201403422
GET
/admin/users/{username}/quota
Get the user's quota info
adminGetUserQuota 1 param → 200400403404422
POST
/admin/users/{username}/quota/groups
Set the user's quota groups to a given list.
adminSetUserQuotaGroups 2 params → 204400403404422
POST
/admin/users/{username}/rename
Rename a user
adminRenameUser 2 params → 204403422
POST
/admin/users/{username}/repos
Create a repository on behalf of a user
adminCreateRepo 2 params → 201400403404409422
GET
/admin/users/{username}/tokens
List the specified user's access tokens
adminListUserAccessTokens 3 params → 200403404
POST
/admin/users/{username}/tokens
Create an access token for the specified user
adminCreateUserAccessToken 2 params → 201400403404
DELETE
/admin/users/{username}/tokens/{token}
Delete an access token for the specified user
adminDeleteUserAccessToken 2 params → 204403404422

Schemas 52

The contract defines 52 schemas that model the data the API accepts and returns. The most detailed are Repository (66 properties), User (23 properties), EditUserOption (20 properties), Organization (12 properties). Each schema is shown below with its type and property counts.

Team
object
Team represents a team in an organization
9 properties
APIUnauthorizedError
object
2 properties
APIValidationError
object
2 properties
DeleteEmailOption
object
DeleteEmailOption options when deleting email addresses
1 property
ExternalWiki
object
ExternalWiki represents setting for external wiki
1 property
Cron
object
Cron represents a Cron task
5 properties
QuotaUsedSizeGit
object
QuotaUsedSizeGit represents the size-based git (lfs) quota usage of a user
1 property
InternalTracker
object
InternalTracker represents settings for internal tracker
3 properties
QuotaUsedSizeAssetsPackages
object
QuotaUsedSizeAssetsPackages represents the size-based package quota usage of a user
1 property
CreateHookOption
object
CreateHookOption options when create a hook
6 properties 2 required
CreateHookOptionConfig
object
CreateHookOptionConfig has all config options in it required are "contenttype" and "url" Required
CreateKeyOption
object
CreateKeyOption options when creating a key
3 properties 2 required
Repository
object
Repository represents a repository
66 properties
User
object
User represents a user
23 properties
APINotFound
object
3 properties
ActionRunner
object
ActionRunner represents a runner
10 properties
Email
object
Email an email address belonging to a user
5 properties
CreateUserOption
object
CreateUserOption create user options
11 properties 2 required
RepoTargetOption
object
2 properties 2 required
RegisterRunnerOptions
object
3 properties 1 required
RenameUserOption
object
RenameUserOption options when renaming a user
1 property 1 required
QuotaUsedSize
object
QuotaUsedSize represents the size-based quota usage of a user
3 properties
Hook
object
Hook a hook is a web hook when one repository changed
12 properties
QuotaGroup
object
QuotaGroup represents a quota group
2 properties
EditHookOption
object
EditHookOption options when modify one hook
5 properties
RegistrationToken
object
RegistrationToken is a string used to register a runner with a server
1 property
Organization
object
Organization represents an organization
12 properties
QuotaRuleInfo
object
QuotaRuleInfo contains information about a quota rule
3 properties
CreateQuotaGroupOptions
object
CreateQutaGroupOptions represents the options for creating a quota group
2 properties
RepositoryMeta
object
RepositoryMeta basic repository information
4 properties
SetUserQuotaGroupsOptions
object
SetUserQuotaGroupsOptions represents the quota groups of a user
1 property 1 required
QuotaGroupList
array
QuotaGroupList represents a list of quota groups
CreateRepoOption
object
CreateRepoOption options when creating repository
12 properties 1 required
QuotaUsed
object
QuotaUsed represents the quota usage of a user
1 property
CreateQuotaRuleOptions
object
CreateQuotaRuleOptions represents the options for creating a quota rule
3 properties
EditUserOption
object
EditUserOption edit user options
20 properties
RepoTransfer
object
RepoTransfer represents a pending repo transfer
3 properties
QuotaUsedSizeAssetsAttachments
object
QuotaUsedSizeAssetsAttachments represents the size-based attachment quota usage of a user
2 properties
CreateAccessTokenOption
object
CreateAccessTokenOption options when create access token
3 properties 1 required
Permission
object
Permission represents a set of permissions
3 properties
APIForbiddenError
object
2 properties
ActionRunJob
object
ActionRunJob represents a job of a run
11 properties
PublicKey
object
PublicKey publickey is a user key to push code to repository
11 properties
CreateOrgOption
object
CreateOrgOption options for creating an organization
8 properties 1 required
RegisterRunnerResponse
object
3 properties
EditQuotaRuleOptions
object
EditQuotaRuleOptions represents the options for editing a quota rule
2 properties
QuotaUsedSizeAssets
object
QuotaUsedSizeAssets represents the size-based asset usage of a user
3 properties
QuotaInfo
object
QuotaInfo represents information about a user's quota
2 properties
ExternalTracker
object
ExternalTracker represents settings for external tracker
4 properties
QuotaUsedSizeRepos
object
QuotaUsedSizeRepos represents the size-based repository quota usage of a user
2 properties
APIError
object
APIError is an api error with a message
2 properties
AccessToken
object
7 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

forgejo-admin-api-openapi.yml Raw ↑

Other APIs Forgejo publishes across the network.

Forgejo activitypub API
Forgejo issue API
Forgejo miscellaneous API
Forgejo notification API
Forgejo organization API
Forgejo package API
Forgejo repository API
Forgejo settings API
Forgejo user API
Where this information came from

This is an independent, third-party profile of Forgejo admin API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.