gitora.devGitora.dev documentation
Menu

Username

These endpoints serve Gitora.dev's own apps: the web, desktop and mobile apps call them to choose and change a username. They answer other clients the same way, but they are not part of the /api/v1 API, and their answers have the shape Gitora.dev's sign-in uses: { "code": "…", "message": "…" } when refused.

Change your username

POST /api/auth/change-username

Serves Gitora.dev's own apps. Changes the username of the signed-in account. What happens to the old name and address is in Profiles.

AudienceGitora.dev's web, desktop and mobile apps
CredentialsA browser session, or an app session as Authorization: Bearer. A personal access token is never accepted
Token permissionNone: tokens are refused
Recently confirmed sessionNeeded: the session must have signed in within the last 10 minutes
LimitsOne change every 30 days; a change of capitals only is not counted

Body

KeyTypeDescription
usernamestringThe new username: 1 to 39 letters, digits or single hyphens, not starting or ending with a hyphen. Spaces around it are removed

The new username can be any valid name that nobody holds, or a name this account had before. Changing only its capitals, such as ada to Ada, is always possible: it claims no name, sends no email and does not start the 30 days.

Answer

200 OK:

KeyTypeDescription
usernamestringThe username, in the capitals it was sent in

The account's sessions, personal access tokens, sign-in methods, display name and avatar do not change. The account's email address receives a notice naming the old and new usernames.

Errors

StatusCodeWhen
400username_invalidThe username breaks the format rules
400username_reservedGitora.dev uses that name, or it belonged to a deleted account
400username_takenAnother account or an organization holds that name, now or before
401unauthenticatedNo session, or a personal access token
403reconfirm_requiredThe session signed in more than 10 minutes ago
409username_change_too_soonThe username changed less than 30 days ago; retryAt says when it can change again

When two requests ask for the same free name at the same moment, one gets it and the other gets username_taken.

Example

POST /api/auth/change-username
Authorization: Bearer <app session>
Content-Type: application/json

{ "username": "Countess" }
{ "username": "Countess" }

Within 30 days of the last change:

{
  "code": "username_change_too_soon",
  "message": "username_change_too_soon",
  "retryAt": "2026-12-26T09:05:00.000Z"
}

Check whether a username is free

POST /api/auth/is-username-available

Serves Gitora.dev's own apps, which call it while a username is typed. The answer is a hint: the name is checked again when it is claimed.

AudienceGitora.dev's web, desktop and mobile apps
CredentialsNone needed. With a session, the account's own earlier usernames are free
Token permissionNone: tokens are not used
Recently confirmed sessionNot needed
LimitsNone of its own

Body

KeyTypeDescription
usernamestringThe name to check

Answer

200 OK, with available: true when the name can be claimed, false when someone holds it.

{ "available": true }

The account's own current username in other capitals answers false: change its capitals with Change your username, which accepts it.

Errors

StatusCodeWhen
400username_invalidThe name breaks the format rules
400username_reservedGitora.dev uses that name, or it belonged to a deleted account

Choose a username after signing up with GitHub or Google

POST /api/auth/update-user

Serves Gitora.dev's own apps. An account created with GitHub or Google chooses its username once, with this endpoint. Every later change goes through Change your username.

AudienceGitora.dev's web, desktop and mobile apps
CredentialsA browser session, or an app session as Authorization: Bearer
Token permissionNone: tokens are refused
Recently confirmed sessionNot needed
LimitsNone of its own

Body

KeyTypeDescription
usernamestringThe username, with the same rules as for Change your username

Any other key is refused, and nothing changes.

Answer

200 OK. The account's username is set, and its profile exists from then on.

Errors

StatusCodeWhen
400username_invalid, username_reserved, username_takenAs for Change your username
400USERNAME_IS_IMMUTABLEThe account already has a username
400FIELD_NOT_ALLOWEDThe body has a key other than username
401unauthenticatedNo session