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

# Update User

> Updates user properties

## Overview

Updates an existing user identified by their `project_user_id`. This endpoint allows you to modify user properties. Only the fields provided in the request will be updated.

## Authentication

This endpoint requires authentication via the following HTTP headers:

* `X-Clix-Project-ID`: Your project ID
* `X-Clix-API-Key`: Your Clix Secret API Key

## Path Parameters

| Parameter         | Type   | Required | Description                                 |
| ----------------- | ------ | -------- | ------------------------------------------- |
| `project_user_id` | string | Yes      | The unique identifier of the user to update |

## Request Body

| Field        | Type   | Required | Description                                                                                       |
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------- |
| `properties` | object | No       | User properties to update as key-value pairs where values can be string, number, boolean, or null |

## Example Request

```bash theme={null}
PATCH /api/v1/users/clix_user
```

```json theme={null}
{
  "properties": {
    "email": "newemail@example.com",
    "subscription_tier": "premium",
    "last_login": "2025-01-10T12:00:00Z",
    "login_count": 42
  }
}
```

## Response

### Success Response (200 OK)

Returns the updated user properties:

```json theme={null}
{
  "properties": {
    "email": "newemail@example.com",
    "subscription_tier": "premium",
    "last_login": "2025-01-10T12:00:00Z",
    "login_count": 42
  }
}
```

### Error Responses

#### 400 Bad Request

Returned when:

* `project_user_id` is missing or invalid
* Request body is malformed

Returns a plain text error message:

```
Project User Id must be provided
```

#### 404 Not Found

The user with the specified `project_user_id` does not exist.

Returns an empty response body with 404 status code.

#### 401 Unauthorized

Authentication failed or invalid API key.

## Notes

* Only the properties provided in the request body will be updated
* Existing properties not included in the request will remain unchanged
* If the user does not exist, a 404 error will be returned
* Properties with the same key will be overwritten with the new values
* The response returns only the properties object, not the full user object


## OpenAPI

````yaml PATCH /api/v1/users/{project_user_id}
openapi: 3.1.0
info:
  title: clix/external/v1/clix.proto
  version: version not set
servers:
  - url: https://api.clix.so
security:
  - ProjectIdAuth: []
    ApiKeyAuth: []
tags:
  - name: ClixExternalService
paths:
  /api/v1/users/{project_user_id}:
    patch:
      tags:
        - ClixExternalService
      summary: Update an existing user
      description: Updates user properties
      operationId: ClixExternalService_UpdateUser
      parameters:
        - name: project_user_id
          in: path
          required: true
          description: The unique identifier of the user to update
          schema:
            type: string
      requestBody:
        required: true
        description: User data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1UpdateUserRequest'
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1UpdateUserResponse'
        '400':
          description: Bad request - invalid or missing parameters
          content:
            text/plain:
              schema:
                type: string
                example: Project User Id must be provided
        '404':
          description: User not found
components:
  schemas:
    v1UpdateUserRequest:
      type: object
      description: Request to update a user
      properties:
        properties:
          type: object
          description: User properties to update as key-value pairs
          additionalProperties: true
    v1UpdateUserResponse:
      type: object
      description: Response containing the updated user properties
      properties:
        properties:
          type: object
          description: User properties as key-value pairs
          additionalProperties: true
  securitySchemes:
    ProjectIdAuth:
      type: apiKey
      in: header
      name: X-Clix-Project-ID
      description: Project ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Clix-API-Key
      description: API Key for authentication

````