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 for filtering.
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.
Parameters
object[]
required
The per-customer tag updates, described below. Up to 1,000 per call.
Show customer
Show customer
string
required
The
customer_name your LLM calls carry (see customer_name), so the tags land on the same customer.object
required
A string value sets the tag;
null deletes it. Tags whose key you do not send are left unchanged.boolean
default:"false"
Overwrite a (customer, key) pair that already exists. When false, a pair already set fails the whole request with a 422 on
customers (tag(s) already set: ...) and nothing is written.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}