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

# Update customer consent

> Update customer consent preferences according to IAB TCF (Transparency and Consent Framework) standards.



## OpenAPI

````yaml PATCH /customers/{id}/consent
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /customers/{id}/consent:
    patch:
      description: >-
        Update customer consent preferences according to IAB TCF (Transparency
        and Consent Framework) standards.
      parameters:
        - in: path
          name: id
          description: The customer unique identifier in your system
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerConsentUpdate'
            example: {}
        required: true
      responses:
        '200':
          description: Customer consent updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      consent:
                        $ref: '#/components/schemas/Consent'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid consent data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomerConsentUpdate:
      type: object
      required:
        - consent
      properties:
        consent:
          $ref: '#/components/schemas/Consent'
    Consent:
      type: object
      required:
        - consent_string
      properties:
        version:
          type: string
          description: IAB TCF version
          example: '2.0'
        consent_timestamp:
          type: string
          format: date-time
          description: The timestamp when consent was given
        customer_id:
          type: string
          description: The customer unique identifier
        purposes:
          $ref: '#/components/schemas/ConsentPurposes'
        vendors:
          type: object
          description: 'Vendor consent mapping (vendor_id: boolean)'
          additionalProperties:
            type: boolean
          example:
            vendor_123: true
            vendor_456: false
        consent_string:
          type: string
          description: >-
            IAB TCF consent string in base64url format, starting with 'CO',
            minimum 20 characters, maximum 500 characters
          example: COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA
          minLength: 20
          maxLength: 500
          pattern: ^CO[A-Za-z0-9_-]+$
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    ConsentPurposes:
      type: object
      properties:
        behavioral_campaigns:
          type: boolean
          description: Consent for behavioral campaigns
        coupon_campaigns:
          type: boolean
          description: Consent for coupon campaigns
        punchcard_campaigns:
          type: boolean
          description: Consent for punchcard campaigns
        email_marketing:
          type: boolean
          description: Consent for email marketing
        push_notifications:
          type: boolean
          description: Consent for push notifications
        link_tracking:
          type: boolean
          description: Consent for link tracking
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````