Skip to main content
POST
/
api
/
ext-v1
/
customer
/
createOrUpdateCustomer
curl -X POST https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1234567890",
    "address": "123 Main St, City, State 12345"
  }'
{
  "success": true,
  "telemetronCustomerId": "cust_a1b2c3d4e5f6",
  "message": "Customer created successfully"
}

Overview

Creates or updates customer records in Telemetron. Behavior:
  • Without telemetronCustomerId: Creates new customer (409 error if email exists)
  • With telemetronCustomerId: Updates existing customer

Authentication

x-api-key
string
required
Your organization’s API key

Request Body

email
string
required
Customer’s email address (used as unique identifier)
name
string
Customer’s full name (defaults to email prefix if not provided)
phone
string
Customer’s phone number
address
string
Customer’s address
telemetronCustomerId
string
Existing customer ID for updates. If provided, the endpoint will update the customer with this ID.

Response

success
boolean
Indicates if the operation was successful
telemetronCustomerId
string
The unique identifier for the customer
message
string
Description of the operation result

Examples

Create Customer

curl -X POST https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1234567890",
    "address": "123 Main St, City, State 12345"
  }'

Update Customer

curl -X POST https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "telemetronCustomerId": "customer-uuid-123",
    "name": "John Doe Updated",
    "email": "john.doe@example.com",
    "phone": "+1234567890"
  }'

Response

{
  "success": true,
  "telemetronCustomerId": "cust_a1b2c3d4e5f6",
  "message": "Customer created successfully"
}
curl -X POST https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1234567890",
    "address": "123 Main St, City, State 12345"
  }'
{
  "success": true,
  "telemetronCustomerId": "cust_a1b2c3d4e5f6",
  "message": "Customer created successfully"
}

Status Codes

CodeDescription
200Customer created or updated successfully
400Invalid request (missing required fields, invalid JSON payload, or invalid format)
401Invalid or missing API key
404Customer not found (when updating with telemetronCustomerId)
409Customer already exists with the provided email
500Internal server error