Skip to content

User Preferences

User preferences are collection of a user frontend application layout settings. Under keys managed by fronted application are stored information about tables columns, sorting, filtering and other any user layout settings.

POST /api/users/preferences/key/

Creates or override authenticated user preferences for passed key.

Permissions

Requires authentication.

Request

  • URL parameters
KeyTypeNotes
keystringAny string following regexp rule a-zA-z0-9\-\\ and length 255
  • Body parameters
KeyTypeNotes
preferencesstringrequired
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/users/preferences/`key`/

{
  "preferences": <string>
}

Sample request body

json
POST /api/users/preferences/key/

{
  "preferences": "{\"tables\": [1,2]}"
}

Validations

  • preferences
    • Max length: 110000
  • key
    • Max length: 255
    • Regexp a-zA-Z0-9\-\\

Response

Empty response body

  • Successful status 201 Created

Errors

CauseResponse codeMessage
Max 5000000 User Preferences exceeded per user400 Bad Request"detail": ["Limit of 5000000 User Preferences for the User has been exceeded."]
Max 110000 characters in performance value exceeded400 Bad Request"preferences": ["Ensure this field has no more than 110000 characters."]
performance value can't be null400 Bad Request"preferences": ["This field may not be null."]
performance is required in request data400 Bad Request"preferences": ["This field is required."]
Max 255 characters in key exceeded400 Bad Request"key": ["Ensure this field has no more than 255 characters."]
key value contains not allowed characters. Allowed are a-z, A-Z, -, \400 Bad Request"key": ["Enter a valid value."]

GET /api/users/preferences/key/

Returns user preferences for passing key.

Permissions

Requires authentication.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/users/preferences/`key`/

Response

KeyTypeNotes
preferencesstring
  • Successful status 200 OK
  • Response body schema
json
{
  "preferences": <string>
}

Sorting

Not supported

Filtering

Not supported

Errors

ErrorResponse codeMessage
User Permissions with key for authenticated user does not exist404 Not Found"detail": "Not found."