API Upload for Custom Traits

See documentation here for information related to authentication.

Add or Update a trait on a customer

curl --include \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: XXXYYY" \
--data-binary "{
\"customer_id\": \"cus_12345\",
\"category\": \"super power\",
\"bucket\": \"invisibility\"
}" \
'https://api.profitwell.com/v2/customer_traits/trait/'

This is a create or update to a trait attached to a particular customer by customer id. Each customer can only have one bucket per category. If a subsequent request for the same customer comes with {"category": "super power", "bucket": "speed"} that will update the existing from invisibility to speed.

Requests can be made by email address:

curl --include \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: XXXYYY" \
--data-binary "{
\"email\": \"bruce@waynecorp.com\",
\"category\": \"super power\",
\"bucket\": \"gadgets\"
}" \
'https://api.profitwell.com/v2/customer_traits/trait/'

This will attach the trait to all customers that have the provided email address.

Note — We recognize that some of your custom traits may not apply to all of your customers and extrapolation doesn't make much sense. For example, you have a segment of customers that are enterprise customers and have dedicated account managers. The bulk of your self-serve customers don't have account managers assigned to them. In these cases, we recommend assigning an N/A trait to these customers. If customers are unlabeled, ProfitWell will extrapolate existing data onto those customers.

Removing a trait

curl --include \
--request DELETE \
--header "Content-Type: application/json" \
--header "Authorization: XXXYYY" \
--data-binary "{
\"email\": \"bruce@waynecorp.com\",
\"category\": \"super power\",
\"bucket\": \"gadgets\"
}" \
'https://api.profitwell.com/v2/customer_traits/trait/'

Validation

The following will receive 400 response:

  • Blank and any of the following: None, "#N/A" values for either category or bucket are invalid.
  • Adding a trait to customer that already has the exact category, bucket combination
  • Removing a trait that the customer does not have
  • Using any of the following provided category names in either form:
    • "account_age_category"
    • "age_category"
    • "country"
    • "employer_industry"
    • "employer_size"
    • "engagement_quartile"
    • "gender"
    • "job_category"
    • "mrr_quartile"
    • "twitter_followers_category"

Reminder there is no check preventing the update of a trait. If a customer presently has a trait for a category, subsequent requests with that customer for the category will update the bucket as long as it is different than before.

Formating

We will not apply any formatting to the values for category and bucket. You should send these in the format that you wish to see them in. These values are case-sensitive, so super power and Super Power will be considered to be different categories.

Categories

Delete a category

curl --include \
--request DELETE \
--header "Content-Type: application/json" \
--header "Authorization: XXXYYY" \
--data-binary "{
\"category\": \"super power\"
}" \
'https://api.profitwell.com/v2/customer_traits/category/'

Deleting a category will remove it from every customer that has a trait for the specified category. This action is irreversible. Any subsequent request that contains the category will create a new category from scratch.

Note on the UI, you can also "hide" categories, which will temporarily remove it from the segmentation drawer. This can be un-done.


How did we do?


Powered by HelpDocs (opens in a new tab)