---
title: "Get Consent Request Aggregations"
method: GET
path: "/api/agreement/v1/consent-request-aggregations"
tags: ["Consent Request Aggregations"]
---

# Get Consent Request Aggregations

`GET /api/agreement/v1/consent-request-aggregations`

Retrieves aggregated consent requests for the current data producer, grouped by data request.

## Query parameters

- `dataProducerUid` string, required

## Response `200`

OK

- ConsentRequestAggregationProducerView[]
  - `id` string, uuid, required
  - `dataProducerUid` string — UID of the data producer
  - `stateCode` 'GRANTED' | 'OPENED' | 'DECLINED' | 'PARTIALLY_GRANTED' | 'PARTIALLY_OPENED'
  - `showStateAsMigrated` boolean — Indicates whether the aggregated state originates from migrated consent requests
  - `lastStateChangeDate` string, date-time
  - `requestDate` string, date
  - `dataRequest` object — Details of the underlying data request
    - `id` string, uuid, required
    - `dataProviderId` string, uuid
    - `dataSourceSystemId` string, uuid
    - `dataSourceSystem` DataSourceSystemReferenceDto
      - `id` string, uuid
      - `code` string — Stable technical code of the source
      - `name` TranslationDto
        - `de` string
        - `fr` string
        - `it` string
      - `dataProvider` DataProviderReferenceDto, required
        - `id` string, uuid
        - `code` string — Stable technical code of the provider
        - `name` TranslationDto
          - `de` string
          - `fr` string
          - `it` string
        - `uid` string — UID of the data provider
    - `humanFriendlyId` string — Human friendly id of the data request
    - `submissionDate` string, date — Date and time when the data request was submitted
    - `title` DataRequestTitleDto
      - `de` string
      - `fr` string
      - `it` string
    - `description` DataRequestDescriptionDto
      - `de` string — Description of the data request
      - `fr` string — Description de la demande de données
      - `it` string — Descrizione della richiesta di dati
    - `purpose` DataRequestPurposeDto
      - `de` string
      - `fr` string
      - `it` string
    - `products` string[] — List of data products requested
    - `stateCode` union, required — State of the data request
      - 'DRAFT' | 'IN_REVIEW' | 'TO_BE_SIGNED_BY_CONSUMER' | 'TO_BE_RELEASED_BY_CONSUMER' | 'TO_BE_SIGNED_BY_PROVIDER' | 'TO_BE_RELEASED_BY_PROVIDER' | 'TO_BE_ACTIVATED' | 'ACTIVE'
      - object
    - `dataConsumerLegalName` string — LegalName of the data consumer taken from the uid register
    - `dataConsumerDisplayName` string — Shorter name of the data consumer defined by the data consumer used when displaying the request to the producer
    - `dataConsumerUid` string — Uid of the data consumer
    - `dataConsumerCity` string — City of the data consumer
    - `dataConsumerZip` string — Zip code of the data consumer
    - `dataConsumerStreet` string — Street of the data consumer
    - `dataConsumerCountry` string — 2 letter country code of the data consumer
    - `contactPhoneNumber` string — Contact phone number for the data request
    - `contactEmailAddress` string — Contact email address for the data request
    - `dataConsumerLogoBase64` string — Base64-encoded logo of the data consumer
    - `targetGroup` string
    - `validRedirectUriRegex` string — Regex of valid redirect_uri. Must compile as regex successfully.
    - `currentContractRevisionId` string, uuid
    - `consumerSignatureType` 'INDIVIDUAL_SIGNATURE' | 'COLLECTIVE_SIGNATURE'
    - `providerSignatureType` 'INDIVIDUAL_SIGNATURE' | 'COLLECTIVE_SIGNATURE'
    - `advantages` DataRequestAdvantageDto[], required — A list of advantages to the producer for sharing their data
      - `de` string
      - `fr` string
      - `it` string
  - `consentRequests` ConsentRequestProducerViewDto[]
    - `id` string, uuid, required
    - `dataProducerUid` string — UID of the data producer
    - `stateCode` 'GRANTED' | 'OPENED' | 'DECLINED' | 'NOT_CREATED' — Possible states of a consent request: - GRANTED: Consent has been granted - OPENED: Consent request is open and awaiting response - DECLINED: Consent has been declined - NOT_CREATED: Placeholder to indicate that no consent request exists yet for a given UID.
    - `showStateAsMigrated` boolean — If the state should be shown as migrated
    - `lastStateChangeDate` string, date — Date and time when the state was changed last
    - `requestDate` string, date
    - `dataRequest` object — Details of the underlying data request
      - `id` string, uuid, required
      - `dataProviderId` string, uuid
      - `dataSourceSystemId` string, uuid
      - `dataSourceSystem` DataSourceSystemReferenceDto
        - `id` string, uuid
        - `code` string — Stable technical code of the source
        - `name` TranslationDto
          - `de` string
          - `fr` string
          - `it` string
        - `dataProvider` DataProviderReferenceDto, required
          - `id` string, uuid
          - `code` string — Stable technical code of the provider
          - `name` TranslationDto
            - `de` string
            - `fr` string
            - `it` string
          - `uid` string — UID of the data provider
      - `humanFriendlyId` string — Human friendly id of the data request
      - `submissionDate` string, date — Date and time when the data request was submitted
      - `title` DataRequestTitleDto
        - `de` string
        - `fr` string
        - `it` string
      - `description` DataRequestDescriptionDto
        - `de` string — Description of the data request
        - `fr` string — Description de la demande de données
        - `it` string — Descrizione della richiesta di dati
      - `purpose` DataRequestPurposeDto
        - `de` string
        - `fr` string
        - `it` string
      - `products` string[] — List of data products requested
      - `stateCode` union, required — State of the data request
        - 'DRAFT' | 'IN_REVIEW' | 'TO_BE_SIGNED_BY_CONSUMER' | 'TO_BE_RELEASED_BY_CONSUMER' | 'TO_BE_SIGNED_BY_PROVIDER' | 'TO_BE_RELEASED_BY_PROVIDER' | 'TO_BE_ACTIVATED' | 'ACTIVE'
        - object
      - `dataConsumerLegalName` string — LegalName of the data consumer taken from the uid register
      - `dataConsumerDisplayName` string — Shorter name of the data consumer defined by the data consumer used when displaying the request to the producer
      - `dataConsumerUid` string — Uid of the data consumer
      - `dataConsumerCity` string — City of the data consumer
      - `dataConsumerZip` string — Zip code of the data consumer
      - `dataConsumerStreet` string — Street of the data consumer
      - `dataConsumerCountry` string — 2 letter country code of the data consumer
      - `contactPhoneNumber` string — Contact phone number for the data request
      - `contactEmailAddress` string — Contact email address for the data request
      - `dataConsumerLogoBase64` string — Base64-encoded logo of the data consumer
      - `targetGroup` string
      - `validRedirectUriRegex` string — Regex of valid redirect_uri. Must compile as regex successfully.
      - `currentContractRevisionId` string, uuid
      - `consumerSignatureType` 'INDIVIDUAL_SIGNATURE' | 'COLLECTIVE_SIGNATURE'
      - `providerSignatureType` 'INDIVIDUAL_SIGNATURE' | 'COLLECTIVE_SIGNATURE'
      - `advantages` DataRequestAdvantageDto[], required — A list of advantages to the producer for sharing their data
        - `de` string
        - `fr` string
        - `it` string

## Other responses

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

---

[API](https://skmtc.net/agridata/apis/agridata-ch-api.md) · [All operations](https://skmtc.net/agridata/apis/agridata-ch-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agridata/agridata-ch-api/versions/4f3c6bfcfcfd/schema)
