> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kukkingu.software/llms.txt
> Use this file to discover all available pages before exploring further.

# Set user setting

> Creates or updates a user setting for the authenticated user, identified by key.



## OpenAPI

````yaml https://api.contracting.kukkingu.software/api/v1/docs.json put /api/v1/users/me/settings/{key}
openapi: 3.1.0
info:
  title: Contracting Backend API
  version: 0.1.0
  description: API documentation for the Contracting backend service.
servers:
  - url: https://api.contracting.kukkingu.software
    description: API server
security:
  - bearerAuth: []
paths:
  /api/v1/users/me/settings/{key}:
    put:
      tags:
        - Users
      summary: Set user setting
      description: >-
        Creates or updates a user setting for the authenticated user, identified
        by key.
      parameters:
        - schema:
            type: string
            maxLength: 255
            description: Unique key of the user setting.
            example: theme
          in: path
          name: key
          required: true
          description: Unique key of the user setting.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  description: >-
                    JSON value stored for the user setting (string, number,
                    boolean, array, or object).
                  example:
                    theme: dark
              required:
                - value
              additionalProperties: false
              description: Request body used to set the value of a user setting.
        description: Request body used to set the value of a user setting.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      key:
                        type: string
                        maxLength: 255
                        description: Unique key of the user setting.
                        example: theme
                      value:
                        description: >-
                          JSON value stored for the user setting (string,
                          number, boolean, array, or object).
                        example:
                          theme: dark
                      createdAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        description: Timestamp when the user setting was created.
                        example: '2023-10-05T14:48:00.000Z'
                      updatedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        description: Timestamp when the user setting was last updated.
                        example: '2023-10-05T14:48:00.000Z'
                    required:
                      - key
                      - value
                      - createdAt
                      - updatedAt
                    additionalProperties: false
                    description: User setting resource returned by the API.
                required:
                  - data
                additionalProperties: false
                description: Standard success response payload wrapped in a data property.
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      key:
                        type: string
                        maxLength: 255
                        description: Unique key of the user setting.
                        example: theme
                      value:
                        description: >-
                          JSON value stored for the user setting (string,
                          number, boolean, array, or object).
                        example:
                          theme: dark
                      createdAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        description: Timestamp when the user setting was created.
                        example: '2023-10-05T14:48:00.000Z'
                      updatedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        description: Timestamp when the user setting was last updated.
                        example: '2023-10-05T14:48:00.000Z'
                    required:
                      - key
                      - value
                      - createdAt
                      - updatedAt
                    additionalProperties: false
                    description: User setting resource returned by the API.
                required:
                  - data
                additionalProperties: false
                description: Standard success response payload wrapped in a data property.
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine-readable error code.
                    example: ValidationError
                  message:
                    type: string
                    description: Human-readable validation error summary.
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Request field that failed validation.
                        message:
                          type: string
                          description: Validation failure message for the field.
                        constraint:
                          type: string
                          description: Validation rule that was violated.
                      required:
                        - field
                        - message
                        - constraint
                      additionalProperties: false
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response returned when request validation fails.
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    default: Unauthorized
                    description: Machine-readable error code.
                    example: Unauthorized
                    type: string
                  message:
                    default: Unauthorized
                    description: Human-readable error message.
                    example: Unauthorized
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Error response for requests without valid authentication.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````