Codeberg Users API

Look up and search users and the authenticated account.

OpenAPI Specification

codeberg-users-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Codeberg API (Forgejo) Git Content Users API
  description: 'Core subset of the Forgejo/Gitea-compatible REST API exposed by Codeberg, the community-run non-profit Git hosting platform, at https://codeberg.org/api/v1. Codeberg runs Forgejo (a community fork of Gitea); the reported application version at review time was 15.0.0-209+gitea-1.22.0. This document captures the core repository, issue, pull request, release, Git content, user, and organization paths. It is a representative subset - the full, authoritative machine-readable specification is served live by Codeberg at https://codeberg.org/swagger.v1.json (interactive UI at https://codeberg.org/api/swagger). Authenticate with a personal access token sent as `Authorization: token YOUR_TOKEN`, or via OAuth2.'
  version: 15.0.0
  contact:
    name: Codeberg
    url: https://codeberg.org
  license:
    name: MIT (Forgejo software)
    url: https://forgejo.org/
servers:
- url: https://codeberg.org/api/v1
  description: Codeberg production
security:
- AuthorizationHeaderToken: []
tags:
- name: Users
  description: Look up and search users and the authenticated account.
paths:
  /user:
    get:
      operationId: userGetCurrent
      tags:
      - Users
      summary: Get the authenticated user
      responses:
        '200':
          description: The authenticated user.
  /users/search:
    get:
      operationId: userSearch
      tags:
      - Users
      summary: Search for users
      parameters:
      - name: q
        in: query
        description: Keyword to search for.
        schema:
          type: string
      responses:
        '200':
          description: A list of matching users.
  /users/{username}:
    get:
      operationId: userGet
      tags:
      - Users
      summary: Get a user
      parameters:
      - name: username
        in: path
        required: true
        description: Username of the user to get.
        schema:
          type: string
      responses:
        '200':
          description: The requested user.
  /users/{username}/repos:
    get:
      operationId: userListRepos
      tags:
      - Users
      summary: List the repos owned by the given user
      parameters:
      - name: username
        in: path
        required: true
        description: Username of the user.
        schema:
          type: string
      responses:
        '200':
          description: A list of repositories.
components:
  securitySchemes:
    AuthorizationHeaderToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Personal access token. Must be prepended with the word "token" followed by a space, e.g. `Authorization: token YOUR_TOKEN`.'