Gogs Users API

Search users, manage access tokens, emails, followers, and public keys

Operations 21

GET /users/search Search for users #
GET /users/{username} Get a single user #
GET /user Get the authenticated user #
GET /users/{username}/tokens List access tokens #
POST /users/{username}/tokens Create an access token #
GET /user/emails List email addresses #
POST /user/emails Add email addresses #
DELETE /user/emails Delete email addresses #
GET /users/{username}/followers List followers of a user #
GET /user/followers List your followers #
GET /users/{username}/following List users followed by a user #
GET /user/following List who you are following #
GET /user/following/{target} Check if you follow a user #
PUT /user/following/{target} Follow a user #
DELETE /user/following/{target} Unfollow a user #
GET /users/{username}/following/{target} Check if a user follows another #
GET /users/{username}/keys List public keys for a user #
GET /user/keys/{id} Get a single public key #
DELETE /user/keys/{id} Delete a public key #
GET /user/keys List your public keys #
POST /user/keys Create a public key #

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/gogs-users-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

gogs-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gogs Users API
  version: v1
  description: RESTful API for interacting with your Gogs instance. Follows a format similar to the GitHub REST API v3.
servers:
- url: https://gogs.example.com/api/v1
security:
- AccessToken: []
tags:
- name: Users
  description: Search users, manage access tokens, emails, followers, and public keys
paths:
  /users/search:
    get:
      operationId: searchUsers
      summary: Search for users
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  ok:
                    type: boolean
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
        description: Keyword of username
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 10
        description: Max results
      description: Requests without authentication will return an empty email field for anti-spam purposes.
  /users/{username}:
    get:
      operationId: getUser
      summary: Get a single user
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: Resource not found.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
  /user:
    get:
      operationId: getAuthenticatedUser
      summary: Get the authenticated user
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
  /users/{username}/tokens:
    get:
      operationId: listAccessTokens
      summary: List access tokens
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccessToken'
        '404':
          description: Resource not found.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
      security:
      - BasicAuth: []
      description: Requires basic authentication.
    post:
      operationId: createAccessToken
      summary: Create an access token
      tags:
      - Users
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '404':
          description: Resource not found.
        '422':
          description: Validation error.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
              - name
      security:
      - BasicAuth: []
      description: Requires basic authentication.
  /user/emails:
    get:
      operationId: listEmails
      summary: List email addresses
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Email'
    post:
      operationId: addEmails
      summary: Add email addresses
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Email'
        '422':
          description: Validation error.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    type: string
                    format: email
              required:
              - emails
    delete:
      operationId: deleteEmails
      summary: Delete email addresses
      tags:
      - Users
      responses:
        '204':
          description: The resource has been successfully deleted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    type: string
                    format: email
              required:
              - emails
  /users/{username}/followers:
    get:
      operationId: listUserFollowers
      summary: List followers of a user
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
        '404':
          description: Resource not found.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
  /user/followers:
    get:
      operationId: listMyFollowers
      summary: List your followers
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
  /users/{username}/following:
    get:
      operationId: listUserFollowing
      summary: List users followed by a user
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
        '404':
          description: Resource not found.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
  /user/following:
    get:
      operationId: listMyFollowing
      summary: List who you are following
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
  /user/following/{target}:
    get:
      operationId: checkFollowing
      summary: Check if you follow a user
      tags:
      - Users
      responses:
        '204':
          description: The user is being followed.
        '404':
          description: Not following
      parameters:
      - name: target
        in: path
        required: true
        schema:
          type: string
        description: Target username
    put:
      operationId: followUser
      summary: Follow a user
      tags:
      - Users
      responses:
        '204':
          description: Successfully followed the user.
        '404':
          description: Resource not found.
        '422':
          description: Validation error.
      parameters:
      - name: target
        in: path
        required: true
        schema:
          type: string
        description: Target username
    delete:
      operationId: unfollowUser
      summary: Unfollow a user
      tags:
      - Users
      responses:
        '204':
          description: The resource has been successfully deleted.
        '404':
          description: Resource not found.
      parameters:
      - name: target
        in: path
        required: true
        schema:
          type: string
        description: Target username
  /users/{username}/following/{target}:
    get:
      operationId: checkUserFollowing
      summary: Check if a user follows another
      tags:
      - Users
      responses:
        '204':
          description: The user is being followed.
        '404':
          description: Not following
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
      - name: target
        in: path
        required: true
        schema:
          type: string
        description: Target username
  /users/{username}/keys:
    get:
      operationId: listUserKeys
      summary: List public keys for a user
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublicKey'
        '404':
          description: Resource not found.
      parameters:
      - name: username
        in: path
        required: true
        schema:
          type: string
        description: Username
  /user/keys/{id}:
    get:
      operationId: getPublicKey
      summary: Get a single public key
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKey'
        '404':
          description: Resource not found.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Key ID
    delete:
      operationId: deletePublicKey
      summary: Delete a public key
      tags:
      - Users
      responses:
        '204':
          description: The resource has been successfully deleted.
        '404':
          description: Resource not found.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Key ID
  /user/keys:
    get:
      operationId: listMyKeys
      summary: List your public keys
      tags:
      - Users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublicKey'
    post:
      operationId: createPublicKey
      summary: Create a public key
      tags:
      - Users
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKey'
        '422':
          description: Validation error.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                key:
                  type: string
              required:
              - title
              - key
components:
  schemas:
    PublicKey:
      type: object
      properties:
        id:
          type: integer
        key:
          type: string
        url:
          type: string
        title:
          type: string
        created_at:
          type: string
          format: date-time
    Email:
      type: object
      properties:
        email:
          type: string
          format: email
        verified:
          type: boolean
        primary:
          type: boolean
    AccessToken:
      type: object
      properties:
        name:
          type: string
        sha1:
          type: string
    User:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        login:
          type: string
          description: Alias of username for GitHub API compatibility
        full_name:
          type: string
        email:
          type: string
          format: email
        avatar_url:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    AccessToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Personal access token. Use format: token {YOUR_ACCESS_TOKEN}'