You can’t get REST API Folder IDs from the Marketo Engage UI

The tl;dr: gotta use the API to use the API.

When browsing Marketing Activities, you’ll see the URL change to reflect Program IDs, Static List IDs, and Smart Campaign IDs:

.../marketo-engage/classic/PG3350A1
.../marketo-engage/classic/ST6331A1LA1
.../marketo-engage/classic/SC9850A1ZN19

In these cases, the first sequence of contiguous digits in the last path segment is the asset ID and can be used in the API. Above, you see Program ID 3350, Static List ID 6331, and Smart Campaign 9850. The structure works for Smart Lists as well. Other asset types like Forms and Emails also have their IDs in the URL.

Not Campaign Folders, though!

Selecting a Campaign Folder shows a tempting URL structure —

.../marketo-engage/classic/MF2421A1

— leading you to think the Folder ID is 2421. Nope, in this case 2421 is the “tree node” ID, which is a UI thing only. It’s not the same as the REST API Folder ID, which reflects the persistent structure in the database.

Worse, the actual Folder ID 2421 can be located somewhere else in the database (it’s also possible for there to be no true Folder ID with that value). So if you make a destructive change to Folder ID 2421 using the API — deleting tokens, for example, or blindly deleting all its children and then deleting the folder itself! — you’ve hit the wrong target entirely. Yikes.

The solution is to use the Folders API endpoints to retrieve Folder IDs. An extra step if you’re just doing one-off tasks using Postman, but all in all it’s better to learn how to use those APIs (in particular, the difference between a Program-type Folder and a Folder-type Folder).

Also, some folders don’t even have tree node IDs

As you open/close folders inside Programs (not Campaign Folders) and folders in the Database section, you’ll notice the URL doesn’t change. Those types of folder are more “virtual”: for example, they don’t support tokens and you can’t focus them in the UI. They still have Folder IDs, of course, which you can get from the Folders API.