From 9cb190f4b41d1bcaa9c38794feefa8dab38d839b Mon Sep 17 00:00:00 2001 From: Karoline Tufte Lien Date: Mon, 29 Jun 2026 14:05:48 +0200 Subject: [PATCH 1/3] docs: correct DELETE response status code [DHIS2-17360] The developer manual stated that a successful metadata DELETE returns HTTP 204 (no content). The API actually returns 200 OK with a WebMessage body wrapping an ObjectReport for the deleted object, and has done so across all supported versions. Update the docs to match the actual, long-standing behaviour. AI Assisted --- src/developer/web-api/metadata.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/developer/web-api/metadata.md b/src/developer/web-api/metadata.md index 48c229612..cea67b0c9 100644 --- a/src/developer/web-api/metadata.md +++ b/src/developer/web-api/metadata.md @@ -638,7 +638,23 @@ request to the endpoint + id: curl -X DELETE -u user:password "http://server/api/constants/ID" ``` -A successful delete should return HTTP status 204 (no content). +A successful delete returns HTTP status `200 OK` with a `WebMessage` +response body wrapping an `ObjectReport` for the deleted object, for +example: + +```json +{ + "httpStatus": "OK", + "httpStatusCode": 200, + "status": "OK", + "response": { + "responseType": "ObjectReport", + "uid": "abc123", + "klass": "org.hisp.dhis.constant.Constant", + "errorReports": [] + } +} +``` ### Adding and removing objects in collections { #webapi_adding_removing_objects_collections } From 6c7fb34a4688fe4094f1ae5cfaf7801fd4d762fc Mon Sep 17 00:00:00 2001 From: Karoline Tufte Lien Date: Tue, 30 Jun 2026 11:58:50 +0200 Subject: [PATCH 2/3] docs: fix aggregate data exchange DELETE status code [DHIS2-17360] The "Delete aggregate data exchange" response was documented as 204 No Content while the example body right below it shows the actual 200 OK WebMessage/ObjectReport. AggregateDataExchangeController extends AbstractCrudController, so its DELETE returns 200 OK like all other metadata deletes. Correct the documented status code. AI Assisted --- src/developer/web-api/data-exchange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/developer/web-api/data-exchange.md b/src/developer/web-api/data-exchange.md index 7e39c51f2..f145d9b2a 100644 --- a/src/developer/web-api/data-exchange.md +++ b/src/developer/web-api/data-exchange.md @@ -284,7 +284,7 @@ DELETE /api/aggregateDataExchanges/{id} ##### Response ``` -204 No Content +200 OK ``` ```json From 29aea7bcda74db2167dde26488e8af0bdd078251 Mon Sep 17 00:00:00 2001 From: Karoline Tufte Lien Date: Tue, 30 Jun 2026 12:03:27 +0200 Subject: [PATCH 3/3] docs: fix translations validation error status code [DHIS2-17360] PUT /api/{type}/{uid}/translations returns 409 Conflict (not 404 Not Found) on a validation error such as a duplicate property+locale pair: TranslationsCheck adds an ObjectReport with error E1106, and replaceTranslations returns objectReport(...) which resolves to a 409 WebMessage. The 204 No Content success code was already correct. Also fix the copy-paste "data value" wording (this endpoint saves translations). AI Assisted --- src/developer/web-api/metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/developer/web-api/metadata.md b/src/developer/web-api/metadata.md index cea67b0c9..3b5665821 100644 --- a/src/developer/web-api/metadata.md +++ b/src/developer/web-api/metadata.md @@ -237,7 +237,7 @@ translations for the specific object and not just for a single locale (if not you will potentially overwrite existing locales for other locales). -The status code will be `204 No Content` if the data value was successfully saved or updated, or `404 Not Found` if there was a validation error (e.g. more than one `SHORT_NAME` for the same `locale`). +The status code will be `204 No Content` if the translations were successfully saved or updated, or `409 Conflict` if there was a validation error (e.g. more than one `SHORT_NAME` for the same `locale`). ### Web API versions { #webapi_api_versions }