> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.houseofapps.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.houseofapps.ai/_mcp/server.

# Patch organization member

PATCH https://api-dev.houseofapps.ai/v1/integrations/users/{user_id}
Content-Type: application/json

Partially update an organization member. Supported fields: role_id and FieldCell custom_fields.

Reference: https://docs.houseofapps.ai/api-reference/overview/platform/users/external-patch-user-v-1-integrations-users-user-id-patch

## Request

### Path parameters

- `user_id` (string, required) — Organization member user id (auth user id)

### Headers

- `licenseKey` (string, required)
- `appSecret` (string, required)

### Body (application/json)

This endpoint expects a PatchUserRequest.

- `role_id` (string, optional, nullable) — RBAC role UUID to assign in the organization
- `custom_fields` (list of map from string to any, optional, nullable) — FieldCell PATCH: root entries use field_id plus value | sub_fields | items (instance_id required for existing roots; list items is authoritative). Nested cells may use instance_id only (optional field_id must match). Do not send type.

## Response

### 200

OK

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable success message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `data` (SuccessResponseData, optional, nullable) — Payload for this endpoint

## Errors

### 400 Bad Request Error

Bad Request

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 401 Unauthorized Error

Unauthorized

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 403 Forbidden Error

Forbidden

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 404 Not Found Error

Not Found

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 422 Unprocessable Entity Error

Unprocessable Entity

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 429 Too Many Requests Error

Too Many Requests

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 500 Internal Server Error

Internal Server Error

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 503 Service Unavailable Error

Service Unavailable

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

## Types

### SuccessResponseData

Payload for this endpoint

- map from string to any
- list of any
- string
- double
- boolean

## Examples

**Request**

```json
{
  "role_id": "550e8400-e29b-41d4-a716-446655440000",
  "custom_fields": [
    {
      "field_id": "550e8400-e29b-41d4-a716-446655440001",
      "value": "Bar"
    }
  ]
}
```

**Response**

```json
{
  "status": "success",
  "message": "OK",
  "statusCode": 200,
  "code": "2000",
  "data": {}
}
```

**SDK Code**

```python OK
import requests

url = "https://api-dev.houseofapps.ai/v1/integrations/users/user_id"

payload = {
    "role_id": "550e8400-e29b-41d4-a716-446655440000",
    "custom_fields": [
        {
            "field_id": "550e8400-e29b-41d4-a716-446655440001",
            "value": "Bar"
        }
    ]
}
headers = {
    "appSecret": "appSecret",
    "licenseKey": "licenseKey",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript OK
const url = 'https://api-dev.houseofapps.ai/v1/integrations/users/user_id';
const options = {
  method: 'PATCH',
  headers: {
    appSecret: 'appSecret',
    licenseKey: 'licenseKey',
    'Content-Type': 'application/json'
  },
  body: '{"role_id":"550e8400-e29b-41d4-a716-446655440000","custom_fields":[{"field_id":"550e8400-e29b-41d4-a716-446655440001","value":"Bar"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go OK
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-dev.houseofapps.ai/v1/integrations/users/user_id"

	payload := strings.NewReader("{\n  \"role_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"custom_fields\": [\n    {\n      \"field_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n      \"value\": \"Bar\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("appSecret", "appSecret")
	req.Header.Add("licenseKey", "licenseKey")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby OK
require 'uri'
require 'net/http'

url = URI("https://api-dev.houseofapps.ai/v1/integrations/users/user_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["appSecret"] = 'appSecret'
request["licenseKey"] = 'licenseKey'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"role_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"custom_fields\": [\n    {\n      \"field_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n      \"value\": \"Bar\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java OK
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api-dev.houseofapps.ai/v1/integrations/users/user_id")
  .header("appSecret", "appSecret")
  .header("licenseKey", "licenseKey")
  .header("Content-Type", "application/json")
  .body("{\n  \"role_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"custom_fields\": [\n    {\n      \"field_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n      \"value\": \"Bar\"\n    }\n  ]\n}")
  .asString();
```

```php OK
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-dev.houseofapps.ai/v1/integrations/users/user_id', [
  'body' => '{
  "role_id": "550e8400-e29b-41d4-a716-446655440000",
  "custom_fields": [
    {
      "field_id": "550e8400-e29b-41d4-a716-446655440001",
      "value": "Bar"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'appSecret' => 'appSecret',
    'licenseKey' => 'licenseKey',
  ],
]);

echo $response->getBody();
```

```csharp OK
using RestSharp;

var client = new RestClient("https://api-dev.houseofapps.ai/v1/integrations/users/user_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("appSecret", "appSecret");
request.AddHeader("licenseKey", "licenseKey");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"role_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"custom_fields\": [\n    {\n      \"field_id\": \"550e8400-e29b-41d4-a716-446655440001\",\n      \"value\": \"Bar\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift OK
import Foundation

let headers = [
  "appSecret": "appSecret",
  "licenseKey": "licenseKey",
  "Content-Type": "application/json"
]
let parameters = [
  "role_id": "550e8400-e29b-41d4-a716-446655440000",
  "custom_fields": [
    [
      "field_id": "550e8400-e29b-41d4-a716-446655440001",
      "value": "Bar"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.houseofapps.ai/v1/integrations/users/user_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```