> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Returns a list of all user consents. Can be filtered by Active flag.



## OpenAPI

````yaml openapi/consent-v1.json GET /v1/UserConsents/all
openapi: 3.0.4
info:
  title: Consent API
  version: v1
servers:
  - url: https://{host}/consent
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - oauth2: []
paths:
  /v1/UserConsents/all:
    get:
      tags:
        - Service2Service
      summary: Returns a list of all user consents. Can be filtered by Active flag.
      parameters:
        - name: userId
          in: query
          description: The id of the user
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: The enum to filter the returned consents by activation.
          schema:
            $ref: '#/components/schemas/ConsentApi.Dto.Common.ConsentFilter'
      responses:
        '200':
          description: Collection of all user consents that match the filter.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConsentApi.Dto.Common.UserConsentDto'
        '400':
          description: UserId is invalid
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    ConsentApi.Dto.Common.ConsentFilter:
      enum:
        - NotActive
        - Active
        - All
        - AllAvailable
      type: string
      description: Filter options for querying consents by their status
    ConsentApi.Dto.Common.UserConsentDto:
      required:
        - acceptedAt
        - consent
        - expiresAt
        - isActive
      type: object
      properties:
        consent:
          $ref: >-
            #/components/schemas/ConsentApi.Dto.Common.UserConsentDto.ConsentInfoDto
        acceptedAt:
          type: string
          description: UTC date, when consent was accepted by user
          format: date-time
        expiresAt:
          type: string
          description: UTC date, when consent will expire
          format: date-time
        acceptedBy:
          type: string
          description: >-
            Who accepted the consent. It can be a user, member service
            representative, etc.
          nullable: true
        activationSource:
          type: string
          description: |-
            The source which triggered activation of UserConsent
            Possible values for Coop:
            "WEB" Internettet
            "EMAIL" E-mail
            "TELEF" Telefon
            "SKM" Skema
            "BUTIK" Samtykke i butik
            "MOAPP" MobilApp
            "M16AP" M16 MobilApp
            "FRDKA" Freemium APP DK
            "KNB" KNB NETOPRETTELSE
          nullable: true
        isActive:
          type: boolean
        revokedAt:
          type: string
          description: |-
            UTC date, when consent was revoked
            Null if consent is active
          format: date-time
          nullable: true
        revokedBy:
          type: string
          description: >-
            Who revoked the consent. It can be a user, member service
            representative, etc.
          nullable: true
        revocationSource:
          type: string
          description: The source which triggered revocation of UserConsent
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Metadata for user consent
          nullable: true
      additionalProperties: false
      description: DTO, represents user accepted consent instance
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    ConsentApi.Dto.Common.UserConsentDto.ConsentInfoDto:
      required:
        - component
        - id
        - revision
        - version
      type: object
      properties:
        id:
          minLength: 1
          type: string
          description: Consent unique identifier (across all consent types and versions)
        key:
          type: string
          description: Consent key, which is unique across different consent types
          nullable: true
        component:
          minLength: 1
          type: string
          description: Consent component (app etc)
        version:
          type: integer
          description: Version
          format: int32
        revision:
          type: integer
          description: Revision
          format: int32
      additionalProperties: false
      description: Consent instance information
  securitySchemes:
    oauth2:
      type: apiKey
      name: Authorization
      in: header

````