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-usernameServes Gitora.dev's own apps. Changes the username of the signed-in account. What happens to the old name and address is in Profiles.
| Audience | Gitora.dev's web, desktop and mobile apps |
| Credentials | A browser session, or an app session as Authorization: Bearer. A personal access token is never accepted |
| Token permission | None: tokens are refused |
| Recently confirmed session | Needed: the session must have signed in within the last 10 minutes |
| Limits | One change every 30 days; a change of capitals only is not counted |
Body
| Key | Type | Description |
|---|---|---|
username | string | The 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:
| Key | Type | Description |
|---|---|---|
username | string | The 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
| Status | Code | When |
|---|---|---|
400 | username_invalid | The username breaks the format rules |
400 | username_reserved | Gitora.dev uses that name, or it belonged to a deleted account |
400 | username_taken | Another account or an organization holds that name, now or before |
401 | unauthenticated | No session, or a personal access token |
403 | reconfirm_required | The session signed in more than 10 minutes ago |
409 | username_change_too_soon | The 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-availableServes 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.
| Audience | Gitora.dev's web, desktop and mobile apps |
| Credentials | None needed. With a session, the account's own earlier usernames are free |
| Token permission | None: tokens are not used |
| Recently confirmed session | Not needed |
| Limits | None of its own |
Body
| Key | Type | Description |
|---|---|---|
username | string | The 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
| Status | Code | When |
|---|---|---|
400 | username_invalid | The name breaks the format rules |
400 | username_reserved | Gitora.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-userServes 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.
| Audience | Gitora.dev's web, desktop and mobile apps |
| Credentials | A browser session, or an app session as Authorization: Bearer |
| Token permission | None: tokens are refused |
| Recently confirmed session | Not needed |
| Limits | None of its own |
Body
| Key | Type | Description |
|---|---|---|
username | string | The 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
| Status | Code | When |
|---|---|---|
400 | username_invalid, username_reserved, username_taken | As for Change your username |
400 | USERNAME_IS_IMMUTABLE | The account already has a username |
400 | FIELD_NOT_ALLOWED | The body has a key other than username |
401 | unauthenticated | No session |
