Gitea admin API

The admin API from Gitea — 22 operation(s) for admin.

Operations 32

GET /admin/actions/jobs Lists all jobs #
GET /admin/actions/runners Get all runners #
POST /admin/actions/runners/registration-token Get a global actions runner registration token #
GET /admin/actions/runners/{runner_id} Get a global runner #
DELETE /admin/actions/runners/{runner_id} Delete a global runner #
PATCH /admin/actions/runners/{runner_id} Update a global runner #
GET /admin/actions/runs Lists all runs #
GET /admin/cron List cron tasks #
POST /admin/cron/{task} Run cron task #
GET /admin/emails List all emails #
GET /admin/emails/search Search all emails #
GET /admin/hooks List system's 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/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 #
DELETE /admin/users/{username} Delete a user #
PATCH /admin/users/{username} Edit an existing user #
GET /admin/users/{username}/badges List a user's badges #
POST /admin/users/{username}/badges Add a badge to a user #
DELETE /admin/users/{username}/badges Remove a badge from a user #
POST /admin/users/{username}/keys Add a public key on behalf of a user #
DELETE /admin/users/{username}/keys/{id} Delete a user's public key #
POST /admin/users/{username}/orgs Create an organization #
POST /admin/users/{username}/rename Rename a user #
POST /admin/users/{username}/repos Create a repository on behalf of a user #

Documentation

Specifications

Code Examples

💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-repo-get-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-repo-update-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-issues-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-issue-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-pulls-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-pull-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-branches-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-commits-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-release-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-webhook-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-org-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-org-repos-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-user-get-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-user-repo-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-admin-user-create-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-notifications-list-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-packages-list-owner-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-repository-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-issue-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-pullrequest-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-release-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-hook-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/examples/gitea-rest-api-package-example.json

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-repository-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-issue-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-pullrequest-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-branch-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-commit-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-release-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-hook-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-organization-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-team-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-user-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-notificationthread-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-package-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-label-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-milestone-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-tag-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-schema/gitea-rest-api-comment-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-repository-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-issue-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-pullrequest-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-branch-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-commit-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-release-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-hook-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-organization-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-team-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-user-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-notificationthread-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-package-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-label-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-milestone-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-tag-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/gitea/refs/heads/main/json-structure/gitea-rest-api-comment-structure.json

Other Resources

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/gitea-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

gitea-admin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: This documentation describes the Gitea API.
  title: Gitea Admin API
  license:
    name: MIT
    url: http://opensource.org/licenses/MIT
  version: 1.27.0+dev-89-gf52b6f3315
