Create an User

import os
from literalai import LiteralClient

client = LiteralClient(api_key=os.getenv("LITERAL_API_KEY"))
new_user = await client.api.create_user(identifier="John Doe")
identifier
string
required
The identifier of the user in your system

Return type

user
User
Return the user

Get an User

user = await client.api.get_user(id="<USER_UUID>")
id
uuid
required
The Literal id of the user

Return type

user
User
Return the user, can be None if the user does not exist

Update an User

updated_user = await client.api.update_user(id="<USER_UUID>", identifier="Jane Doe")
id
uuid
required
The Literal id of the user
identifier
string
The identifier of the user in your system
metadata
dict
The metadata of the user

Return type

user
User
Return the user

Delete an User

user = await client.api.delete_user(id="<USER_UUID>")
id
uuid
required
The Literal id of the user