Articles / Privacy Law

  • uk-law
  • uk-gdpr
  • dpia
  • go
  • ico
  • data-protection

Does Your Go API Need a DPIA Before Launch? A Screening Guide

Short answer: usually not a full one, but you do need to have checked. A data protection impact assessment (DPIA) is mandatory under UK GDPR when processing is "likely to result in a high risk" to people. Most CRUD APIs are not that. Some quietly are, and the trigger is often a feature, not the data model.

This is general information, not legal advice. The edges depend on your facts, and I'll flag where.

What the law actually says

The rule is Article 35 of UK GDPR (legislation). Article 35(1) requires a DPIA before processing that is likely to result in high risk, particularly when using new technologies. The assessment has to come before the processing starts, which for an API means before launch, not after the first complaint.

Article 35(3) names three cases where one is always required:

  • systematic and extensive evaluation of people by automated processing, including profiling, that produces legal or similarly significant effects;
  • large-scale processing of special category data or criminal offence data;
  • systematic monitoring of a publicly accessible area on a large scale.

That list is not exhaustive. Article 35(4) has the ICO publish a further list of processing that needs a DPIA, and it has. That list is regulator guidance, not statute, but it is what the ICO will point at if you argue the point.

Screening your endpoints against the ICO list

The ICO's list covers things such as innovative technology, large-scale profiling, biometric or genetic data, data matching (combining datasets from different sources), "invisible" processing where people were not told directly, tracking of location or behaviour, targeting children, and processing that risks physical harm if the data leaks. Check the current wording at ico.org.uk rather than trusting my paraphrase.

For an API, translate that into questions about each endpoint:

  1. Does it accept or return health, biometric, genetic, political, religious or similar special category data?
  2. Does it score, rank, rate or decide something about a person automatically?
  3. Does it merge data from another source, or enrich a record from a third party?
  4. Does it record location or behaviour over time?
  5. Do the people in it never interact with you directly (a B2B API holding their customers' data, say)?
  6. Could children be among the users?

One "yes" is not an automatic DPIA. The ICO's position is that you must do one if you plan to carry out any type of processing on its list, and that you should consider one where you meet two or more of the European criteria it also references. In practice: one clear match, do it; a vague maybe, do it anyway or record why not.

The quiet trigger: a feature added later

Quick detour, because this is where APIs go wrong. A plain user-profile API is low risk. Then someone adds a "risk score" field, fed by device telemetry and a third-party fraud feed. Same JSON shape, same handler, and you've just picked up profiling, data matching and tracking.

So the question is not "what is in my database?" but "what does the API let someone do with it?" That is why a one-off assessment at launch ages badly, and why a cheap check on schema changes is worth having.

A tiny guard in Go

You can make new personal-data fields visible with a test. Tag each field with a category, and fail the build if one is untagged. It will not decide whether you need a DPIA; it forces a human to look when the shape changes.

package api

import (
	"reflect"
	"testing"
)

type SignupRequest struct {
	Email string `json:"email" pd:"identifier"`
	Name  string `json:"name" pd:"identifier"`
	DOB   string `json:"dob" pd:"identifier"`
	Plan  string `json:"plan" pd:"none"`
}

func TestEveryFieldClassified(t *testing.T) {
	typ := reflect.TypeOf(SignupRequest{})
	for i := 0; i < typ.NumField(); i++ {
		f := typ.Field(i)
		if f.Tag.Get("pd") == "" {
			t.Errorf("%s.%s has no pd tag: classify it and re-run the DPIA screen", typ.Name(), f.Name)
		}
	}
}

It only covers the request types you list, and it will not catch what a handler does with the data. It is a prompt, nothing more.

If you are the processor, not the controller

Hang on, whose DPIA is it? Article 35 binds the controller. If you build an API for a client who decides why and how the data is used, the duty sits with them, and under Article 28(3)(f) a processor must assist with it. If you run the API for your own purposes, you are the controller and it is yours.

The line can blur, for example when a vendor starts using customer data to train its own models. Who counts as controller is a question of fact, not of what the contract says.

What a DPIA must contain

Article 35(7) sets the minimum:

  • a systematic description of the processing and its purposes;
  • an assessment of necessity and proportionality;
  • an assessment of the risks to people (not to your business);
  • the measures you will take to address those risks.

It does not need to be long. For a small API it can be a few pages: data flows, retention, who can read what, and what happens when it goes wrong. If risk remains high after your mitigations, Article 36 requires you to consult the ICO before going ahead.

What if you skip it and it was needed?

Failing to carry out a required DPIA is an infringement of Article 35 and sits in the lower penalty tier: up to £8.7 million or 2% of worldwide turnover, whichever is higher (Article 83(4), as it applies in the UK). Fines at that level are rare for small teams. The more realistic cost is an ICO enquiry after a breach, where the first thing asked for is your assessment.

If you decide you do not need one, write down why. A dated paragraph saying "screened against the ICO list, no match, here is the reasoning" is cheap, and it is a far better position than silence.