Gitea admin API

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

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

OpenAPI Specification

gitea-admin-api-openapi.yml Raw ↑
swagger: '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
basePath: /api/v1
schemes:
- https
- http
consumes:
- application/json
produces:
- application/json
security:
- BasicAuth: []
- Token: []
- AccessToken: []
- AuthorizationHeaderToken: []
- SudoParam: []
- SudoHeader: []
- TOTPHeader: []
tags:
- name: admin
paths:
  /admin/actions/jobs:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Lists all jobs
      operationId: listAdminWorkflowJobs
      parameters:
      - type: string
        description: workflow status (pending, queued, in_progress, failure, success, skipped)
        name: status
        in: query
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/WorkflowJobsList'
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
  /admin/actions/runners:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Get all runners
      operationId: getAdminRunners
      parameters:
      - type: boolean
        description: filter by disabled status (true or false)
        name: disabled
        in: query
      responses:
        '200':
          $ref: '#/responses/RunnerList'
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
  /admin/actions/runners/registration-token:
    post:
      produces:
      - application/json
      tags:
      - admin
      summary: Get a global actions runner registration token
      operationId: adminCreateRunnerRegistrationToken
      responses:
        '200':
          $ref: '#/responses/RegistrationToken'
  /admin/actions/runners/{runner_id}:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Get a global runner
      operationId: getAdminRunner
      parameters:
      - type: string
        description: id of the runner
        name: runner_id
        in: path
        required: true
      responses:
        '200':
          $ref: '#/responses/Runner'
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Delete a global runner
      operationId: deleteAdminRunner
      parameters:
      - type: string
        description: id of the runner
        name: runner_id
        in: path
        required: true
      responses:
        '204':
          description: runner has been deleted
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
    patch:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Update a global runner
      operationId: updateAdminRunner
      parameters:
      - type: string
        description: id of the runner
        name: runner_id
        in: path
        required: true
      - name: body
        in: body
        schema:
          $ref: '#/definitions/EditActionRunnerOption'
      responses:
        '200':
          $ref: '#/responses/Runner'
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
        '422':
          $ref: '#/responses/validationError'
  /admin/actions/runs:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Lists all runs
      operationId: listAdminWorkflowRuns
      parameters:
      - type: string
        description: workflow event name
        name: event
        in: query
      - type: string
        description: workflow branch
        name: branch
        in: query
      - type: string
        description: workflow status (pending, queued, in_progress, failure, success, skipped)
        name: status
        in: query
      - type: string
        description: triggered by user
        name: actor
        in: query
      - type: string
        description: triggering sha of the workflow run
        name: head_sha
        in: query
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/WorkflowRunsList'
        '400':
          $ref: '#/responses/error'
        '404':
          $ref: '#/responses/notFound'
  /admin/cron:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List cron tasks
      operationId: adminCronList
      parameters:
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/CronList'
        '403':
          $ref: '#/responses/forbidden'
  /admin/cron/{task}:
    post:
      produces:
      - application/json
      tags:
      - admin
      summary: Run cron task
      operationId: adminCronRun
      parameters:
      - type: string
        description: task to run
        name: task
        in: path
        required: true
      responses:
        '204':
          $ref: '#/responses/empty'
        '404':
          $ref: '#/responses/notFound'
  /admin/emails:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List all emails
      operationId: adminGetAllEmails
      parameters:
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/EmailList'
        '403':
          $ref: '#/responses/forbidden'
  /admin/emails/search:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Search all emails
      operationId: adminSearchEmails
      parameters:
      - type: string
        description: keyword
        name: q
        in: query
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/EmailList'
        '403':
          $ref: '#/responses/forbidden'
  /admin/hooks:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List system's webhooks
      operationId: adminListHooks
      parameters:
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      - enum:
        - system
        - default
        - all
        type: string
        default: system
        description: system, default or both kinds of webhooks
        name: type
        in: query
      responses:
        '200':
          $ref: '#/responses/HookList'
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Create a hook
      operationId: adminCreateHook
      parameters:
      - name: body
        in: body
        required: true
        schema:
          $ref: '#/definitions/CreateHookOption'
      responses:
        '201':
          $ref: '#/responses/Hook'
  /admin/hooks/{id}:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Get a hook
      operationId: adminGetHook
      parameters:
      - type: integer
        format: int64
        description: id of the hook to get
        name: id
        in: path
        required: true
      responses:
        '200':
          $ref: '#/responses/Hook'
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Delete a hook
      operationId: adminDeleteHook
      parameters:
      - type: integer
        format: int64
        description: id of the hook to delete
        name: id
        in: path
        required: true
      responses:
        '204':
          $ref: '#/responses/empty'
    patch:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Update a hook
      operationId: adminEditHook
      parameters:
      - type: integer
        format: int64
        description: id of the hook to update
        name: id
        in: path
        required: true
      - name: body
        in: body
        schema:
          $ref: '#/definitions/EditHookOption'
      responses:
        '200':
          $ref: '#/responses/Hook'
  /admin/orgs:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List all organizations
      operationId: adminGetAllOrgs
      parameters:
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      responses:
        '200':
          $ref: '#/responses/OrganizationList'
        '403':
          $ref: '#/responses/forbidden'
  /admin/unadopted:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List unadopted repositories
      operationId: adminUnadoptedList
      parameters:
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      - type: string
        description: pattern of repositories to search for
        name: pattern
        in: query
      responses:
        '200':
          $ref: '#/responses/StringSlice'
        '403':
          $ref: '#/responses/forbidden'
  /admin/unadopted/{owner}/{repo}:
    post:
      produces:
      - application/json
      tags:
      - admin
      summary: Adopt unadopted files as a repository
      operationId: adminAdoptRepository
      parameters:
      - type: string
        description: owner of the repo
        name: owner
        in: path
        required: true
      - type: string
        description: name of the repo
        name: repo
        in: path
        required: true
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
        '404':
          $ref: '#/responses/notFound'
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Delete unadopted files
      operationId: adminDeleteUnadoptedRepository
      parameters:
      - type: string
        description: owner of the repo
        name: owner
        in: path
        required: true
      - type: string
        description: name of the repo
        name: repo
        in: path
        required: true
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
  /admin/users:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: Search users according filter conditions
      operationId: adminSearchUsers
      parameters:
      - type: integer
        format: int64
        description: ID of the user's login source to search for
        name: source_id
        in: query
      - type: string
        description: identifier of the user, provided by the external authenticator
        name: login_name
        in: query
      - type: integer
        description: page number of results to return (1-based)
        name: page
        in: query
      - type: integer
        description: page size of results
        name: limit
        in: query
      - type: string
        description: sort users by attribute. Supported values are "name", "created", "updated" and "id". Default is "name"
        name: sort
        in: query
      - type: string
        description: sort order, either "asc" (ascending) or "desc" (descending). Default is "asc", ignored if "sort" is not specified.
        name: order
        in: query
      - type: string
        description: search term (username, full name, email)
        name: q
        in: query
      - type: string
        description: visibility filter. Supported values are "public", "limited" and "private".
        name: visibility
        in: query
      - type: boolean
        description: filter active users
        name: is_active
        in: query
      - type: boolean
        description: filter admin users
        name: is_admin
        in: query
      - type: boolean
        description: filter restricted users
        name: is_restricted
        in: query
      - type: boolean
        description: filter 2FA enabled users
        name: is_2fa_enabled
        in: query
      - type: boolean
        description: filter login prohibited users
        name: is_prohibit_login
        in: query
      responses:
        '200':
          $ref: '#/responses/UserList'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Create a user
      operationId: adminCreateUser
      parameters:
      - name: body
        in: body
        schema:
          $ref: '#/definitions/CreateUserOption'
      responses:
        '201':
          $ref: '#/responses/User'
        '400':
          $ref: '#/responses/error'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}:
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Delete a user
      operationId: adminDeleteUser
      parameters:
      - type: string
        description: username of the user to delete
        name: username
        in: path
        required: true
      - type: boolean
        description: purge the user from the system completely
        name: purge
        in: query
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
        '404':
          $ref: '#/responses/notFound'
        '422':
          $ref: '#/responses/validationError'
    patch:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Edit an existing user
      operationId: adminEditUser
      parameters:
      - type: string
        description: username of the user whose data is to be edited
        name: username
        in: path
        required: true
      - name: body
        in: body
        schema:
          $ref: '#/definitions/EditUserOption'
      responses:
        '200':
          $ref: '#/responses/User'
        '400':
          $ref: '#/responses/error'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}/badges:
    get:
      produces:
      - application/json
      tags:
      - admin
      summary: List a user's badges
      operationId: adminListUserBadges
      parameters:
      - type: string
        description: username of the user whose badges are to be listed
        name: username
        in: path
        required: true
      responses:
        '200':
          $ref: '#/responses/BadgeList'
        '404':
          $ref: '#/responses/notFound'
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Add a badge to a user
      operationId: adminAddUserBadges
      parameters:
      - type: string
        description: username of the user to whom a badge is to be added
        name: username
        in: path
        required: true
      - name: body
        in: body
        schema:
          $ref: '#/definitions/UserBadgeOption'
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Remove a badge from a user
      operationId: adminDeleteUserBadges
      parameters:
      - type: string
        description: username of the user whose badge is to be deleted
        name: username
        in: path
        required: true
      - name: body
        in: body
        schema:
          $ref: '#/definitions/UserBadgeOption'
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}/keys:
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Add a public key on behalf of a user
      operationId: adminCreatePublicKey
      parameters:
      - type: string
        description: username of the user who is to receive a public key
        name: username
        in: path
        required: true
      - name: key
        in: body
        schema:
          $ref: '#/definitions/CreateKeyOption'
      responses:
        '201':
          $ref: '#/responses/PublicKey'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}/keys/{id}:
    delete:
      produces:
      - application/json
      tags:
      - admin
      summary: Delete a user's public key
      operationId: adminDeleteUserPublicKey
      parameters:
      - type: string
        description: username of the user whose public key is to be deleted
        name: username
        in: path
        required: true
      - type: integer
        format: int64
        description: id of the key to delete
        name: id
        in: path
        required: true
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
        '404':
          $ref: '#/responses/notFound'
  /admin/users/{username}/orgs:
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Create an organization
      operationId: adminCreateOrg
      parameters:
      - type: string
        description: username of the user who will own the created organization
        name: username
        in: path
        required: true
      - name: organization
        in: body
        required: true
        schema:
          $ref: '#/definitions/CreateOrgOption'
      responses:
        '201':
          $ref: '#/responses/Organization'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}/rename:
    post:
      produces:
      - application/json
      tags:
      - admin
      summary: Rename a user
      operationId: adminRenameUser
      parameters:
      - type: string
        description: current username of the user
        name: username
        in: path
        required: true
      - name: body
        in: body
        required: true
        schema:
          $ref: '#/definitions/RenameUserOption'
      responses:
        '204':
          $ref: '#/responses/empty'
        '403':
          $ref: '#/responses/forbidden'
        '422':
          $ref: '#/responses/validationError'
  /admin/users/{username}/repos:
    post:
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - admin
      summary: Create a repository on behalf of a user
      operationId: adminCreateRepo
      parameters:
      - type: string
        description: username of the user who will own the created repository
        name: username
        in: path
        required: true
      - name: repository
        in: body
        required: true
        schema:
          $ref: '#/definitions/CreateRepoOption'
      responses:
        '201':
          $ref: '#/responses/Repository'
        '400':
          $ref: '#/responses/error'
        '403':
          $ref: '#/responses/forbidden'
        '404':
          $ref: '#/responses/notFound'
        '409':
          $ref: '#/responses/error'
        '422':
          $ref: '#/responses/validationError'
