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

# Update Trait

> Create or update a trait

## Overview

Creates a new trait or updates an existing one. Manually set traits have `source: "manual"` and are preserved during automatic extraction.

## Path Parameters

**id** `string` *required*

Profile ID

**key** `string` *required*

Trait key (e.g., `name`, `expertise_level`)

## Request Body

**value** `any` *required*

The trait value (type must match schema)

**confidence** `number`

Confidence score (0.0-1.0). Defaults to 1.0 for manual updates.

## Response

```json theme={null}
{
  "trait": {
    "key": "name",
    "value": "Alexander",
    "valueType": "string",
    "category": "identity",
    "confidence": 1.0,
    "source": "manual",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-15T00:00:00Z"
  }
}
```

## Example

```bash theme={null}
curl -X PUT https://api.yourserver.com/api/profiles/user-123/traits/name \
  -H "Authorization: Bearer gp_your_key" \
  -H "Content-Type: application/json" \
  -d '{"value": "Alexander", "confidence": 1.0}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.