# Close CRM card programmatically

**URL:** <https://community.hubspot.com/t/close-crm-card-programmatically/77405>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [March 17, 2023, 6:26am UTC](https://community.hubspot.com/t/close-crm-card-programmatically/77405 "2023-03-17T06:26:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IBuddhika](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ibuddhika/32/29572_2.png) [@IBuddhika](https://community.hubspot.com/u/IBuddhika)\
**Post date:** [March 17, 2023, 6:26am UTC](https://community.hubspot.com/t/close-crm-card-programmatically/77405/1 "2023-03-17T06:26:57Z")

</div>

Hello devs,

Does anyone know how to close a CRM card programmatically when we click on a button inside the CRM card?

Thanks.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 17, 2023, 9:57pm UTC](https://community.hubspot.com/t/close-crm-card-programmatically/77405/2 "2023-03-17T21:57:17Z")

</div>

Hey, @IBuddhika 👋 Thanks for reaching out. Let’s invite some of our community members to give their insights — hey @coldrickjack @PAtlan @himanshurauthan, do you have any tips or thoughts on how you’ve dealt with this when creating CRM cards?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![IBuddhika](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ibuddhika/32/29572_2.png) [@IBuddhika](https://community.hubspot.com/u/IBuddhika)\
**Post date:** [March 20, 2023, 4:41am UTC](https://community.hubspot.com/t/close-crm-card-programmatically/77405/3 "2023-03-20T04:41:11Z")

</div>

Hello Jaycee,

Thank you for calling other devs for help.

I could find the solutions here.

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-public-app-crm-cards-v3%2Fguide)**

We just needed to add simple line of code on button click.

window.parent.postMessage(JSON.stringify({“action”: “DONE”}), “\*”);

It did the trick.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 20, 2023, 3:36pm UTC](https://community.hubspot.com/t/close-crm-card-programmatically/77405/4 "2023-03-20T15:36:07Z")

</div>

Thank you very much for coming back and sharing what worked for you 🙌 — Jaycee
