{"id":435,"date":"2026-06-08T16:18:11","date_gmt":"2026-06-08T16:18:11","guid":{"rendered":"https:\/\/www.martech-magic.com\/?p=435"},"modified":"2026-06-17T10:17:34","modified_gmt":"2026-06-17T10:17:34","slug":"delete-overridden-folder-tokens-ii","status":"publish","type":"post","link":"https:\/\/www.martech-magic.com\/index.php\/2026\/06\/08\/delete-overridden-folder-tokens-ii\/","title":{"rendered":"Delete Overridden (Folder) Tokens II"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.martech-magic.com\/index.php\/2025\/11\/27\/delete-overridden-tokens\/\">Last time<\/a> I talked about how to use the API to delete overridden tokens. And all of that is still true, but I assumed that deleting a token from a folder would work the same way as deleting a token from a program. And it kind of does, but there&#8217;s a catch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The endpoint to delete any token is this one:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{{base_url}}\/rest\/asset\/v1\/folder\/3629\/tokens\/delete.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">where &#8220;3629&#8221; is the ID of the program you want to delete the token from. But what&#8217;s the ID of a folder?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Surprisingly, you won&#8217;t find this ID in the URL of the folder. If you have an URL like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;experience.adobe.com\/#\/@instancename\/so:munchkinID\/marketo-engage\/classic\/MF1778A1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">then 1778 is not the ID of the folder. I mean, probably it is, but it&#8217;s not the ID we need. The only way to find that ID is the API and the call &#8220;Get Folder by Name&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GET {{base_url}}\/rest\/asset\/v1\/folder\/byName.json?name=Learning<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So here we want to know the name of the folder &#8220;Learning&#8221;.<br><br>Here&#8217;s the result of this call:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"399\" src=\"https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image.png\" alt=\"\" class=\"wp-image-436\" srcset=\"https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image.png 554w, https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image-300x216.png 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So the ID of this folder is &#8220;108&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good, and now finally, let me give you some additions to the actual deletion call. You have to specify that you want to delete from a folder, and you have to specify the type of token you want to delete. I wanted to delete a Script Token, and the name of this type is actually <a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/marketo-developer\/marketo\/rest\/assets\/tokens\">not named in the docs<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"607\" height=\"280\" src=\"https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image-1.png\" alt=\"\" class=\"wp-image-437\" srcset=\"https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image-1.png 607w, https:\/\/www.martech-magic.com\/wp-content\/uploads\/2026\/06\/image-1-300x138.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the Folder ID in the URL, token name (&#8220;Salutation_German&#8221;), token type (&#8220;script block&#8221;) and folder type (&#8220;folder&#8221;) in the body.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deleting a folder token is a little tricky, because you most likely don&#8217;t know the folder&#8217;s ID. Here&#8217;s how it works.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,8,15],"tags":[],"class_list":["post-435","post","type-post","status-publish","format-standard","hentry","category-api","category-tipps-tricks","category-tokens","entry"],"_links":{"self":[{"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/posts\/435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/comments?post=435"}],"version-history":[{"count":4,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/posts\/435\/revisions"}],"predecessor-version":[{"id":442,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/posts\/435\/revisions\/442"}],"wp:attachment":[{"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/media?parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/categories?post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.martech-magic.com\/index.php\/wp-json\/wp\/v2\/tags?post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}