Update display name, username, or visibility.
PATCH
/v1/account/profile
const url = 'https://api.share2.us/v1/account/profile';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"display_name":"example","username":"example","visibility":"public"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.share2.us/v1/account/profile \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "display_name": "example", "username": "example", "visibility": "public" }'Partial update. username (a-z 0-9 _ -, 3-30 chars, case-insensitive unique) is changeable once every 30 days; when visibility is public the display name / @username is shown to viewers instead of the generic “Share2Us user” label. Requires an interactive login (a personal API token is rejected with 403 session_required).
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
display_name
string
username
string
visibility
string
Responses
Section titled “Responses”The updated profile.
Media typeapplication/json
object
profile
The account owner’s editable profile.
object
display_name
required
string
username
required
Public handle (a-z 0-9 _ -, 3-30). Empty if unclaimed.
string
has_avatar
required
boolean
visibility
required
string
username_change_available_at
Present when the username is within its 30-day change cooldown.
string format: date-time
Example
{ "profile": { "visibility": "public" }}Invalid username (invalid_username/username_reserved) or visibility.
Username taken (username_taken) or changed too recently (username_cooldown).
default
Section titled “default”Standard error envelope.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "quota_exceeded" }}