A DHIS2 API cheatsheet for everyday use

The DHIS2 Web API is one of the most powerful things about the platform, and one of the least explored. If you have ever wanted to query your metadata directly from the browser, download a clean CSV of your users, or filter data elements by any attribute you choose, this cheatsheet is where to start.

We put it together as a practical reference for developers and technically-minded implementers who work with DHIS2 regularly. It covers the four operations you will reach for most often, with real example URLs you can adapt and run directly against your own instance.

What the cheatsheet covers

Getting started is simpler than most people think. Add /api/resources to your instance URL to browse everything the API exposes. From there, navigate to any resource (say, /api/dataSets), grab an element’s ID, and append it to the URL to get full detail on that specific object. You can also search any ID across all resource types using /api/identifiableObjects/<id>.

Retrieving aggregated data uses the analytics resource, which lets you query data values across any combination of data elements, periods and organisation units. The cheatsheet includes worked examples for filtering by period and org unit simultaneously, and for applying measure criteria (greater than, less than) to return only the records you need.

Downloading metadata is a one-parameter addition: append .csv to any resource URL and ?paging=false to get the full list without pagination. The same logic applies for JSON exports. Useful for audits, migrations, and any time you need a clean extract outside the DHIS2 interface.

Filtering and customising responses is where the API becomes genuinely powerful. Use ?fields= to return only the attributes you need, and ?filter= with any of the standard operators (eq, gt, lt, in, like) to narrow results precisely. The cheatsheet lists the most commonly used endpoints as a quick reference: /api/users, /api/organisationUnits, /api/dataSets, /api/programs, /api/indicators, /api/programRules, /api/dataElements, /api/categories, /api/categoryCombos.

Download it

The cheatsheet is available as a PNG or PDF.

Keep going

If the cheatsheet opens more questions than it answers, these are the resources worth bookmarking:

This is a living document. If you have a tip, a correction, or an endpoint that deserves a spot on the next version, write to us.

Working on something similar? Let's talk.

Related Posts