> ## Documentation Index
> Fetch the complete documentation index at: https://chainlit-5-laura-eng-1066-landing-page.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# User

> Create Read Update and Delete methods for User

## Create an User

It's important to note that the concept of User only exists at the thread level, not at the Step level.

```python
import os
from literalai import LiteralClient
literal_client = LiteralClient(api_key=os.getenv("LITERAL_API_KEY"))

@literal_client.step()
def my_step(input_message):
    # some code, llm call, tool call, etc.
    answer = "answer"
    return answer

async def run(input_message):
    with literal_client.thread() as thread:
        literal_client.message(content=input_message, type="user_message", name="User")
        user = await literal_client.api.create_user(identifier="John Doe")
        # user = await literal_client.api.get_user(identifier="John Doe")
        thread.user = user
        answer = my_step(input_message)
        literal_client.message(content=answer, type="assistant_message", name="Assistant")
    return answer
```

<ParamField path="identifier" type="string" required>
  The identifier of the user in your system
</ParamField>

### Return type

<ResponseField name="user" type="User">
  Return the user
</ResponseField>

## Get an User

```python
user = await client.api.get_user(id="<USER_UUID>")
```

<ParamField path="id" type="uuid" required>
  The Literal id of the user
</ParamField>

### Return type

<ResponseField name="user" type="User">
  Return the user, can be None if the user does not exist
</ResponseField>

## Update an User

```python
updated_user = await client.api.update_user(id="<USER_UUID>", identifier="Jane Doe")
```

<ParamField path="id" type="uuid" required>
  The Literal id of the user
</ParamField>

<ParamField path="identifier" type="string">
  The identifier of the user in your system
</ParamField>

<ParamField path="metadata" type="dict">
  The metadata of the user
</ParamField>

### Return type

<ResponseField name="user" type="User">
  Return the user
</ResponseField>

## Delete an User

```python
user = await client.api.delete_user(id="<USER_UUID>")
```

<ParamField path="id" type="uuid" required>
  The Literal id of the user
</ParamField>
