Create or update a customer
POST/customers
Creates a new customer or updates an existing one based on the provided information.
Upsert Logic:
- If
idis provided, updates the customer with that ID - If no
idbut phone/email provided, searches for existing customer by phone first, then email - If no existing customer found, creates a new customer
Tags are merged (not replaced) when updating.
Body ParametersJSON
Returns
Create or update a customer
curl https://api.getrotor.com/open-api/customers \
-H 'Content-Type: application/json' \
-H "x-api-key: $ROTOR_API_KEY" \
-d '{}'{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"billing_city": "billing_city",
"billing_country": "billing_country",
"billing_same_as_property": true,
"billing_state": "billing_state",
"billing_street1": "billing_street1",
"billing_street2": "billing_street2",
"billing_zip": "billing_zip",
"company_name": "company_name",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"first_name": "first_name",
"last_name": "last_name",
"message": "Customer created successfully",
"notes": "notes",
"phone": "phone",
"property_city": "property_city",
"property_country": "property_country",
"property_state": "property_state",
"property_street1": "property_street1",
"property_street2": "property_street2",
"property_zip": "property_zip",
"service_frequency": "service_frequency",
"service_type": "service_type",
"source": "source",
"status": "active",
"tags": [
"string"
]
}{
"status": "error",
"message": "Validation failed",
"errors": [
{
"field": "email",
"message": "Invalid email format"
}
]
}{
"status": "error",
"message": "Authentication required. Provide x-api-key header.",
"error_code": "AUTHENTICATION_REQUIRED"
}{
"status": "error",
"message": "Forbidden: required scope 'leads:read' not granted for this API key",
"error_code": "INSUFFICIENT_SCOPE"
}{
"status": "error",
"message": "Daily API key request limit of 1000 exceeded",
"error_code": "RATE_LIMIT_EXCEEDED"
}{
"status": "error",
"message": "Internal server error"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"billing_city": "billing_city",
"billing_country": "billing_country",
"billing_same_as_property": true,
"billing_state": "billing_state",
"billing_street1": "billing_street1",
"billing_street2": "billing_street2",
"billing_zip": "billing_zip",
"company_name": "company_name",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"first_name": "first_name",
"last_name": "last_name",
"message": "Customer created successfully",
"notes": "notes",
"phone": "phone",
"property_city": "property_city",
"property_country": "property_country",
"property_state": "property_state",
"property_street1": "property_street1",
"property_street2": "property_street2",
"property_zip": "property_zip",
"service_frequency": "service_frequency",
"service_type": "service_type",
"source": "source",
"status": "active",
"tags": [
"string"
]
}{
"status": "error",
"message": "Validation failed",
"errors": [
{
"field": "email",
"message": "Invalid email format"
}
]
}{
"status": "error",
"message": "Authentication required. Provide x-api-key header.",
"error_code": "AUTHENTICATION_REQUIRED"
}{
"status": "error",
"message": "Forbidden: required scope 'leads:read' not granted for this API key",
"error_code": "INSUFFICIENT_SCOPE"
}{
"status": "error",
"message": "Daily API key request limit of 1000 exceeded",
"error_code": "RATE_LIMIT_EXCEEDED"
}{
"status": "error",
"message": "Internal server error"
}