Retrieve Salesforce report metadata with REST Explorer

Salesforce report metadata is reshaping how Salesforce professionals work — and this article breaks down everything you need to know.

Look, we’ve all been there. You’re staring at a report and the column names don’t match any field names you know. Instead of guessing or digging through Setup, I just pull the Salesforce report metadata using the REST API. It’s a lot faster than building a package.xml and waiting for a metadata retrieve just to see what’s under the hood.

Why you should check Salesforce report metadata via REST

I’ve seen teams spend hours trying to figure out why a report isn’t showing the right data. Sometimes it’s because the report is using a field from a related object that has the same name as a field on the primary object. It’s confusing, right? When you look at the raw Salesforce report metadata, there’s no more guessing. You see the exact API name and the object it’s coming from.

This is especially handy when you’re dealing with standard vs custom report types. Custom report types can hide or rename fields, which makes the UI a bit of a liar. The REST API tells you the truth about what the report is actually querying.

One thing that trips people up is thinking they need to be a hardcore developer to use this. You don’t. If you can copy and paste a URL into Workbench, you can do this in thirty seconds.

A professional UI mockup of a REST API explorer tool displaying structured JSON metadata in a syntax-highlighted code view.
A professional UI mockup of a REST API explorer tool displaying structured JSON metadata in a syntax-highlighted code view.

Step-by-step: Pulling Salesforce report metadata

You have a few options here. I usually use Workbench because it’s reliable, but if you’re into Salesforce Chrome extensions like Salesforce Inspector Reloaded, that works just as well. Here’s how I do it.

  1. First, grab the Report ID from your browser’s URL. It’s that 15 or 18-character string starting with 00O.
  2. Open up Workbench and head over to the REST Explorer.
  3. You’ll want to use the GET method.
  4. Enter this URL, swapping out the placeholder for your actual ID: /services/data/v62.0/analytics/reports/YOUR_REPORT_ID
  5. Hit “Execute” and wait for the JSON to pop up.

The raw request example

If you’re more of a command-line person, you can do the same thing with a curl command. It looks like this:

GET /services/data/v62.0/analytics/reports/00OGB00000Dt9Qv2AJ

Now, once you get that response back, don’t let the big wall of text scare you. You only need to look at a couple of specific spots to find the Salesforce report metadata you’re after.

How to read the JSON response

So what does this actually mean? When the results load, you’ll see a few folders or keys in the JSON. Here’s where it gets interesting. I always expand reportMetadata first. That’s where the detailColumns live. This list shows you every column in the report by its API name. No more “Account Name” vs “Company Name” confusion – you’ll see “Account.Name” plain as day.

But what if you need to see the actual data structure? Look at the factMap. This section breaks down the totals and the individual rows. If you’re troubleshooting a summary report, the aggregates section under T|T will show you exactly how Salesforce is calculating those totals.

Honestly, most teams get this wrong by trying to export the report to Excel to “reverse engineer” it. That’s a waste of time. Accessing the Salesforce report metadata directly gives you the blueprint of the report without all the noise.

Key Takeaways

  • The REST Explorer is the fastest way to see API names for report columns.
  • You don’t need to deploy any code or XML files to see the report structure.
  • The factMap section is your best friend for verifying aggregated data.
  • Checking the reportType in the metadata helps you confirm you’re using the right source.

Next time a stakeholder asks why a report isn’t matching their dashboard, don’t just click around the Report Builder. Run a quick GET request. It’s a professional move that saves you a ton of headache and makes you look like a wizard. It’s a simple habit, but it’s one of those things that separates the experts from the click-and-hope crowd.