curl -X POST https://agent.api.lyzr.app/v1/users/ \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
  "user_id": "123",
  "email": "abc@example.com",
  "first_name": "abc",
  "last_name": "abc",
  "metadata": {}
}'
{
  "user_id": {
    "user_id": "66e29773a64b2xxxxxx"
  }
}

Endpoint: POST /v1/users

This endpoint allows you to create a new user by providing necessary user details such as user_id, email, first_name, last_name, and additional metadata. You will need an API key for authentication.

Parameters

user_id
string
required

Unique identifier for the user.

email
string
required

Email address of the user.

first_name
string
required

First name of the user.

last_name
string
required

Last name of the user.

metadata
object
required

Additional metadata related to the user.

Curl
curl -X POST https://agent.api.lyzr.app/v1/users/ \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
  "user_id": "123",
  "email": "abc@example.com",
  "first_name": "abc",
  "last_name": "abc",
  "metadata": {}
}'
Python
import requests

url = "https://agent.api.lyzr.app/v1/users/"
headers = {
    "x-api-key": "your_api_key_here",
    "Content-Type": "application/json"
}

data = {
    "user_id": "123",
    "email": "abc@example.com",
    "first_name": "abc",
    "last_name": "abc",
    "metadata": {}
}

response = requests.post(url, headers=headers, json=data)
{
  "user_id": {
    "user_id": "66e29773a64b2xxxxxx"
  }
}

Response Parameters

user_id
object

Object containing the created user’s ID.