import weflayr
from weflayr.openapi.models import SetCustomerTagsInput
client = weflayr.client() # reads WEFLAYR_API_KEY
client.set_customers_tags(body=SetCustomerTagsInput.from_dict({
"upsert": True,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": None}},
]
}))
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.setCustomersTags({
client,
throwOnError: true,
body: {
upsert: true,
customers: [
{ customerName: 'c_123', tags: { plan: 'enterprise', region: 'EU' } },
{ customerName: 'c_456', tags: { plan: 'free', trial: null } },
],
},
});
curl -X POST https://app.weflayr.com/api/customer-tags/ \
-H "Authorization: Bearer $WEFLAYR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"upsert": true,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": null}}
]
}'
{"ok": true, "customers_updated": 2}
Customer tags
Set customer tags
Set tags on customers.
POST
/
api
/
customer-tags
/
import weflayr
from weflayr.openapi.models import SetCustomerTagsInput
client = weflayr.client() # reads WEFLAYR_API_KEY
client.set_customers_tags(body=SetCustomerTagsInput.from_dict({
"upsert": True,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": None}},
]
}))
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.setCustomersTags({
client,
throwOnError: true,
body: {
upsert: true,
customers: [
{ customerName: 'c_123', tags: { plan: 'enterprise', region: 'EU' } },
{ customerName: 'c_456', tags: { plan: 'free', trial: null } },
],
},
});
curl -X POST https://app.weflayr.com/api/customer-tags/ \
-H "Authorization: Bearer $WEFLAYR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"upsert": true,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": null}}
]
}'
{"ok": true, "customers_updated": 2}
See Customer tags for what they do in the dashboard.
Each object inside
Parameters
array of customer objects
required
The per-customer tag updates, described below. Up to 1,000 per call.
boolean
default:"false"
If a (customer, key) pair already exists, overwrite it instead of throwing an error.
customers accepts:
string
required
The same identifier you stamp on your LLM calls when propagating metadata, so tags land on the same customer.
object (string values, or null)
required
A string value sets the tag;
null deletes it. Only the keys you post change, existing tags not included are left untouched.import weflayr
from weflayr.openapi.models import SetCustomerTagsInput
client = weflayr.client() # reads WEFLAYR_API_KEY
client.set_customers_tags(body=SetCustomerTagsInput.from_dict({
"upsert": True,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": None}},
]
}))
const weflayr = require('weflayr');
const client = weflayr.client(); // reads WEFLAYR_API_KEY
await weflayr.api.setCustomersTags({
client,
throwOnError: true,
body: {
upsert: true,
customers: [
{ customerName: 'c_123', tags: { plan: 'enterprise', region: 'EU' } },
{ customerName: 'c_456', tags: { plan: 'free', trial: null } },
],
},
});
curl -X POST https://app.weflayr.com/api/customer-tags/ \
-H "Authorization: Bearer $WEFLAYR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"upsert": true,
"customers": [
{"customer_name": "c_123", "tags": {"plan": "enterprise", "region": "EU"}},
{"customer_name": "c_456", "tags": {"plan": "free", "trial": null}}
]
}'
{"ok": true, "customers_updated": 2}