GUIDES

Custom data

Send your own customer attributes and usage events, so the churn score and the churn drivers know what your billing cannot tell.

Your billing knows what customers pay. Your app knows how they got there and whether they use it. Send that to NoChurn as attributes (facts about a customer) and usage events (what they do). They feed the churn score, the churn drivers of Data & AI, segments and offers.

Attributes

POST /v1/customers/{id}/attributes merges attributes into a customer ({id} is any of its ids). You can also pass attributes when you create or update a customer.

curl -X POST https://api.nochurn.sh/v1/customers/user_123/attributes \
  -H "Authorization: Bearer $NOCHURN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"attributes":{"signup_source":"ads","onboarding_done":true,"seats":3,"activated_at":"2026-03-16"}}'

Rules and limits

  • Keys: snake_case, starting with a letter, 40 characters at most (signup_source, not Signup Source).
  • Values: text (255 characters at most), numbers, booleans or dates (2026-03-16 or ISO 8601). Flatten objects and lists. null removes the key from the customer.
  • Types are locked: the type of a key is set by its first value; another type later answers 422 attribute_type_mismatch and writes nothing. POST /v1/attribute_definitions declares a key and its type before the first send.
  • 100 keys per account and mode. One more answers attribute_limit_reached.
  • Sensitive attributes: mark a key sensitive (PATCH /v1/attribute_definitions/{key}) and it is never sent to the AI.
  • Test and live mode keep separate attributes.

What to send first

signup_source and onboarding_done are the two the integration checklist looks for. Then, as you have them: signup_date, plan and billing_interval, company_size or seats, activated_at, last_active_at, the usage of your key feature, support_tickets or nps, country and industry, coupon_used, trial_days. The Custom data & AI page says which question each one answers.

Send them at signup and whenever they change (a signup handler, an after-save hook, a background job).

Usage events

POST /v1/usage_events records what a customer does: { customer, name, timestamp?, properties?, idempotency_key? }. POST /v1/usage_events/batch takes up to 1,000 events. Events are deduplicated on idempotency_key, rolled up each night into the attributes last_active_at, events_30d and <event>_30d, and never sent to the AI.

curl -X POST https://api.nochurn.sh/v1/usage_events -H "Authorization: Bearer $NOCHURN_API_KEY" -H "Content-Type: application/json" -d '{"customer":"user_123","name":"project_created","properties":{"template":"blank"},"idempotency_key":"evt_42"}'

From the browser, NoChurn’s script sends page_view and your own events to POST /v1/widget/events with the publishable key and the signed customer token: no secret key in the front end.

CSV import

POST /v1/imports takes a CSV of customers and attributes (multipart file, or the text as csv). Columns are mapped by name: customer, external_id, email, stripe_customer, name, country, locale; any other column becomes an attribute. dry_run returns the mapping and the first rows without writing. GET /v1/imports/{id} gives the error report.

What comes out

Data & AI ranks the attributes most linked to churn (GET /v1/insights), with the sample size of each group: correlation, not cause. The churn score of each customer (GET /v1/customers/{id}/score) uses them too.