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

# Update calendar sync live update

> Enable or disable live calendar updates for a connected provider. Enabling without stored provider metadata returns 422. Disabling keeps the OAuth connection metadata, matching the reference app toggle behavior.



## OpenAPI

````yaml /api/consumer.openapi.yaml patch /calendar-sync/{provider}/live-update
openapi: 3.1.0
info:
  title: YouNegotiate Consumer API
  version: '2.0'
  description: >-
    Stateless API endpoints for consumer portal authentication and account
    access.
servers:
  - url: https://api.consumer.younegotiate.com
    description: Production
security: []
tags:
  - name: System
    description: Public consumer domain system and health endpoints.
  - name: Authentication
    description: >-
      Consumer identity matching, contact capture, OTP verification, token
      creation, and logout endpoints.
  - name: Profile - My ecoAddress
    description: Consumer profile tab for signed-in identity / ecoAddress context.
  - name: Profile - Communication Controls
    description: >-
      Consumer profile tab for communication permissions, email/mobile changes,
      and email/mobile verification.
  - name: Profile - My Billing Details
    description: >-
      Consumer profile tab for billing name and billing address details used for
      payment verification.
  - name: Profile - Personalize My Portal
    description: Consumer profile tab for portal colors and profile image personalization.
  - name: Accounts
    description: Consumer-owned account list and account detail endpoints.
  - name: Bill Pay Wallet
    description: >-
      Consumer Bill Pay Wallet saved payment profiles and scheduled payment
      method update endpoints.
  - name: Upcoming Payments
    description: >-
      Consumer My Bill Pay Calendar upcoming-payment rows and calendar display
      data.
  - name: Calendar Sync
    description: >-
      Consumer Google and Microsoft calendar connection, OAuth callback, and
      live-update endpoints.
  - name: Gift Registry
    description: >-
      Consumer Bill Pay Gift Registry account list, shared registry, and Helping
      Hand link endpoints.
  - name: EcoMailbox
    description: Consumer MyEcoMailBox list endpoints and unread sidebar badge state.
  - name: Notice Responses
    description: >-
      Consumer My Account notice-response wizard endpoints for sender details
      and account details.
paths:
  /calendar-sync/{provider}/live-update:
    patch:
      tags:
        - Calendar Sync
      summary: Update calendar sync live update
      description: >-
        Enable or disable live calendar updates for a connected provider.
        Enabling without stored provider metadata returns 422. Disabling keeps
        the OAuth connection metadata, matching the reference app toggle
        behavior.
      operationId: consumerUpdateCalendarSyncLiveUpdate
      parameters:
        - $ref: '#/components/parameters/CalendarSyncProvider'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCalendarSyncLiveUpdateRequest'
      responses:
        '200':
          description: Live-update preference updated.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ConsumerCalendarSyncProviderStatusResponse
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/ProfileIncomplete'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  parameters:
    CalendarSyncProvider:
      name: provider
      in: path
      required: true
      description: Calendar provider slug.
      schema:
        type: string
        enum:
          - google
          - microsoft
  schemas:
    UpdateCalendarSyncLiveUpdateRequest:
      type: object
      required:
        - live_update
      properties:
        live_update:
          type: boolean
          description: Enable or disable live updates for the connected provider.
          example: true
    ConsumerCalendarSyncProviderStatusResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ConsumerCalendarSyncProviderStatus'
    ConsumerCalendarSyncProviderStatus:
      type: object
      required:
        - provider
        - connected
        - live_update
        - email
        - name
        - avatar
        - can_connect
        - can_reconnect
        - can_disconnect
        - disconnecting
      properties:
        provider:
          type: string
          enum:
            - google
            - microsoft
          example: google
        connected:
          type: boolean
          description: True when provider OAuth metadata with an access token is stored.
        live_update:
          type: boolean
          description: >-
            True when future payment changes should sync to the connected
            provider.
        email:
          type:
            - string
            - 'null'
          format: email
          example: consumer@gmail.com
        name:
          type:
            - string
            - 'null'
          example: Sem Karan
        avatar:
          type:
            - string
            - 'null'
          format: uri
          example: https://lh3.googleusercontent.com/avatar.png
        can_connect:
          type: boolean
          description: True when the provider is not connected yet.
        can_reconnect:
          type: boolean
          description: >-
            True when the provider is already connected and the frontend should
            show a reconnect option.
        can_disconnect:
          type: boolean
          description: >-
            True when the provider is connected and no disconnect is already
            running.
        disconnecting:
          type: boolean
          description: >-
            True while remote calendar events are being deleted and credentials
            are pending removal.
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ProfileIncompleteResponse:
      type: object
      required:
        - code
        - message
        - required_steps
      properties:
        code:
          type: string
          example: profile_incomplete
        message:
          type: string
          example: Please complete your communication profile before viewing accounts.
        required_steps:
          type: array
          items:
            type: string
          example:
            - profile_communication
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    ProfileIncomplete:
      description: >-
        The authenticated consumer profile must complete communication setup
        before My Account can be shown.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProfileIncompleteResponse'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum token

````