servers:
- url: /api/v1
security:
- BasicAuth: []
- Token: []
- AccessToken: []
- AuthorizationHeaderToken: []
- SudoParam: []
- SudoHeader: []
- TOTPHeader: []
tags:
- name: admin
paths:
  /admin/actions/jobs:
    get:
      tags:
      - admin
      summary: Lists all jobs
      operationId: listAdminWorkflowJobs
      parameters:
      - description: workflow status (pending, queued, in_progress, failure, success, skipped)
        name: status
        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/WorkflowJobsList'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/actions/runners:
    get:
      tags:
      - admin
      summary: Get all runners
      operationId: getAdminRunners
      parameters:
      - description: filter by disabled status (true or false)
        name: disabled
        in: query
        schema:
          type: boolean
      responses:
        '200':
          $ref: '#/components/responses/RunnerList'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
  /admin/actions/runners/registration-token:
    post:
      tags:
      - admin
      summary: Get a global actions runner registration token
      operationId: adminCreateRunnerRegistrationToken
      responses:
        '200':
          $ref: '#/components/responses/RegistrationToken'
  /admin/actions/runners/{runner_id}:
    get:
      tags:
      - admin
      summary: Get a global runner
      operationId: getAdminRunner
      parameters:
      - description: id of the runner
        name: runner_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/Runner'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
    delete:
      tags:
      - admin
      summary: Delete a global runner
      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'
    patch:
      tags:
      - admin
      summary: Update a global runner
      operationId: updateAdminRunner
      parameters:
      - description: id of the runner
        name: runner_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/Runner'
        '400':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/notFound'
        '422':
          $ref: '#/components/responses/validationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditActionRunnerOption'
  /admin/actions/runs:
    get:
      tags:
      - admin
      summary: Lists all runs
      operationId: listAdminWorkflowRuns
      parameters:
      - description: workflow event name
        name: event
        in: query
        schema:
          type: string
      - description: workflow branch
        name: branch
        in: query
        schema:
          type: string
      - description: workflow status (pending, queued, in_progress, failure, success, skipped)
        name: status
        in: query
        schema:
          type: string
      - description: triggered by user
        name: actor
        in: query
        schema:
          type: string
      - description: triggering sha of the workflow run
        name: head_sha
        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/WorkflowRunsList'
        '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 emails
      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 all emails
      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 system's 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
      - description: system, default or both kinds of webhooks
        name: type
        in: query
        schema:
          type: string
          enum:
          - system
          - default
          - all
          default: system
      responses:
        '200':
          $ref: '#/components/responses/HookList'
    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/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: identifier of the user, provided by the external authenticator
        name: login_name
        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
      - description: sort users by attribute. Supported values are "name", "created", "updated" and "id". Default is "name"
        name: sort
        in: query
        schema:
          type: string
      - description: sort order, either "asc" (ascending) or "desc" (descending). Default is "asc", ignored if "sort" is not specified.
        name: order
        in: query
        schema:
          type: string
      - description: search term (username, full name, email)
        name: q
        in: query
        schema:
          type: string
      - description: visibility filter. Supported values are "public", "limited" and "private".
        name: visibility
        in: query
        schema:
          type: string
      - description: filter active users
        name: is_active
        in: query
        schema:
          type: boolean
      - description: filter admin users
        name: is_admin
        in: query
        schema:
          type: boolean
      - description: filter restricted users
        name: is_restricted
        in: query
        schema:
          type: boolean
      - description: filter 2FA enabled users
        name: is_2fa_enabled
        in: query
        schema:
          type: boolean
      - description: filter login prohibited users
        name: is_prohibit_login
        in: query
        schema:
          type: boolean
      responses:
        '200':
          $ref: '#/components/responses/UserList'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validationError'
    post:
      tags:
      - admin
      summary: Create a user
      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 a user
      operationId: adminDeleteUser
      parameters:
      - description: username of the 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 the user whose data is to be edited
        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}/badges:
    get:
      tags:
      - admin
      summary: List a user's badges
      operationId: adminListUserBadges
      parameters:
      - description: username of the user whose badges are to be listed
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/BadgeList'
        '404':
          $ref: '#/components/responses/notFound'
    post:
      tags:
      - admin
      summary: Add a badge to a user
      operationId: adminAddUserBadges
      parameters:
      - description: username of the user to whom a badge is to be added
        name: username
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          $ref: '#/components/responses/empty'
        '403':
          $ref: '#/components/responses/forbidden'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserBadgeOption'
    delete:
      tags:
      - admin
      summary: Remove a badge from a user
      operationId: adminDeleteUserBadges
      parameters:
      - description: username of the user whose badge is to be deleted
        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/UserBadgeOption'
  /admin/users/{username}/keys:
    post:
      tags:
      - admin
      summary: Add a public key on behalf of a user
      operationId: adminCreatePublicKey
      parameters:
      - description: username of the user who is to receive a public key
        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: Delete a user's public key
      operationId: adminDeleteUserPublicKey
      parameters:
      - description: username of the user whose public key is to be deleted
        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 who 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}/rename:
    post:
      tags:
      - admin
      summary: Rename a user
      operationId: adminRenameUser
      parameters:
      - description: current username of the 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'
        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 who 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
