> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.spott.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update consent

> Partially update an existing consent record. Only the provided fields will be updated.



## OpenAPI

````yaml /openapi-private.json patch /consents/{consentId}
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /consents/{consentId}:
    patch:
      tags:
        - Consents
      summary: Update consent
      description: >-
        Partially update an existing consent record. Only the provided fields
        will be updated.
      operationId: updateConsent
      parameters:
        - name: consentId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConsentDto'
      responses:
        '204':
          description: Consent updated successfully
        '400':
          description: Bad request - invalid consent data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '404':
          description: Consent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
      security:
        - x-api-key: []
components:
  schemas:
    UpdateConsentDto:
      type: object
      properties:
        framework:
          anyOf:
            - $ref: '#/components/schemas/ConsentFramework'
            - type: 'null'
          description: The regulatory framework
        legalBasis:
          $ref: '#/components/schemas/ConsentLegalBasis'
          description: The legal basis for the consent
        purpose:
          $ref: '#/components/schemas/ConsentPurposeRequestDto'
        comments:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: Free text field for additional comments
        receivedAt:
          $ref: '#/components/schemas/DateISO'
        validUntil:
          $ref: '#/components/schemas/DateISO'
        status:
          $ref: '#/components/schemas/ConsentStatus'
          description: The status of the consent
      id: PrivateUpdateConsentDto
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
      id: ExceptionBaseDto
    ConsentFramework:
      type: string
      enum:
        - GDPR
        - PDPO
      id: ConsentFramework
    ConsentLegalBasis:
      type: string
      enum:
        - CONSENT
        - CONTRACT
        - LEGAL_OBLIGATION
        - VITAL_INTEREST
        - PUBLIC_TASK
        - LEGITIMATE_INTEREST
      id: ConsentLegalBasis
    ConsentPurposeRequestDto:
      oneOf:
        - $ref: '#/components/schemas/SystemConsentPurposeRequestDto'
        - $ref: '#/components/schemas/CustomConsentPurposeRequestDto'
      description: The purpose of the consent
      id: PrivateConsentPurposeRequestDto
    DateISO:
      id: DateISO
      format: date-time
      anyOf:
        - type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
    ConsentStatus:
      type: string
      enum:
        - GRANTED
        - REVOKED
      id: ConsentStatus
    SystemConsentPurposeRequestDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - system
        name:
          $ref: '#/components/schemas/SystemConsentPurpose'
          description: The purpose of the consent
      required:
        - type
        - name
      id: PrivateSystemConsentPurposeRequestDto
    CustomConsentPurposeRequestDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - custom
        id:
          type: string
          minLength: 1
      required:
        - type
        - id
      id: PrivateCustomConsentPurposeRequestDto
    SystemConsentPurpose:
      type: string
      enum:
        - RECRUITING
        - MARKETING_EMAIL
        - MARKETING_SMS
        - WHATSAPP_BUSINESS_UTILITY
        - WHATSAPP_BUSINESS_MARKETING
      id: SystemConsentPurpose
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Get your API key from Settings → API Keys in
        your Spott dashboard.

````