> ## 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.

# Updates the metadata of a user consent



## OpenAPI

````yaml openapi/consent-v1.json PUT /v1/UserConsents/metadata
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/metadata:
    put:
      tags:
        - Service2Service
      summary: Updates the metadata of a user consent
      requestBody:
        description: The DTO containing the updated metadata
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ConsentApi.Dto.Service2Service.UpdateUserConsentMetadataDto
      responses:
        '200':
          description: User consent metadata updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentApi.Dto.Common.UserConsentDto'
        '400':
          description: Invalid UserConsentId or consentId
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    ConsentApi.Dto.Service2Service.UpdateUserConsentMetadataDto:
      type: object
      properties:
        consentId:
          type: string
          description: Consent identifier
          nullable: true
        userId:
          type: string
          description: User identifier
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Metadata for user consent
          nullable: true
      additionalProperties: false
      description: DTO for updating user consent metadata
    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

````