Replace user preference value

PUT /mywork/v1/user-preferences/{pref_key}

Operation id: putUserPreferenceByKey

Description

Replaces the preference value. For TASK_PINS, the body must be a JSON array of feed keys (full replace). Empty replace / clear-all without going through unpin rules is rejected by the pin service when it would violate pin policy.

PUT on the collection root (missing pref_key) returns E113.


Error Scenarios

ScenarioHTTPError CodeMessage
Missing pref_key (collection root)400E113pref_key is mandatory
Invalid pref_key400E228Invalid pref_key. Allowed values: TASK_PINS
Max pins exceeded400E229Maximum of {0} pinned tasks reached.
Task pinning disabled (TASK_PIN_COUNT ≤ 0)400E230Task pinning is disabled
Invalid / blank body400E105 / mandatory fieldpref_value required
Unable to update preference500E358Unable to update preference

Tags: MyWorkUserPreferences

Parameters

Path parameters

NameTypeRequiredDescription
pref_keystringYesPreference key. v1 allowlists TASK_PINS only (→ E228 otherwise).

Security

  • AuthTokenHeader (apiKey)
    • Session authentication token validated server-side against the user session store.

Responses

200 — Success — saved preference under user_preference

Content type: application/json

400 — E113 / E228 / E229 / E230 / validation

Content type: application/json

401 — Invalid or expired X-reflexis-csrf-token-X token (HTTP 401)

Content type: application/json

500 — Unexpected server-side error

Content type: application/json

Request body

Required: Yes

application/json

Schema

{
  "oneOf": [
    {
      "type": "array",
      "description": "TASK_PINS — ordered feed keys",
      "items": {
        "type": "integer"
      }
    },
    {
      "type": "object"
    }
  ]
}

Example:

[
  101,
  202
]

Response models

200 — Success — saved preference under user_preference

Content type: application/json

Schema

JSON object (structure varies by endpoint).

{
  "type": "object",
  "description": "JSON object (structure varies by endpoint)."
}

Example:

{
  "status": "OK",
  "user_preference": {
    "pref_key": "TASK_PINS",
    "pref_value": [
      101,
      202
    ]
  }
}

400 — E113 / E228 / E229 / E230 / validation

Content type: application/json

Schema

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E204, E112, E302)
responsestringYesHuman-readable error message
{
  "type": "object",
  "example": {
    "status": "ER",
    "errorCode": "E204",
    "response": "Invalid or expired token"
  },
  "required": [
    "status",
    "errorCode",
    "response"
  ],
  "properties": {
    "status": {
      "type": "string",
      "description": "Always \"ER\" for error responses",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Application-level error code (e.g. E204, E112, E302)"
    },
    "response": {
      "type": "string",
      "description": "Human-readable error message"
    }
  }
}

401 — Invalid or expired X-reflexis-csrf-token-X token (HTTP 401)

Content type: application/json

Schema

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E204, E112, E302)
responsestringYesHuman-readable error message
{
  "type": "object",
  "example": {
    "status": "ER",
    "errorCode": "E204",
    "response": "Invalid or expired token"
  },
  "required": [
    "status",
    "errorCode",
    "response"
  ],
  "properties": {
    "status": {
      "type": "string",
      "description": "Always \"ER\" for error responses",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Application-level error code (e.g. E204, E112, E302)"
    },
    "response": {
      "type": "string",
      "description": "Human-readable error message"
    }
  }
}

Example:

{
  "status": "ER",
  "errorCode": "E204",
  "response": "Invalid or expired token"
}

500 — Unexpected server-side error

Content type: application/json

Schema

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E204, E112, E302)
responsestringYesHuman-readable error message
{
  "type": "object",
  "example": {
    "status": "ER",
    "errorCode": "E204",
    "response": "Invalid or expired token"
  },
  "required": [
    "status",
    "errorCode",
    "response"
  ],
  "properties": {
    "status": {
      "type": "string",
      "description": "Always \"ER\" for error responses",
      "enum": [
        "ER"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Application-level error code (e.g. E204, E112, E302)"
    },
    "response": {
      "type": "string",
      "description": "Human-readable error message"
    }
  }
}

Example:

{
  "status": "ER",
  "errorCode": "E302",
  "response": "Internal server error"
}