---
title: "Create Consent Requests For Data Request"
method: POST
path: "/api/agreement/v1/data-requests/{id}/consent-requests"
tags: ["Data Requests"]
---

# Create Consent Requests For Data Request

`POST /api/agreement/v1/data-requests/{id}/consent-requests`

## Request

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

Creates the consent requests of a single data producer UID for a data request. A UID-based consent request is created if it does not exist yet. BURs may only be provided if the data request contains at least one BUR-based data product. When BURs are provided, they are validated against the UID's BURs in AGIS and a BUR-based consent request is created for each of them. Accessible to the consumer who owns the data request.

## Path parameters

- `id` string, uuid, required

## Request body

- CreateConsentRequestsForUidDto: Data transfer object used to create consent requests for a data producer UID and optionally its BURs
  - `uid` string, required: UID of the data producer
  - `burs` string[], required: BURs of the data producer. Required, but may be empty. Every BUR must belong to the UID in AGIS.

## Response `200`

OK

- ConsentRequestCreatedDto[]
  - `id` string, uuid, required
  - `dataProducerUid` string, required: UID of the data producer
  - `dataProducerBur` string: BUR of the data producer
  - `isCreated` boolean

## Other responses

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

## Changes

- **2026-10-19** `75957f6bdc66`: 5 warning
  - changed the pattern of the request property `burs/items/` from `^A\d{8}$` to `^[A-Za-z0-9]{8,9}$`
  - added the new `EXPORT_CAPACITY_EXHAUSTED` enum value to the `type` response property for the response status `404`
  - added the new `EXPORT_CAPACITY_EXHAUSTED` enum value to the `type` response property for the response status `500`
  - added the new `EXPORT_LIMIT_EXCEEDED` enum value to the `type` response property for the response status `404`
  - …1 more
- **2026-09-29** `3b78238ff219`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agridata/apis/agridata-ch-api/changes/api/agreement/v1/data-requests/:id/consent-requests/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/48ab7e1541c3?raw)
