Partially update user preferences
PATCH
/api/user/preferences
const url = 'https://example.com/api/user/preferences';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"view":{"defaultView":"grid"}}'};
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://example.com/api/user/preferences \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "view": { "defaultView": "grid" } }'Merges the supplied fields into the current user’s existing preferences, leaving other fields unchanged.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
view
required
object
defaultView
required
Default view mode
string
Example
gridtableColumns
Saved table column selections
Array<string>
recentRepositories
Recently visited repositories
Array<object>
object
CACHE_ROOT
required
Repository namespace
string
Example
my-reponame
Display name
string
lastVisited
required
Timestamp of last visit
number
recentSites
Recently visited sites
Array<object>
object
id
required
Site ID
string
name
Site name
string
lastVisited
required
Timestamp of last visit
number
detailPaneColumns
Number of grid columns visible when detail pane is open
number
Example
2theme
UI theme mode
string
Example
darkuiVersion
UI version preference
string
Example
content2Responses
Section titled “Responses”Preferences updated successfully
Media typeapplication/json
object
success
required
Whether the update was successful
boolean
preferences
Updated user preferences
object
key
additional properties
Examplegenerated
{ "success": true, "preferences": { "additionalProperty": "example" }}Not authenticated
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}