components:
  schemas:
    RepoTransfer:
      description: RepoTransfer represents a pending repo transfer
      type: object
      properties:
        doer:
          $ref: '#/components/schemas/User'
        recipient:
          $ref: '#/components/schemas/User'
        teams:
          type: array
          items:
            $ref: '#/components/schemas/Team'
          x-go-name: Teams
      x-go-package: code.gitea.io/gitea/modules/structs
    EditUserOption:
      description: EditUserOption edit user options
      type: object
      required:
      - source_id
      - login_name
      properties:
        active:
          description: Whether the user account is active
          type: boolean
          x-go-name: Active
        admin:
          description: Whether the user has administrator privileges
          type: boolean
          x-go-name: Admin
        allow_create_organization:
          description: Whether the user can create organizations
          type: boolean
          x-go-name: AllowCreateOrganization
        allow_git_hook:
          description: Whether the user can use Git hooks
          type: boolean
          x-go-name: AllowGitHook
        allow_import_local:
          description: Whether the user can import local repositories
          type: boolean
          x-go-name: AllowImportLocal
        description:
          description: The user's personal description or bio
          type: string
          x-go-name: Description
        email:
          type: string
          format: email
          x-go-name: Email
        full_name:
          description: The full display name of the user
          type: string
          x-go-name: FullName
        location:
          description: The user's location or address
          type: string
          x-go-name: Location
        login_name:
          description: identifier of the user, provided by the external authenticator (if configured)
          type: string
          default: empty
          x-go-name: LoginName
        max_repo_creation:
          description: Maximum number of repositories the user can create
          type: integer
          format: int64
          x-go-name: MaxRepoCreation
        must_change_password:
          description: Whether the user must change password on next login
          type: boolean
          x-go-name: MustChangePassword
        password:
          description: The plain text password for the user
          type: string
          x-go-name: Password
        prohibit_login:
          description: Whether the user is prohibited from logging in
          type: boolean
          x-go-name: ProhibitLogin
        restricted:
          description: Whether the user has restricted access privileges
          type: boolean
          x-go-name: Restricted
        source_id:
          type: integer
          format: int64
          x-go-name: SourceID
        visibility:
          description: 'User visibility level: public, limited, or private'
          type: string
          x-go-name: Visibility
        website:
          description: The user's personal website URL
          type: string
          x-go-name: Website
      x-go-package: code.gitea.io/gitea/modules/structs
    Organization:
      description: Organization represents an organization
      type: object
      properties:
        avatar_url:
          description: The URL of the organization's avatar
          type: string
          x-go-name: AvatarURL
        description:
          description: The description of the organization
          type: string
          x-go-name: Description
        email:
          description: The email address of the organization
          type: string
          x-go-name: Email
        full_name:
          description: The full display name of the organization
          type: string
          x-go-name: FullName
        id:
          description: The unique identifier of the organization
          type: integer
          format: int64
          x-go-name: ID
        location:
          description: The location of the organization
          type: string
          x-go-name: Location
        name:
          description: The name of the organization
          type: string
          x-go-name: Name
        repo_admin_change_team_access:
          description: Whether repository administrators can change team access
          type: boolean
          x-go-name: RepoAdminChangeTeamAccess
        username:
          description: 'username of the organization

            deprecated'
          type: string
          x-go-name: UserName
        visibility:
          description: The visibility level of the organization (public, limited, private)
          type: string
          x-go-name: Visibility
        website:
          description: The website URL of the organization
          type: string
          x-go-name: Website
      x-go-package: code.gitea.io/gitea/modules/structs
    ActionWorkflowRun:
      description: ActionWorkflowRun represents a WorkflowRun
      type: object
      properties:
        actor:
          $ref: '#/components/schemas/User'
        completed_at:
          type: string
          format: date-time
          x-go-name: CompletedAt
        conclusion:
          type: string
          x-go-name: Conclusion
        display_title:
          type: string
          x-go-name: DisplayTitle
        event:
          type: string
          x-go-name: Event
        head_branch:
          type: string
          x-go-name: HeadBranch
        head_repository:
          $ref: '#/components/schemas/Repository'
        head_sha:
          type: string
          x-go-name: HeadSha
        html_url:
          type: string
          x-go-name: HTMLURL
        id:
          type: integer
          format: int64
          x-go-name: ID
        path:
          type: string
          x-go-name: Path
        repository:
          $ref: '#/components/schemas/Repository'
        repository_id:
          type: integer
          format: int64
          x-go-name: RepositoryID
        run_attempt:
          type: integer
          format: int64
          x-go-name: RunAttempt
        run_number:
          type: integer
          format: int64
          x-go-name: RunNumber
        started_at:
          type: string
          format: date-time
          x-go-name: StartedAt
        status:
          type: string
          x-go-name: Status
        trigger_actor:
          $ref: '#/components/schemas/User'
        url:
          type: string
          x-go-name: URL
      x-go-package: code.gitea.io/gitea/modules/structs
    User:
      description: User represents a user
      type: object
      properties:
        active:
          description: Is user active
          type: boolean
          x-go-name: IsActive
        avatar_url:
          description: URL to the user's avatar
          type: string
          x-go-name: AvatarURL
        created:
          type: string
          format: date-time
          x-go-name: Created
        description:
          description: the user's description
          type: string
          x-go-name: Description
        email:
          type: string
          format: email
          x-go-name: Email
        followers_count:
          description: user counts
          type: integer
          format: int64
          x-go-name: Followers
        following_count:
          type: integer
          format: int64
          x-go-name: Following
        full_name:
          description: the user's full name
          type: string
          x-go-name: FullName
        html_url:
          description: URL to the user's gitea page
          type: string
          x-go-name: HTMLURL
        id:
          description: the user's id
          type: integer
          format: int64
          x-go-name: ID
        is_admin:
          description: Is the user an administrator
          type: boolean
          x-go-name: IsAdmin
        language:
          description: User locale
          type: string
          x-go-name: Language
        last_login:
          type: string
          format: date-time
          x-go-name: LastLogin
        location:
          description: the user's location
          type: string
          x-go-name: Location
        login:
          description: login of the user, same as `username`
          type: string
          x-go-name: UserName
        login_name:
          description: identifier of the user, provided by the external authenticator (if configured)
          type: string
          default: empty
          x-go-name: LoginName
        prohibit_login:
          description: Is user login prohibited
          type: boolean
          x-go-name: ProhibitLogin
        restricted:
          description: Is user restricted
          type: boolean
          x-go-name: Restricted
        source_id:
          description: The ID of the user's Authentication Source
          type: integer
          format: int64
          x-go-name: SourceID
        starred_repos_count:
          type: integer
          format: int64
          x-go-name: StarredRepos
        visibility:
          description: 'User visibility level option: public, limited, private'
          type: string
          x-go-name: Visibility
        website:
          description: the user's website
          type: string
          x-go-name: Website
      x-go-package: code.gitea.io/gitea/modules/structs
    ActionRunnerLabel:
      description: ActionRunnerLabel represents a Runner Label
      type: object
      properties:
        id:
          type: integer
          format: int64
          x-go-name: ID
        name:
          type: string
          x-go-name: Name
        type:
          type: string
          x-go-name: Type
      x-go-package: code.gitea.io/gitea/modules/structs
    RenameUserOption:
      description: RenameUserOption options when renaming a user
      type: object
      required:
      - new_username
      properties:
        new_username:
          description: New username for this user. This name cannot be in use yet by any other user.
          type: string
          uniqueItems: true
          x-go-name: NewName
      x-go-package: code.gitea.io/gitea/modules/structs
    Repository:
      description: Repository represents a repository
      type: object
      properties:
        allow_fast_forward_only_merge:
          type: boolean
          x-go-name: AllowFastForwardOnly
        allow_manual_merge:
          type: boolean
          x-go-name: AllowManualMerge
        allow_merge_commits:
          type: boolean
          x-go-name: AllowMerge
        allow_rebase:
          type: boolean
          x-go-name: AllowRebase
        allow_rebase_explicit:
          type: boolean
          x-go-name: AllowRebaseMerge
        allow_rebase_update:
          type: boolean
          x-go-name: AllowRebaseUpdate
        allow_squash_merge:
         

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