Forgejo admin API

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

Operations 51

GET /admin/actions/runners Get all runners, no matter whether they are global runners or scoped to an organization, user, or repository #
POST /admin/actions/runners Register a new global runner #
GET /admin/actions/runners/jobs Get action run jobs #
GET /admin/actions/runners/registration-token Get a runner registration token for registering global runners #
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 #
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 #
GET /admin/cron List cron tasks #
POST /admin/cron/{task} Run cron task #
GET /admin/emails List all users' email addresses #
GET /admin/emails/search Search users' email addresses #
GET /admin/hooks List global (system) webhooks #
POST /admin/hooks Create a hook #
GET /admin/hooks/{id} Get a hook #
DELETE /admin/hooks/{id} Delete a hook #
PATCH /admin/hooks/{id} Update a hook #
GET /admin/orgs List all organizations #
GET /admin/quota/groups List the available quota groups #
POST /admin/quota/groups Create a new quota group #
GET /admin/quota/groups/{quotagroup} Get information about the quota group #
DELETE /admin/quota/groups/{quotagroup} Delete a quota group #
PUT /admin/quota/groups/{quotagroup}/rules/{quotarule} Adds a rule to a quota group #
DELETE /admin/quota/groups/{quotagroup}/rules/{quotarule} Removes a rule from a quota group #
GET /admin/quota/groups/{quotagroup}/users List users in a quota group #
PUT /admin/quota/groups/{quotagroup}/users/{username} Add a user to a quota group #
DELETE /admin/quota/groups/{quotagroup}/users/{username} Remove a user from a quota group #
GET /admin/quota/rules List the available quota rules #
POST /admin/quota/rules Create a new quota rule #
GET /admin/quota/rules/{quotarule} Get information about a quota rule #
DELETE /admin/quota/rules/{quotarule} Deletes a quota rule #
PATCH /admin/quota/rules/{quotarule} Change an existing quota rule #
GET /admin/runners/jobs Search action jobs according to filter conditions #
GET /admin/runners/registration-token Get a runner registration token for registering global runners #
GET /admin/unadopted List unadopted repositories #
POST /admin/unadopted/{owner}/{repo} Adopt unadopted files as a repository #
DELETE /admin/unadopted/{owner}/{repo} Delete unadopted files #
GET /admin/users Search users according filter conditions #
POST /admin/users Create a user account #
DELETE /admin/users/{username} Delete user account #
PATCH /admin/users/{username} Edit an existing user #
GET /admin/users/{username}/emails List all email addresses for a user #
DELETE /admin/users/{username}/emails Delete email addresses from a user's account #
POST /admin/users/{username}/keys Add an SSH public key to user's account #
DELETE /admin/users/{username}/keys/{id} Remove a public key from user's account #
POST /admin/users/{username}/orgs Create an organization #
GET /admin/users/{username}/quota Get the user's quota info #
POST /admin/users/{username}/quota/groups Set the user's quota groups to a given list. #
POST /admin/users/{username}/rename Rename a user #
POST /admin/users/{username}/repos Create a repository on behalf of a user #
GET /admin/users/{username}/tokens List the specified user's access tokens #
POST /admin/users/{username}/tokens Create an access token for the specified user #
DELETE /admin/users/{username}/tokens/{token} Delete an access token for the specified user #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/forgejo-admin-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

forgejo-admin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: This documentation describes the Forgejo API.
  title: Forgejo activitypub Admin API
  license:
    name: This file is distributed under the MIT license for the purpose of interoperability
    url: http://opensource.org/licenses/MIT
  version: 16.0.0-dev-465-4b83448b7d+gitea-1.22.0
