---
title: "Trigger Data Request Termination"
method: POST
path: "/api/agreement/v1/data-requests/termination"
tags: ["Data Requests"]
---

# Trigger Data Request Termination

`POST /api/agreement/v1/data-requests/termination`

## Request

- The document declares no server URL.
- Auth: OpenID Connect (`http://localhost:6999/realms/agate/.well-known/openid-configuration`, scopes: `agridata.ch.Agridata_Admin`)

Triggers the termination of data requests whose termination period has expired, which otherwise runs as a scheduled nightly job, and waits for it to finish. Only accessible to administrators. The run is guarded by the same cluster-wide advisory lock as the scheduled job, so a conflict is reported if a run is already in progress.

## Response `200`

OK

- DataRequestTerminationResultDto: Data transfer object representing the result of a data request termination run
  - `terminatedCount` integer: Number of data requests that were terminated during this run
  - `failedCount` integer: Number of data requests that could not be terminated during this run
  - `durationMs` integer: Duration of the run in milliseconds

## Other responses

- `401`: Not Authorized
- `403`: Not Allowed
- `404`: The resource or element was not found
- `500`: Internal server error: unexpected error

## Changes

- **2026-11-18** `97a4400c64d9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agridata/apis/agridata-ch-api/changes/api/agreement/v1/data-requests/termination/post.md)

---

[API](https://skmtc.dev/agridata/apis/agridata-ch-api.md) - [All operations](https://skmtc.dev/agridata/apis/agridata-ch-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agridata/apis/agridata-ch-api/revisions/97a4400c64d9?raw)
