# Not possible to upload DND templates through CLI?

**URL:** <https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194>\
**Category:** CMS Development\
**Created:** [June 18, 2021, 7:42pm UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194 "2021-06-18T19:42:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [June 18, 2021, 7:42pm UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194/1 "2021-06-18T19:42:39Z")

</div>

I can fetch all templates ok, including dnd templates. But when I try to upload them to my development portal I get the error

" User does not have permission to create the resource with id XXXXXXXXXX."

---

<div class="post-metadata">

**Author:** ![Gonzalo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gonzalo/32/106671_2.png) [@Gonzalo](https://community.hubspot.com/u/Gonzalo)\
**Post date:** [June 21, 2021, 12:39pm UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194/2 "2021-06-21T12:39:07Z")

</div>

I think you may have an issue related to HS permissions.

I would recommend first removing your current [personal key](https://app.hubspot.com/portal-recommend/l?slug=personal-access-key) and regenerate it, making sure you activated the right scopes.

If it doesn’t work, make sure you have the right permissions on your account for that portal.  
Quick links:

Permission settings: [Portal Recommend | HubSpot](https://app.hubspot.com/portal-recommend/l?slug=settings/users)

Permission guide: [HubSpot user permissions guide](https://knowledge.hubspot.com/settings/hubspot-user-permissions-guide)

CMS personal key: [Portal Recommend | HubSpot](https://app.hubspot.com/portal-recommend/l?slug=personal-access-key)

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [June 21, 2021, 12:59pm UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194/3 "2021-06-21T12:59:11Z")

</div>

Thanks for the reply,

I reissued my permission key but to no avail. I have total access to my developer portal, am super admin etc.

Perhaps I can clarify a bit: It’s drag and drop templates that won’t upload. Coded templates work fine.

---

<div class="post-metadata">

**Author:** ![Gonzalo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gonzalo/32/106671_2.png) [@Gonzalo](https://community.hubspot.com/u/Gonzalo)\
**Post date:** [June 21, 2021, 1:54pm UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194/4 "2021-06-21T13:54:29Z")

</div>

My bad, I assumed by drag&drop the “new” dnd areas for coded templates.  
If you are referring to old dnd templates I think you are right (just tested, in case you may have a syntax error) but no luck here. Not even with --debug to see some extra insight. Seems like it’s (or will be soon) deprecated:

> **[Drag and Drop Templates - HubSpot docs](https://developers.hubspot.com/docs/cms/start-building/building-blocks/drag-and-drop/drag-and-drop-templates)**
>
> Drag and Drop Design Manager templates are templates built using a visual builder. They are not recommended for new templates as coded templates provide a better experience.

I believe the best way you can do something similar is with the API, you will need the global API key tho, so may not be ideal (and you will need a wrapper to work locally and handle the requests).

Extra links for API clients, in case you wanna go that route:

- [Node.js](https://github.com/HubSpot/hubspot-api-nodejs)

- [PHP](https://github.com/HubSpot/hubspot-api-php)

- [Python](https://github.com/HubSpot/hubspot-api-python)

- [Ruby](https://github.com/HubSpot/hubspot-api-ruby)

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [June 23, 2021, 11:19am UTC](https://community.hubspot.com/t/not-possible-to-upload-dnd-templates-through-cli/39194/5 "2021-06-23T11:19:27Z")

</div>

Hi @BarryGrennan ,  
Sometimes these issues are happened because of a config file. You can create a new file or check the permissions.  
Kindly refer to this document [Authenticate the CLI with personal access keys - HubSpot docs](https://developers.hubspot.com/docs/cms/personal-access-key)

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.
