# Duplicate entry in Template API

**URL:** <https://community.hubspot.com/t/duplicate-entry-in-template-api/11445>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [November 16, 2018, 9:09am UTC](https://community.hubspot.com/t/duplicate-entry-in-template-api/11445 "2018-11-16T09:09:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken\_netfluence](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ken_netfluence/32/13631_2.png) [@ken\_netfluence](https://community.hubspot.com/u/ken_netfluence)\
**Post date:** [November 16, 2018, 9:09am UTC](https://community.hubspot.com/t/duplicate-entry-in-template-api/11445/1 "2018-11-16T09:09:05Z")

</div>

Hi, I’m experiencing this error when i’m trying to migrate or copy to portal a certain template using the COS Template API.

I can’t find and delete the existing data that is causing the duplication of entry. any recommendation?

`{"errors":[],"message":"A conflicting entry already exists in table. com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'generated_layouts/123456789.html-5110200-0' for key 'path_portal_deleted_at'","succeeded":false}`

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [November 19, 2018, 7:43pm UTC](https://community.hubspot.com/t/duplicate-entry-in-template-api/11445/2 "2018-11-19T19:43:38Z")

</div>

Hi [@ken\_netfluence](https://community.hubspot.com/u/ken_netfluence), which endpoint are you using for this? I’m unaware of a documented endpoint that copies templates from portal to portal, only the one we have [in-app](https://knowledge.hubspot.com/articles/kcs_article/articles/kcs-article/cos-general/how-do-i-copy-a-blog-email-page-template-from-one-portal-to-another)

---

<div class="post-metadata">

**Author:** ![ken\_netfluence](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ken_netfluence/32/13631_2.png) [@ken\_netfluence](https://community.hubspot.com/u/ken_netfluence)\
**Post date:** [November 20, 2018, 9:00am UTC](https://community.hubspot.com/t/duplicate-entry-in-template-api/11445/3 "2018-11-20T09:00:22Z")

</div>

Hi [@Connor\_Barley](https://community.hubspot.com/u/connor_barley) i’m currently using the Templates API along with Pages API. anyways i already resolved it. it was just a duplicate name on template. i had to program and create a copy of the name with incremental value as a suffix.
