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

# Update appointment services, time, advisor, transport, or comments



## OpenAPI

````yaml https://api.sparkserv.com/public/api/swagger.json patch /appointments/{id}
openapi: 3.1.0
info:
  title: Spark Public API
  description: >-
    Dealership discovery and vehicle-specific appointment scheduling. Obtain a
    token with POST https://auth.sparkserv.com/oauth/token, Content-Type:
    application/json, and a body containing grant_type: client_credentials,
    client_id, client_secret, audience: https://api.sparkserv.com/public, and
    the requested scope string. Send Authorization: Bearer <access_token> on API
    requests. Keep client secrets on your server, not in browser applications.
    Required scopes must be granted both in the token and on the active Spark
    API client. Dealership access follows its acting-user team memberships.
    Availability is not a reservation. Booking has no durable idempotency
    guarantee. Do not blindly retry mutations after timeouts or unknown
    outcomes; Spark appointment reads are local snapshots, not proof of the
    current upstream state. Unknown outcomes require reconciliation with the
    dealership or scheduler.
  version: '1'
  contact: {}
servers:
  - url: https://api.sparkserv.com/public/v1
    description: Current API environment
security: []
tags: []
paths:
  /appointments/{id}:
    patch:
      tags:
        - Appointments
      summary: Update appointment services, time, advisor, transport, or comments
      operationId: updatePublicAppointmentV1
      parameters:
        - name: id
          required: true
          in: path
          description: Spark appointment UUIDv4
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        description: >-
          Supply at least one of services, appointmentAt, advisorId,
          transportId, or comments. Omitted fields are preserved.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAppointmentUpdateV1Dto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAppointmentV1ResponseDto'
        '400':
          description: >-
            Invalid request. Inspect code and details and correct the input
            before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                invalidInput:
                  summary: Correct the request fields
                  value:
                    statusCode: 400
                    code: INVALID_INPUT
                    message: Request validation failed
        '401':
          description: >-
            Missing, invalid or expired client-credentials token, or an inactive
            client. Obtain a valid token for an active client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                unauthorized:
                  summary: Authenticate with an active client
                  value:
                    statusCode: 401
                    code: UNAUTHORIZED
                    message: The request could not be completed
        '403':
          description: The token or active API client lacks a required action scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                forbidden:
                  summary: Grant the required scope and obtain a new token
                  value:
                    statusCode: 403
                    code: FORBIDDEN
                    message: The request could not be completed
        '404':
          description: >-
            The resource does not exist or is outside the client's dealership
            access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                notFound:
                  summary: Check the resource and dealership access
                  value:
                    statusCode: 404
                    code: NOT_FOUND
                    message: Resource not found
        '409':
          description: >-
            The appointment cannot be edited or the selected slot is no longer
            available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                appointmentNotEditable:
                  summary: Appointment is not editable
                  value:
                    statusCode: 409
                    code: APPOINTMENT_NOT_EDITABLE
                    message: Only future pending appointments can be updated
                slotUnavailable:
                  summary: Refresh availability and select a new slot
                  value:
                    statusCode: 409
                    code: SLOT_UNAVAILABLE
                    message: The selected appointment time is not available
        '422':
          description: >-
            The scheduler does not support updates, or the requested services,
            comments, or stored scheduling selections cannot be used. Move
            updates are unsupported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                operationUnsupported:
                  summary: Use a scheduler that supports updates
                  value:
                    statusCode: 422
                    code: OPERATION_UNSUPPORTED
                    message: Updates are not supported by this scheduler
        '500':
          description: An unexpected server error prevented the request from completing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                requestFailed:
                  summary: Report the unexpected failure
                  value:
                    statusCode: 500
                    code: REQUEST_FAILED
                    message: The request could not be completed
        '502':
          description: >-
            Preflight discovery may fail before an appointment write is
            attempted (for example SCHEDULER_UNAVAILABLE or AMBIGUOUS_SERVICES).
            UPDATE_OUTCOME_UNKNOWN means the write could not be confirmed; do
            not retry blindly. REPLACEMENT_PARTIAL_FAILURE means the original
            appointment was canceled and replacement was not confirmed; request
            operator review.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponseDto'
              examples:
                schedulerUnavailable:
                  summary: Retry discovery after the scheduler recovers
                  value:
                    statusCode: 502
                    code: SCHEDULER_UNAVAILABLE
                    message: The scheduler could not complete the request
                updateOutcomeUnknown:
                  summary: Reconcile before retrying
                  value:
                    statusCode: 502
                    code: UPDATE_OUTCOME_UNKNOWN
                    message: >-
                      Update could not be confirmed; check the appointment
                      before retrying
                replacementPartialFailure:
                  summary: Original appointment canceled; operator review required
                  value:
                    statusCode: 502
                    code: REPLACEMENT_PARTIAL_FAILURE
                    message: >-
                      The original appointment was canceled but replacement
                      could not be confirmed
                    details:
                      appointmentId: f6eeb938-cabe-4a4d-a38d-a47583e074e5
      security:
        - oauth2:
            - appointments:update
components:
  schemas:
    PublicAppointmentUpdateV1Dto:
      type: object
      properties:
        advisorId:
          type: string
          description: Advisor ID from discovery; omission preserves the current advisor
        transportId:
          type: string
          description: >-
            Transport ID from discovery; omission preserves the current
            transport
        comments:
          type: string
          description: >-
            Appointment-level public comments; omission preserves the current
            comments
        appointmentAt:
          type: string
          format: date-time
          description: Omission preserves the current time; an explicit offset is required
        services:
          minItems: 1
          description: >-
            Replaces selected services; omission preserves historical rows.
            Supply at least one update field.
          type: array
          items:
            $ref: '#/components/schemas/PublicAppointmentServiceV1Dto'
      additionalProperties: false
    PublicAppointmentV1ResponseDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
      required:
        - id
    PublicApiErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: integer
        code:
          type: string
          description: Stable machine-readable error code
        message:
          type: string
        details:
          description: >-
            Validation messages or contextual fields/choices; never raw
            scheduler error data
          oneOf:
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: string
      required:
        - statusCode
        - code
        - message
    PublicAppointmentServiceV1Dto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        comments:
          oneOf:
            - type: string
              description: >-
                Omitted or null uses the service default; an empty string clears
                optional comments
            - type: 'null'
      required:
        - id
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.sparkserv.com/oauth/token
          scopes:
            appointments:update: appointments:update
            appointments:cancel: appointments:cancel
            dealerships:read: dealerships:read
            scheduling:read: scheduling:read
            customers:read: customers:read
            appointments:read: appointments:read
            appointments:create: appointments:create

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.