Hi all
Looking at potentially doing a campaign where group of users get X days free access to app. Many of these are previous subscribers or trials that no longer have an active subscription.
I know on the customer level we can manually apply a single entitlement. Is there a way in the RevCat console to do this in bulk? e.g. all customers in a list (from RevCat customer list) get an entitlement applied?
Thanks
Way to bulk apply RevCat entitlements?
Hey
You can write a script that does this for you through our Grant a Promotional Entitlement endpoint. A bulk import for that endpoint is an interesting use case, I’ll add this as an idea for an API overhaul that we have planned on the future roadmap!
![One Year Wiser Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/199b3856-4040-459a-ac89-09699ef6f081_thumb.png)
Thanks
Would be benefical if we could create a customer list, then an action is apply entitlement. Right now we can only do it from a single customer.
Keep me posted
Thanks
Kim
Thanks Tina!, and Kim for the question
Just wanted to note the +1 here for the request.
We needed to provide an entitlement to all our existing users and that ended up being really time taking. In such cases, we also did not want to just keep issuing requests to revenue Cat and hit the rate limiters.
Also, since I always end up googling bash things, leaving a quick script for the other visitors
### Script revCatCommand.sh
user_id=$1
result=$(curl --request POST \
--url https://api.revenuecat.com/v1/subscribers/$1/entitlements/<entitlement_id>/promotional \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <secret>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": "<duration>"
}
')
if [[ "$result" == *"code"* ]]; then
echo $user_id >> failure_cases
else
echo $user_id >> success_cases
fi
exit 0
### Script to_run.sh
counter=1
while IFS= read -r user_id
do
bash revCatCommand.sh $user_id &
counter=$((counter+1))
if [[ $(($counter % 10)) == 0 ]]; then
sleep 1
fi
done < user_list.csv
+1 for this request also and thanks Harpeet for sharing your script too 🙏
Hi
I was wondering if there’s a way to grant entitlement permanently through an API endpoint — I noticed the duration parameter with the `lifetime` option has been deprecated.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.