servers:
- url: /api/v1
security:
- BasicAuth: []
- AuthorizationHeaderToken: []
- SudoParam: []
- SudoHeader: []
- TOTPHeader: []
tags:
- name: admin
paths:
  /admin/actions/runners:
    get:
      tags:
      - admin
      summary: Get all runners, no matter whether they are global runners or scoped to an organization, user, or repository
      operationId: getAdminRunners
      parameters:
      - description: whether to include all visible runners (true) or only those that are directly owned by the instance (false)
        name: visible
        in: query
        schema:
          type: boolean
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/ActionRunnerList'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
    post:
      tags:
      - admin
      summary: Register a new global runner
      operationId: registerAdminRunner
      responses:
        '201':
          $ref: '#/components/responses/RegisterRunnerResponse'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRunnerOptions'
  /admin/actions/runners/jobs:
    get:
      tags:
      - admin
      summary: Get action run jobs
      operationId: adminGetActionRunJobs
      parameters:
      - description: a comma separated list of labels to search for
        name: labels
        in: query
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/RunJobList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/actions/runners/registration-token:
    get:
      description: 'This operation has been deprecated in Forgejo 15. Use the web UI or [`/admin/actions/runners`](#/admin/registerAdminRunner) instead.

        '
      tags:
      - admin
      summary: Get a runner registration token for registering global runners
      operationId: adminGetRunnerRegistrationToken
      deprecated: true
      responses:
        '200':
          $ref: '#/components/responses/RegistrationToken'
  /admin/actions/runners/{runner_id}:
    get:
      tags:
      - admin
      summary: Get a particular runner, no matter whether it is a global runner or scoped to an organization, user, or repository
      operationId: getAdminRunner
      parameters:
      - description: ID of the runner
        name: runner_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/ActionRunner'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Delete a particular runner, no matter whether it is a global runner or scoped to an organization, user, or repository
      operationId: deleteAdminRunner
      parameters:
      - description: ID of the runner
        name: runner_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: runner has been deleted
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/cron:
    get:
      tags:
      - admin
      summary: List cron tasks
      operationId: adminCronList
      parameters:
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/CronList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/cron/{task}:
    post:
      tags:
      - admin
      summary: Run cron task
      operationId: adminCronRun
      parameters:
      - description: task to run
        name: task
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/emails:
    get:
      tags:
      - admin
      summary: List all users' email addresses
      operationId: adminGetAllEmails
      parameters:
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/EmailList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/emails/search:
    get:
      tags:
      - admin
      summary: Search users' email addresses
      operationId: adminSearchEmails
      parameters:
      - description: keyword
        name: q
        in: query
        schema:
          type: string
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/EmailList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/hooks:
    get:
      tags:
      - admin
      summary: List global (system) webhooks
      operationId: adminListHooks
      parameters:
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/HookListWithoutPagination'
    post:
      tags:
      - admin
      summary: Create a hook
      operationId: adminCreateHook
      responses:
        '201':
          $ref: '#/components/responses/Hook'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHookOption'
        required: true
  /admin/hooks/{id}:
    get:
      tags:
      - admin
      summary: Get a hook
      operationId: adminGetHook
      parameters:
      - description: id of the hook to get
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/Hook'
    delete:
      tags:
      - admin
      summary: Delete a hook
      operationId: adminDeleteHook
      parameters:
      - description: id of the hook to delete
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '204':
          $ref: '#/components/responses/empty'
    patch:
      tags:
      - admin
      summary: Update a hook
      operationId: adminEditHook
      parameters:
      - description: id of the hook to update
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/Hook'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditHookOption'
  /admin/orgs:
    get:
      tags:
      - admin
      summary: List all organizations
      operationId: adminGetAllOrgs
      parameters:
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/OrganizationList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/quota/groups:
    get:
      tags:
      - admin
      summary: List the available quota groups
      operationId: adminListQuotaGroups
      responses:
        '200':
          $ref: '#/components/responses/QuotaGroupList'
        '403':
          $ref: '#/components/responses/forbidden'
    post:
      tags:
      - admin
      summary: Create a new quota group
      operationId: adminCreateQuotaGroup
      responses:
        '201':
          $ref: '#/components/responses/QuotaGroup'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '409':
          $ref: '#/components/responses/error'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuotaGroupOptions'
          text/plain:
            schema:
              $ref: '#/components/schemas/CreateQuotaGroupOptions'
        description: Definition of the quota group
        required: true
  /admin/quota/groups/{quotagroup}:
    get:
      tags:
      - admin
      summary: Get information about the quota group
      operationId: adminGetQuotaGroup
      parameters:
      - description: quota group to query
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/QuotaGroup'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Delete a quota group
      operationId: adminDeleteQuotaGroup
      parameters:
      - description: quota group to delete
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/quota/groups/{quotagroup}/rules/{quotarule}:
    put:
      tags:
      - admin
      summary: Adds a rule to a quota group
      operationId: adminAddRuleToQuotaGroup
      parameters:
      - description: quota group to add a rule to
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      - description: the name of the quota rule to add to the group
        name: quotarule
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/error'
        '422':
          $ref: '#/components/responses/validationError'
    delete:
      tags:
      - admin
      summary: Removes a rule from a quota group
      operationId: adminRemoveRuleFromQuotaGroup
      parameters:
      - description: quota group to remove a rule from
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      - description: the name of the quota rule to remove from the group
        name: quotarule
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/quota/groups/{quotagroup}/users:
    get:
      tags:
      - admin
      summary: List users in a quota group
      operationId: adminListUsersInQuotaGroup
      parameters:
      - description: quota group to list members of
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/UserList'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/quota/groups/{quotagroup}/users/{username}:
    put:
      tags:
      - admin
      summary: Add a user to a quota group
      operationId: adminAddUserToQuotaGroup
      parameters:
      - description: quota group to add the user to
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      - description: username of the user to add to the quota group
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/error'
        '422':
          $ref: '#/components/responses/validationError'
    delete:
      tags:
      - admin
      summary: Remove a user from a quota group
      operationId: adminRemoveUserFromQuotaGroup
      parameters:
      - description: quota group to remove a user from
        name: quotagroup
        in: path
        required: true
        schema:
          type: string
      - description: username of the user to remove from the quota group
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/quota/rules:
    get:
      tags:
      - admin
      summary: List the available quota rules
      operationId: adminListQuotaRules
      responses:
        '200':
          $ref: '#/components/responses/QuotaRuleInfoList'
        '403':
          $ref: '#/components/responses/forbidden'
    post:
      tags:
      - admin
      summary: Create a new quota rule
      operationId: adminCreateQuotaRule
      responses:
        '201':
          $ref: '#/components/responses/QuotaRuleInfo'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '409':
          $ref: '#/components/responses/error'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQuotaRuleOptions'
          text/plain:
            schema:
              $ref: '#/components/schemas/CreateQuotaRuleOptions'
        description: Definition of the quota rule
        required: true
  /admin/quota/rules/{quotarule}:
    get:
      tags:
      - admin
      summary: Get information about a quota rule
      operationId: adminGetQuotaRule
      parameters:
      - description: quota rule to query
        name: quotarule
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/QuotaRuleInfo'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Deletes a quota rule
      operationId: adminDeleteQuotaRule
      parameters:
      - description: quota rule to delete
        name: quotarule
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    patch:
      tags:
      - admin
      summary: Change an existing quota rule
      operationId: adminEditQuotaRule
      parameters:
      - description: Quota rule to change
        name: quotarule
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/QuotaRuleInfo'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditQuotaRuleOptions'
          text/plain:
            schema:
              $ref: '#/components/schemas/EditQuotaRuleOptions'
        required: true
  /admin/runners/jobs:
    get:
      description: 'This operation has been deprecated in Forgejo 15. Use [`/admin/actions/runners/jobs`](#/admin/adminGetActionRunJobs) instead.

        '
      tags:
      - admin
      summary: Search action jobs according to filter conditions
      operationId: adminSearchRunJobs
      deprecated: true
      parameters:
      - description: a comma separated list of run job labels to search for
        name: labels
        in: query
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/RunJobList'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/runners/registration-token:
    get:
      description: 'This operation has been deprecated in Forgejo 15. Use the web UI or [`/admin/actions/runners`](#/admin/registerAdminRunner) instead.

        '
      tags:
      - admin
      summary: Get a runner registration token for registering global runners
      operationId: adminGetRegistrationToken
      deprecated: true
      responses:
        '200':
          $ref: '#/components/responses/RegistrationToken'
  /admin/unadopted:
    get:
      tags:
      - admin
      summary: List unadopted repositories
      operationId: adminUnadoptedList
      parameters:
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      - description: pattern of repositories to search for
        name: pattern
        in: query
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/StringSlice'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/unadopted/{owner}/{repo}:
    post:
      tags:
      - admin
      summary: Adopt unadopted files as a repository
      operationId: adminAdoptRepository
      parameters:
      - description: owner of the repo
        name: owner
        in: path
        required: true
        schema:
          type: string
      - description: name of the repo
        name: repo
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Delete unadopted files
      operationId: adminDeleteUnadoptedRepository
      parameters:
      - description: owner of the repo
        name: owner
        in: path
        required: true
        schema:
          type: string
      - description: name of the repo
        name: repo
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
  /admin/users:
    get:
      tags:
      - admin
      summary: Search users according filter conditions
      operationId: adminSearchUsers
      parameters:
      - description: ID of the user's login source to search for
        name: source_id
        in: query
        schema:
          type: integer
          format: int64
      - description: user's login name to search for
        name: login_name
        in: query
        schema:
          type: string
      - description: whether or not to filter users with the 2fa enabled
        name: is_2fa_enabled
        in: query
        schema:
          type: boolean
      - description: sort order of results
        name: sort
        in: query
        schema:
          type: string
          enum:
          - oldest
          - newest
          - alphabetically
          - reversealphabetically
          - recentupdate
          - leastupdate
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/UserList'
        '403':
          $ref: '#/components/responses/forbidden'
    post:
      tags:
      - admin
      summary: Create a user account
      operationId: adminCreateUser
      responses:
        '201':
          $ref: '#/components/responses/User'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserOption'
  /admin/users/{username}:
    delete:
      tags:
      - admin
      summary: Delete user account
      operationId: adminDeleteUser
      parameters:
      - description: username of user to delete
        name: username
        in: path
        required: true
        schema:
          type: string
      - description: purge the user from the system completely
        name: purge
        in: query
        schema:
          type: boolean
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '422':
          $ref: '#/components/responses/validationError'
    patch:
      tags:
      - admin
      summary: Edit an existing user
      operationId: adminEditUser
      parameters:
      - description: username of user to edit
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/User'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditUserOption'
  /admin/users/{username}/emails:
    get:
      tags:
      - admin
      summary: List all email addresses for a user
      operationId: adminListUserEmails
      parameters:
      - description: username of user to get email addresses of
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/EmailList'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Delete email addresses from a user's account
      operationId: adminDeleteUserEmails
      parameters:
      - description: username of user to delete email addresses from
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteEmailOption'
          text/plain:
            schema:
              $ref: '#/components/schemas/DeleteEmailOption'
  /admin/users/{username}/keys:
    post:
      tags:
      - admin
      summary: Add an SSH public key to user's account
      operationId: adminCreatePublicKey
      parameters:
      - description: username of the user
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          $ref: '#/components/responses/PublicKey'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyOption'
  /admin/users/{username}/keys/{id}:
    delete:
      tags:
      - admin
      summary: Remove a public key from user's account
      operationId: adminDeleteUserPublicKey
      parameters:
      - description: username of user
        name: username
        in: path
        required: true
        schema:
          type: string
      - description: id of the key to delete
        name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/users/{username}/orgs:
    post:
      tags:
      - admin
      summary: Create an organization
      operationId: adminCreateOrg
      parameters:
      - description: username of the user that will own the created organization
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          $ref: '#/components/responses/Organization'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrgOption'
        required: true
  /admin/users/{username}/quota:
    get:
      tags:
      - admin
      summary: Get the user's quota info
      operationId: adminGetUserQuota
      parameters:
      - description: username of user to query
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/QuotaInfo'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '422':
          $ref: '#/components/responses/validationError'
  /admin/users/{username}/quota/groups:
    post:
      tags:
      - admin
      summary: Set the user's quota groups to a given list.
      operationId: adminSetUserQuotaGroups
      parameters:
      - description: username of the user to modify the quota groups from
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetUserQuotaGroupsOptions'
          text/plain:
            schema:
              $ref: '#/components/schemas/SetUserQuotaGroupsOptions'
        description: list of groups that the user should be a member of
        required: true
  /admin/users/{username}/rename:
    post:
      tags:
      - admin
      summary: Rename a user
      operationId: adminRenameUser
      parameters:
      - description: existing username of user
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenameUserOption'
          text/plain:
            schema:
              $ref: '#/components/schemas/RenameUserOption'
        required: true
  /admin/users/{username}/repos:
    post:
      tags:
      - admin
      summary: Create a repository on behalf of a user
      operationId: adminCreateRepo
      parameters:
      - description: username of the user. This user will own the created repository
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          $ref: '#/components/responses/Repository'
        '400':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '409':
          $ref: '#/components/responses/error'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRepoOption'
        required: true
  /admin/users/{username}/tokens:
    get:
      tags:
      - admin
      summary: List the specified user's access tokens
      operationId: adminListUserAccessTokens
      parameters:
      - description: username of user
        name: username
        in: path
        required: true
        schema:
          type: string
      - description: page number of results to return (1-based)
        name: page
        in: query
        schema:
          type: integer
      - description: page size of results
        name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          $ref: '#/components/responses/AccessTokenList'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
    post:
      tags:
      - admin
      summary: Create an access token for the specified user
      operationId: adminCreateUserAccessToken
      parameters:
      - description: username of user
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          $ref: '#/compone

# --- truncated at 32 KB (84 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/forgejo/refs/heads/main/openapi/forgejo-admin-api-openapi.yml