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

# Update a user attribute

PATCH https://api.sigmacomputing.com/v2/user-attributes/{userAttributeId}
Content-Type: application/json

Update the name, description, or default value of a user attribute. Only the fields included in the request are changed.

  ### Usage notes
  - Retrieve the **userAttributeId** by calling the [/v2/user-attributes](https://help.sigmacomputing.com/reference/list-user-attributes) endpoint.
  - Sigma-managed user attributes, such as /`home_page/` cannot be renamed.
    

Reference: https://help.sigmacomputing.com/reference/update-user-attribute

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://api.sigmacomputing.com` (Server for GCP (US) hosted organizations, default)
- `https://api.sa.gcp.sigmacomputing.com` (Server for GCP (KSA) hosted organizations)
- `https://aws-api.sigmacomputing.com` (Server for AWS US (West) hosted organizations)
- `https://api.us-a.aws.sigmacomputing.com` (Server for AWS US (East) hosted organizations)
- `https://api.ca.aws.sigmacomputing.com` (Server for AWS Canada hosted organizations)
- `https://api.eu.aws.sigmacomputing.com` (Server for AWS Europe hosted organizations)
- `https://api.au.aws.sigmacomputing.com` (Server for AWS Australia and APAC hosted organizations)
- `https://api.uk.aws.sigmacomputing.com` (Server for AWS UK hosted organizations)
- `https://api.us.azure.sigmacomputing.com` (Server for Azure US hosted organizations)
- `https://api.eu.azure.sigmacomputing.com` (Server for Azure Europe hosted organizations)
- `https://api.ca.azure.sigmacomputing.com` (Server for Azure Canada hosted organizations)
- `https://api.uk.azure.sigmacomputing.com` (Server for Azure United Kingdom hosted organizations)
- `https://api.au.azure.sigmacomputing.com` (Server for Azure Australia hosted organizations)

## Request

### Path parameters

- `userAttributeId` (string, required) — Unique identifier of the user attribute.

### Body (application/json)

- `userAttributeName` (string, optional) — Name of the user attribute.
- `description` (string, optional) — Description of the user attribute.
- `defaultValue` (object, optional, nullable) — Default value of the user attribute. Pass null to clear the current default value.
  - `type` (enum, required) — Type of user attribute.
    - Allowed values: `string`
  - `val` (string, required) — Value of the user attribute.

## Response

### 200

The response body.

- `userAttributeId` (string, required) — Unique identifier of the user attribute.
- `name` (string, required) — Name of the user attribute.
- `createdBy` (string, required) — The identifier of the user who created this object.
- `updatedBy` (string, required) — The identifier of the user or process that last updated this object.
- `createdAt` (datetime, required) — When the object was created.
- `updatedAt` (datetime, required) — When the object was last updated.
- `description` (string, optional, nullable) — Description of the user attribute.
- `defaultValue` (object, optional, nullable) — Default value of the user attribute.
  - `type` (enum, required) — Type of user attribute.
    - Allowed values: `string`
  - `val` (string, required) — Value of the user attribute.

## Examples

### Response Example

**Request**

```json
undefined
```

**Response**

```json
{
  "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c",
  "name": "department",
  "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "createdAt": "2026-08-20T16:45:00.000Z",
  "updatedAt": "2026-08-20T17:12:00.000Z",
  "description": "The user’s home department.",
  "defaultValue": {
    "type": "string",
    "val": "engineering"
  }
}
```

**SDK Code**

```python Response Example
import requests

url = "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

headers = {"Authorization": "<token>."}

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

print(response.json())
```

```javascript Response Example
const url = 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId';
const options = {method: 'PATCH', headers: {Authorization: '<token>.'}};

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

```go Response Example
package main

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

func main() {

	url := "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

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

	req.Header.Add("Authorization", "<token>.")

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

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

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

}
```

```ruby Response Example
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<token>.'

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

```java Response Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")
  .header("Authorization", "<token>.")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId', [
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

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

```csharp Response Example
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<token>.");
IRestResponse response = client.Execute(request);
```

```swift Response Example
import Foundation

let headers = ["Authorization": "<token>."]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

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()
```

### Request Example

**Request**

```json
{
  "description": "The user’s home department.",
  "defaultValue": {
    "type": "string",
    "val": "engineering"
  }
}
```

**Response**

```json
{
  "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c",
  "name": "department",
  "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "createdAt": "2026-08-20T16:45:00.000Z",
  "updatedAt": "2026-08-20T17:12:00.000Z",
  "description": "The user’s home department.",
  "defaultValue": {
    "type": "string",
    "val": "engineering"
  }
}
```

**SDK Code**

```python Request Example
import requests

url = "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

payload = {
    "description": "The user’s home department.",
    "defaultValue": {
        "type": "string",
        "val": "engineering"
    }
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Request Example
const url = 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId';
const options = {
  method: 'PATCH',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"description":"The user’s home department.","defaultValue":{"type":"string","val":"engineering"}}'
};

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

```go Request Example
package main

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

func main() {

	url := "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

	payload := strings.NewReader("{\n  \"description\": \"The user’s home department.\",\n  \"defaultValue\": {\n    \"type\": \"string\",\n    \"val\": \"engineering\"\n  }\n}")

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

	req.Header.Add("Authorization", "<token>.")
	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 Request Example
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"The user’s home department.\",\n  \"defaultValue\": {\n    \"type\": \"string\",\n    \"val\": \"engineering\"\n  }\n}"

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

```java Request Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"The user’s home department.\",\n  \"defaultValue\": {\n    \"type\": \"string\",\n    \"val\": \"engineering\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId', [
  'body' => '{
  "description": "The user’s home department.",
  "defaultValue": {
    "type": "string",
    "val": "engineering"
  }
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Request Example
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"The user’s home department.\",\n  \"defaultValue\": {\n    \"type\": \"string\",\n    \"val\": \"engineering\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Example
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "description": "The user’s home department.",
  "defaultValue": [
    "type": "string",
    "val": "engineering"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")! 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()
```

### Clear default value

**Request**

```json
{
  "defaultValue": null
}
```

**Response**

```json
{
  "userAttributeId": "e4b7c2a1-9d3f-4e6b-8a2c-5f1d9e3b7a4c",
  "name": "department",
  "createdBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "updatedBy": "qJ8VpXeRp3ZvNtLm6WkYbGjFcAoS9h",
  "createdAt": "2026-08-20T16:45:00.000Z",
  "updatedAt": "2026-08-20T17:12:00.000Z",
  "description": "The user’s home department.",
  "defaultValue": {
    "type": "string",
    "val": "engineering"
  }
}
```

**SDK Code**

```python Clear default value
import requests

url = "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

payload = { "defaultValue": None }
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Clear default value
const url = 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId';
const options = {
  method: 'PATCH',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"defaultValue":null}'
};

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

```go Clear default value
package main

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

func main() {

	url := "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId"

	payload := strings.NewReader("{\n  \"defaultValue\": null\n}")

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

	req.Header.Add("Authorization", "<token>.")
	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 Clear default value
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"defaultValue\": null\n}"

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

```java Clear default value
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"defaultValue\": null\n}")
  .asString();
```

```php Clear default value
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sigmacomputing.com/v2/user-attributes/userAttributeId', [
  'body' => '{
  "defaultValue": null
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Clear default value
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/user-attributes/userAttributeId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"defaultValue\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Clear default value
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = ["defaultValue": ] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/user-attributes/userAttributeId")! 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()
```