Customer Management
Create or Update Customer
Create or update customer records
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"
}'
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"
}'
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+1234567890',
address: '123 Main St, City, State 12345'
})
});
const data = await response.json();
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
telemetronCustomerId: 'customer-uuid-123',
name: 'John Doe Updated',
email: 'john.doe@example.com',
phone: '+1234567890'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john.doe@example.com',
'phone': '+1234567890',
'address': '123 Main St, City, State 12345'
}
)
data = response.json()
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'telemetronCustomerId': 'customer-uuid-123',
'name': 'John Doe Updated',
'email': 'john.doe@example.com',
'phone': '+1234567890'
}
)
data = response.json()
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer created successfully"
}
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer updated successfully"
}
{
"error": "Customer already exists with this email. Specify telemetronCustomerId to update fields.",
"telemetronCustomerId": "cust_a1b2c3d4e5f6"
}
{
"error": "Invalid JSON payload"
}
{
"error": "Customer not found or does not belong to this organization"
}
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
Request Body
Existing customer ID for updates. If provided, the endpoint will update the customer with this ID.
Response
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"
}'
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+1234567890',
address: '123 Main St, City, State 12345'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john.doe@example.com',
'phone': '+1234567890',
'address': '123 Main St, City, State 12345'
}
)
data = response.json()
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"
}'
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
telemetronCustomerId: 'customer-uuid-123',
name: 'John Doe Updated',
email: 'john.doe@example.com',
phone: '+1234567890'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'telemetronCustomerId': 'customer-uuid-123',
'name': 'John Doe Updated',
'email': 'john.doe@example.com',
'phone': '+1234567890'
}
)
data = response.json()
Response
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer created successfully"
}
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer updated successfully"
}
{
"error": "Customer already exists with this email. Specify telemetronCustomerId to update fields.",
"telemetronCustomerId": "cust_a1b2c3d4e5f6"
}
{
"error": "Invalid JSON payload"
}
{
"error": "Customer not found or does not belong to this organization"
}
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"
}'
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"
}'
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+1234567890',
address: '123 Main St, City, State 12345'
})
});
const data = await response.json();
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
telemetronCustomerId: 'customer-uuid-123',
name: 'John Doe Updated',
email: 'john.doe@example.com',
phone: '+1234567890'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john.doe@example.com',
'phone': '+1234567890',
'address': '123 Main St, City, State 12345'
}
)
data = response.json()
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'telemetronCustomerId': 'customer-uuid-123',
'name': 'John Doe Updated',
'email': 'john.doe@example.com',
'phone': '+1234567890'
}
)
data = response.json()
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer created successfully"
}
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer updated successfully"
}
{
"error": "Customer already exists with this email. Specify telemetronCustomerId to update fields.",
"telemetronCustomerId": "cust_a1b2c3d4e5f6"
}
{
"error": "Invalid JSON payload"
}
{
"error": "Customer not found or does not belong to this organization"
}
Status Codes
| Code | Description |
|---|---|
| 200 | Customer created or updated successfully |
| 400 | Invalid request (missing required fields, invalid JSON payload, or invalid format) |
| 401 | Invalid or missing API key |
| 404 | Customer not found (when updating with telemetronCustomerId) |
| 409 | Customer already exists with the provided email |
| 500 | Internal server error |
⌘I
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"
}'
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"
}'
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+1234567890',
address: '123 Main St, City, State 12345'
})
});
const data = await response.json();
const response = await fetch('https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
telemetronCustomerId: 'customer-uuid-123',
name: 'John Doe Updated',
email: 'john.doe@example.com',
phone: '+1234567890'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john.doe@example.com',
'phone': '+1234567890',
'address': '123 Main St, City, State 12345'
}
)
data = response.json()
import requests
response = requests.post(
'https://admin.telemetron.ai/api/ext-v1/customer/createOrUpdateCustomer',
headers={
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
json={
'telemetronCustomerId': 'customer-uuid-123',
'name': 'John Doe Updated',
'email': 'john.doe@example.com',
'phone': '+1234567890'
}
)
data = response.json()
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer created successfully"
}
{
"success": true,
"telemetronCustomerId": "cust_a1b2c3d4e5f6",
"message": "Customer updated successfully"
}
{
"error": "Customer already exists with this email. Specify telemetronCustomerId to update fields.",
"telemetronCustomerId": "cust_a1b2c3d4e5f6"
}
{
"error": "Invalid JSON payload"
}
{
"error": "Customer not found or does not belong to this organization"
}