Usernames
5 routes. Paths are relative to https://api.intersink.com/v1.
- GET/usernames/availabilityPublic: can this username be taken in the channel? { available, code?, rule?, message }
- GET/usernames/meMy username: whether I can change it now, when next, my held old names, the rules
- POST/usernames/me/drop-suffixDrop the old .NN ending from my username when the plain name is free (apps of auth.opaque channels call this once)
- GET/usernames/policyPublic: the channel's username rules (length, characters, rename cooldown, hold period)
- POST/usernames/renameChange my username (policy, look-alikes, cooldown); the old name is held for me for the channel's hold period
Public: can this username be taken in the channel? { available, code?, rule?, message }
GET/usernames/availability
Public: no sign-in needed.
code: INVALID_USERNAME (with rule), USERNAME_RESERVED, USERNAME_TAKEN (also a name held after a rename) or USERNAME_TOO_SIMILAR (looks like a taken name). When a name is not available, suggestions lists up to three free plain names near it (never with a .NN ending). Signed in, your own held names count as available to you. 30 per minute and 300 per day per network.
Parameters
| Name | Type | Description |
|---|---|---|
| usernamerequired | string, query | The name to check (trimmed and lowercased first) At most 64 characters. |
| shape | string, query | plain (asha.rao) or opaque (for auth.opaque sign-ups: asha, or the older asha.07). Default: opaque when the name ends in a dot and two digits One of: "plain", "opaque". |
| x-ref | string, header | Channel id, when no app key is sent |
Response
200. The payload in data is of type object.
My username: whether I can change it now, when next, my held old names, the rules
GET/usernames/me
Needs a signed-in user (Bearer token or access_token cookie).
rename_prompt is set when one rename without the cooldown is open: reason suffix_taken (the .NN migration could not drop the ending) or digits_not_allowed (the channel turned digits off and the current name has some). The new name must follow the channel's rules.
Parameters
| Name | Type | Description |
|---|---|---|
| profile_id | string, query |
Response
200. The payload in data is not described in the spec yet.
Drop the old .NN ending from my username when the plain name is free (apps of auth.opaque channels call this once)
POST/usernames/me/drop-suffix
Needs a signed-in user (Bearer token or access_token cookie).
Send your current username. If it ends in a dot and two digits and the name without them is free for you, it becomes your username (for 30 days the old one still works for sign-in, mentions and the relay directory lookup) and outcome is renamed. If the plain name is taken, outcome is collision and GET /usernames/me shows rename_prompt with one free rename. outcome kept: there was no ending (recorded, so suffix_check stops asking). Errors: 400 USERNAME_MISMATCH (not your current username).
Request body application/json
| Field | Type | Description |
|---|---|---|
| current_usernamerequired | string | My current username, as I sign in with it (asha.07) At most 64 characters. |
| profile_id | string | Which of my profiles (default: my profile in this channel) |
Response
200. The payload in data is not described in the spec yet.
Public: the channel's username rules (length, characters, rename cooldown, hold period)
GET/usernames/policy
Public: no sign-in needed.
Parameters
| Name | Type | Description |
|---|---|---|
| x-ref | string, header | Channel id, when no app key is sent |
Response
200. The payload in data is not described in the spec yet.
Change my username (policy, look-alikes, cooldown); the old name is held for me for the channel's hold period
POST/usernames/rename
Needs a signed-in user (Bearer token or access_token cookie).
Errors: 400 INVALID_USERNAME (with rule, e.g. no_digits) / USERNAME_RESERVED / USERNAME_UNCHANGED, 409 USERNAME_TAKEN / USERNAME_TOO_SIMILAR, 429 USERNAME_COOLDOWN (next_change_at, retry_after). An auth.opaque account keeps signing in with its password under the new name.
Request body application/json
| Field | Type | Description |
|---|---|---|
| usernamerequired | string | The new username At most 64 characters. |
| profile_id | string | Which of my profiles (default: my profile in this channel) |
Response
200. The payload in data is not described in the spec yet.