cURL
curl --request PATCH \
--url https://app.masivo.ai/api/storefront/v1/customers/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{
"id": "customer_123",
"name": "John Doe",
"phone": "+593 99 123 4567",
"tags": {
"segment": "premium",
"loyalty_level": "gold"
},
"metadata": {
"favorite_store": "store_01"
}
},
{
"id": "customer_456",
"country": "Ecuador",
"document_type": "EC_CC",
"document_number": "0102030405",
"consent": {
"consent_timestamp": "2026-07-10T12:00:00Z",
"customer_id": "customer_456",
"purposes": {
"email_marketing": true,
"push_notifications": false
},
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB"
}
}
]
}
'import requests
url = "https://app.masivo.ai/api/storefront/v1/customers/bulk"
payload = { "customers": [
{
"id": "customer_123",
"name": "John Doe",
"phone": "+593 99 123 4567",
"tags": {
"segment": "premium",
"loyalty_level": "gold"
},
"metadata": { "favorite_store": "store_01" }
},
{
"id": "customer_456",
"country": "Ecuador",
"document_type": "EC_CC",
"document_number": "0102030405",
"consent": {
"consent_timestamp": "2026-07-10T12:00:00Z",
"customer_id": "customer_456",
"purposes": {
"email_marketing": True,
"push_notifications": False
},
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [
{
id: 'customer_123',
name: 'John Doe',
phone: '+593 99 123 4567',
tags: {segment: 'premium', loyalty_level: 'gold'},
metadata: {favorite_store: 'store_01'}
},
{
id: 'customer_456',
country: 'Ecuador',
document_type: 'EC_CC',
document_number: '0102030405',
consent: {
consent_timestamp: '2026-07-10T12:00:00Z',
customer_id: 'customer_456',
purposes: {email_marketing: true, push_notifications: false},
consent_string: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB'
}
}
]
})
};
fetch('https://app.masivo.ai/api/storefront/v1/customers/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.masivo.ai/api/storefront/v1/customers/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customers' => [
[
'id' => 'customer_123',
'name' => 'John Doe',
'phone' => '+593 99 123 4567',
'tags' => [
'segment' => 'premium',
'loyalty_level' => 'gold'
],
'metadata' => [
'favorite_store' => 'store_01'
]
],
[
'id' => 'customer_456',
'country' => 'Ecuador',
'document_type' => 'EC_CC',
'document_number' => '0102030405',
'consent' => [
'consent_timestamp' => '2026-07-10T12:00:00Z',
'customer_id' => 'customer_456',
'purposes' => [
'email_marketing' => true,
'push_notifications' => false
],
'consent_string' => 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.masivo.ai/api/storefront/v1/customers/bulk"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.masivo.ai/api/storefront/v1/customers/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/customers/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "Customers updated successfully"
}
}{
"error": "<string>",
"details": "<string>"
}Customers
Update customers in bulk
Update customers in bulk. You can update multiple customers at once, each with its own subset of fields (partial update): only the fields included for each customer are written, the rest keep their current values. Available fields are the same as the single customer update endpoint, except devices. Notes: date of birth and gender cannot be changed once set, and anonymous customers must use the identity endpoint.
PATCH
/
customers
/
bulk
cURL
curl --request PATCH \
--url https://app.masivo.ai/api/storefront/v1/customers/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{
"id": "customer_123",
"name": "John Doe",
"phone": "+593 99 123 4567",
"tags": {
"segment": "premium",
"loyalty_level": "gold"
},
"metadata": {
"favorite_store": "store_01"
}
},
{
"id": "customer_456",
"country": "Ecuador",
"document_type": "EC_CC",
"document_number": "0102030405",
"consent": {
"consent_timestamp": "2026-07-10T12:00:00Z",
"customer_id": "customer_456",
"purposes": {
"email_marketing": true,
"push_notifications": false
},
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB"
}
}
]
}
'import requests
url = "https://app.masivo.ai/api/storefront/v1/customers/bulk"
payload = { "customers": [
{
"id": "customer_123",
"name": "John Doe",
"phone": "+593 99 123 4567",
"tags": {
"segment": "premium",
"loyalty_level": "gold"
},
"metadata": { "favorite_store": "store_01" }
},
{
"id": "customer_456",
"country": "Ecuador",
"document_type": "EC_CC",
"document_number": "0102030405",
"consent": {
"consent_timestamp": "2026-07-10T12:00:00Z",
"customer_id": "customer_456",
"purposes": {
"email_marketing": True,
"push_notifications": False
},
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB"
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [
{
id: 'customer_123',
name: 'John Doe',
phone: '+593 99 123 4567',
tags: {segment: 'premium', loyalty_level: 'gold'},
metadata: {favorite_store: 'store_01'}
},
{
id: 'customer_456',
country: 'Ecuador',
document_type: 'EC_CC',
document_number: '0102030405',
consent: {
consent_timestamp: '2026-07-10T12:00:00Z',
customer_id: 'customer_456',
purposes: {email_marketing: true, push_notifications: false},
consent_string: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB'
}
}
]
})
};
fetch('https://app.masivo.ai/api/storefront/v1/customers/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.masivo.ai/api/storefront/v1/customers/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'customers' => [
[
'id' => 'customer_123',
'name' => 'John Doe',
'phone' => '+593 99 123 4567',
'tags' => [
'segment' => 'premium',
'loyalty_level' => 'gold'
],
'metadata' => [
'favorite_store' => 'store_01'
]
],
[
'id' => 'customer_456',
'country' => 'Ecuador',
'document_type' => 'EC_CC',
'document_number' => '0102030405',
'consent' => [
'consent_timestamp' => '2026-07-10T12:00:00Z',
'customer_id' => 'customer_456',
'purposes' => [
'email_marketing' => true,
'push_notifications' => false
],
'consent_string' => 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.masivo.ai/api/storefront/v1/customers/bulk"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.masivo.ai/api/storefront/v1/customers/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/customers/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customers\": [\n {\n \"id\": \"customer_123\",\n \"name\": \"John Doe\",\n \"phone\": \"+593 99 123 4567\",\n \"tags\": {\n \"segment\": \"premium\",\n \"loyalty_level\": \"gold\"\n },\n \"metadata\": {\n \"favorite_store\": \"store_01\"\n }\n },\n {\n \"id\": \"customer_456\",\n \"country\": \"Ecuador\",\n \"document_type\": \"EC_CC\",\n \"document_number\": \"0102030405\",\n \"consent\": {\n \"consent_timestamp\": \"2026-07-10T12:00:00Z\",\n \"customer_id\": \"customer_456\",\n \"purposes\": {\n \"email_marketing\": true,\n \"push_notifications\": false\n },\n \"consent_string\": \"COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKBBB\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"message": "Customers updated successfully"
}
}{
"error": "<string>",
"details": "<string>"
}⌘I