definitions:
  UserBadgeOption:
    description: UserBadgeOption options for link between users and badges
    type: object
    properties:
      badge_slugs:
        type: array
        items:
          type: string
        x-go-name: BadgeSlugs
        example:
        - badge1
        - badge2
    x-go-package: code.gitea.io/gitea/modules/structs
  ActionRunnersResponse:
    description: ActionRunnersResponse returns Runners
    type: object
    properties:
      runners:
        type: array
        items:
          $ref: '#/definitions/ActionRunner'
        x-go-name: Entries
      total_count:
        type: integer
        format: int64
        x-go-name: TotalCount
    x-go-package: code.gitea.io/gitea/modules/structs
  ActionRunner:
    description: ActionRunner represents a Runner
    type: object
    properties:
      busy:
        type: boolean
        x-go-name: Busy
      disabled:
        type: boolean
        x-go-name: Disabled
      ephemeral:
        type: boolean
        x-go-name: Ephemeral
      id:
        type: integer
        format: int64
        x-go-name: ID
      labels:
        type: array
        items:
          $ref: '#/definitions/ActionRunnerLabel'
        x-go-name: Labels
      name:
        type: string
        x-go-name: Name
      status:
        type: string
        x-go-name: Status
    x-go-package: code.gitea.io/gitea/modules/structs
  CreateHookOption:
    description: CreateHookOption options when create a hook
    type: object
    required:
    - type
    - config
    properties:
      active:
        type: boolean
        default: false
        x-go-name: Active
      authorization_header:
        description: Authorization header to include in webhook requests
        type: string
        x-go-name: AuthorizationHeader
      branch_filter:
        description: Branch filter pattern to determine which branches trigger the webhook
        type: string
        x-go-name: BranchFilter
      config:
        $ref: '#/definitions/CreateHookOptionConfig'
      events:
        description: List of events that will trigger this webhook
        type: array
        items:
          type: string
        x-go-name: Events
      name:
        description: Optional human-readable name for the webhook
        type: string
        x-go-name: Name
      type:
        type: string
        enum:
        - dingtalk
        - discord
        - gitea
        - gogs
        - msteams
        - slack
        - telegram
        - feishu
        - wechatwork
        - packagist
        x-go-name: Type
    x-go-package: code.gitea.io/gitea/modules/structs
  PublicKey:
    description: PublicKey publickey is a user key to push code to repository
    type: object
    properties:
      created_at:
        type: string
        format: date-time
        x-go-name: Created
      fingerprint:
        description: Fingerprint is the key's fingerprint
        type: string
        x-go-name: Fingerprint
      id:
        description: ID is the unique identifier for the public key
        type: integer
        format: int64
        x-go-name: ID
      key:
        description: Key contains the actual SSH public key content
        type: string
        x-go-name: Key
      key_type:
        description: KeyType indicates the type of the SSH key
        type: string
        x-go-name: KeyType
      last_used_at:
        description: Updated is the time when the key was last used
        type: string
        format: date-time
        x-go-name: Updated
      read_only:
        description: ReadOnly indicates if the key has read-only access
        type: boolean
        x-go-name: ReadOnly
      title:
        description: Title is the human-readable name for the key
        type: string
        x-go-name: Title
      url:
        description: URL is the API URL for this key
        type: string
        x-go-name: URL
      user:
        $ref: '#/definitions/User'
    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
  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
  Email:
    description: Email an email address belonging to a user
    type: object
    properties:
      email:
        type: string
        format: email
        x-go-name: Email
      primary:
        description: Whether this is the primary email address
        type: boolean
        x-go-name: Primary
      user_id:
        description: The unique identifier of the user who owns this email
        type: integer
        format: int64
        x-go-name: UserID
      username:
        description: username of the user
        type: string
        x-go-name: UserName
      verified:
        description: Whether the email address has been verified
        type: boolean
        x-go-name: Verified
    x-go-package: code.gitea.io/gitea/modules/structs
  ActionWorkflowJobsResponse:
    description: ActionWorkflowJobsResponse returns ActionWorkflowJobs
    type: object
    properties:
      jobs:
        type: array
        items:
          $ref: '#/definitions/ActionWorkflowJob'
        x-go-name: Entries
      total_count:
        type: integer
        format: int64
        x-go-name: TotalCount
    x-go-package: code.gitea.io/gitea/modules/structs
  Cron:
    description: Cron represents a Cron task
    type: object
    properties:
      exec_times:
        description: The total number of times this cron task has been executed
        type: integer
        format: int64
        x-go-name: ExecTimes
      name:
        description: The name of the cron task
        type: string
        x-go-name: Name
      next:
        description: The next scheduled execution time
        type: string
        format: date-time
        x-go-name: Next
      prev:
        description: The previous execution time
        type: string
        format: date-time
        x-go-name: Prev
      schedule:
        description: The cron schedule expression (e.g., "0 0 * * *")
        type: string
        x-go-name: Schedule
    x-go-package: code.gitea.io/gitea/modules/structs
  Hook:
    description: Hook a hook is a web hook when one repository changed
    type: object
    properties:
      active:
        description: Whether the webhook is active and will be triggered
        type: boolean
        x-go-name: Active
      authorization_header:
        description: Authorization header to include in webhook requests
        type: string
        x-go-name: AuthorizationHeader
      branch_filter:
        description: Branch filter pattern to determine which branches trigger the webhook
        type: string
        x-go-name: BranchFilter
      config:
        description: Configuration settings for the webhook
        type: object
        additionalProperties:
          type: string
        x-go-name: Config
      created_at:
        type: string
        format: date-time
        x-go-name: Created
      events:
        description: List of events that trigger this webhook
        type: array
        items:
          type: string
        x-go-name: Events
      id:
        description: The unique identifier of the webhook
        type: integer
        format: int64
        x-go-name: ID
      name:
        description: Optional human-readable name for the webhook
        type: string
        x-go-name: Name
      type:
        description: The type of the webhook (e.g., gitea, slack, discord)
        type: string
        x-go-name: Type
      updated_at:
        type: string
        format: date-time
        x-go-name: Updated
    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
  CreateOrgOption:
    description: CreateOrgOption options for creating an organization
    type: object
    required:
    - username
    properties:
      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
      location:
        description: The location of the organization
        type: string
        x-go-name: Location
      repo_admin_change_team_access:
        description: Whether repository administrators can change team ac

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