Skip to main content
The Users API provides endpoints to retrieve user information, manage user relationships, and handle user authentication data.

User Object

The User object represents a user account in Gitea.
integer
required
The unique identifier of the user
string
required
The username of the user (also available as username)
string
Identifier provided by external authenticator (if configured)
integer
The ID of the user’s authentication source
string
The user’s full name
string
The user’s email address
string
URL to the user’s avatar
string
URL to the user’s Gitea profile page
string
User’s preferred language
boolean
Whether the user is an administrator
string
Timestamp of the user’s last login
string
Timestamp when the user account was created
boolean
Whether the user is restricted
boolean
Whether the user account is active
boolean
Whether the user is prohibited from logging in
string
The user’s location
string
The user’s website URL
string
The user’s description/bio
string
User visibility level: public, limited, or private
integer
Number of users following this user
integer
Number of users this user is following
integer
Number of repositories starred by this user

Search Users

GET /users/search

Search for users by keyword

Query Parameters

string
Search keyword
integer
ID of the user to search for
integer
Page number of results to return (1-based)
integer
Page size of results

Example Request

Response

Get a User

GET /users/{username}

Get information about a specific user

Path Parameters

string
required
The username of the user to retrieve

Example Request

Response

Get Authenticated User

GET /user

Get information about the currently authenticated user

Example Request

Response

Returns a User object for the authenticated user.

User Heatmap

GET /users/{username}/heatmap

Get a user’s contribution heatmap data

Path Parameters

string
required
The username of the user

Example Request

Response

Returns an array of contribution data points with timestamps and contribution counts.

Followers & Following

List Followers

Get a user’s followers

List Following

Get users a user is following

Follow User

Follow a user

Unfollow User

Unfollow a user

List Followers

GET /users/{username}/followers

List all users following the specified user

Path Parameters

string
required
The username of the user

Query Parameters

integer
Page number of results to return (1-based)
integer
Page size of results

Example Request

List Following

GET /users/{username}/following

List all users that the specified user is following

Path Parameters

string
required
The username of the user

Query Parameters

integer
Page number of results to return (1-based)
integer
Page size of results

Example Request

Check Following Status

GET /users/{username}/following/{target}

Check if one user is following another

Path Parameters

string
required
The username of the following user
string
required
The username of the followed user

Example Request

Returns 204 No Content if following, 404 Not Found otherwise.

Follow User

PUT /user/following/{username}

Follow a user (requires authentication)

Path Parameters

string
required
The username of the user to follow

Example Request

Unfollow User

DELETE /user/following/{username}

Unfollow a user (requires authentication)

Path Parameters

string
required
The username of the user to unfollow

Example Request

Authenticated User Endpoints

List My Followers

GET /user/followers

List all users following the authenticated user

List My Following

GET /user/following

List all users that the authenticated user is following

Check My Following

GET /user/following/{username}

Check if the authenticated user is following a specific user

SSH Keys

List Keys

Get a user’s SSH keys

Get Key

Get a specific SSH key

Add Key

Add a new SSH key

Delete Key

Remove an SSH key

List SSH Keys

GET /users/{username}/keys

List all public SSH keys for a user

Path Parameters

string
required
The username of the user

Query Parameters

string
Filter by SSH key fingerprint
integer
Page number of results to return (1-based)
integer
Page size of results

Example Request

List My SSH Keys

GET /user/keys

List all SSH keys for the authenticated user

Get SSH Key

GET /user/keys/{id}

Get details about a specific SSH key

Path Parameters

integer
required
The ID of the SSH key

Example Request

Add SSH Key

POST /user/keys

Add a new SSH key for the authenticated user

Request Body

string
required
The title/name for this SSH key
string
required
The SSH public key content

Example Request

Delete SSH Key

DELETE /user/keys/{id}

Delete an SSH key

Path Parameters

integer
required
The ID of the SSH key to delete

Example Request

Activity Feeds

GET /users/{username}/activities/feeds

List a user’s activity feeds

Path Parameters

string
required
The username of the user

Query Parameters

boolean
default:"false"
If true, only show actions performed by the user
string
The date of the activities to be found (format: YYYY-MM-DD)
integer
Page number of results to return (1-based)
integer
Page size of results

Example Request

For more user-related endpoints, see: