# Querying and updating licenses

**URL:** <https://community.replicated.com/t/querying-and-updating-licenses/1009>\
**Category:** How do I?\
**Created:** [October 11, 2022, 5:05pm UTC](https://community.replicated.com/t/querying-and-updating-licenses/1009 "2022-10-11T17:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miquel](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@miquel](https://community.replicated.com/u/miquel)\
**Post date:** [October 11, 2022, 5:05pm UTC](https://community.replicated.com/t/querying-and-updating-licenses/1009/1 "2022-10-11T17:05:36Z")

</div>

Hi  
Is there any way to query and update an application license via CLI or API?  
I haven’t found any way to query the installed license and when using `kubectl kots install --license-file ...` on an already installed app I get a `license already exists` error.

What I’m looking for is to be able to set or update of an application in an automated and idempotent manner using Ansible. I have seen [Updating Licenses | Replicated Docs](https://docs.replicated.com/enterprise/updating-licenses) but that’s only for manual operations, not automated.

Thanks!

---

<div class="post-metadata">

**Author:** ![jdewinne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/jdewinne/32/152_2.png) [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Post date:** [October 11, 2022, 6:10pm UTC](https://community.replicated.com/t/querying-and-updating-licenses/1009/2 "2022-10-11T18:10:20Z")

</div>

I’m not sure if I fully understand what you’re trying to achieve. Are you trying to automate the installation of the application in a headless way (and update it always to the latest version on each run). In that case, you might want to look into the [upstream upgrade](https://docs.replicated.com/reference/kots-cli-upstream-upgrade) command.

Also, there is an [API](https://docs.replicated.com/vendor/licenses-referencing-fields#query-license-fields-from-the-api) exposed to query the license from within the cluster. Maybe that is what you’re looking for?
