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

# Get charge schedule execution

> Returns the recorded state of a previously issued charge schedule create or delete request, identified by its execution id. The response includes data.attributes.action ("create" or "delete") so callers can distinguish which operation the record describes. The execution of any operation issued by the calling application can be read, regardless of the user or vehicle it was issued for. Every charge schedule response includes this endpoint's URL in data.links.self, so follow that link to check an operation's status, or to follow the operation named in meta.blockingOperation of an OPERATION_IN_PROGRESS error.

When a request returns 202, its `Location` header holds this endpoint's URL, and its outcome is available only here. Poll this endpoint every Retry-After seconds until status.value is no longer PENDING. Every operation reaches a final status, so this loop always ends. Today that takes at most about 5 minutes from `meta.executedAt`, but the limit may change, so don't rely on a fixed timeout. If `meta.requestId` no longer matches the one you received, the execution now describes a newer operation, and yours has finished.

A status.value of EXPIRED means the operation didn't record a result within the time allowed, so the outcome is unknown: it may or may not have taken effect on the vehicle. It no longer blocks other requests, so you can retry it.

An execution is kept for at least 30 days after its most recent operation. After it is removed, this endpoint returns 404.




## OpenAPI

````yaml /specs/full-vehicle.yaml get /charge-schedule-executions/{executionId}
openapi: 3.0.3
info:
  title: Smartcar Vehicle API (Complete)
  version: 3.0.0
  description: API for vehicle data (signals) and operations (commands).
servers:
  - url: https://vehicle.api.smartcar.com/v3
security: []
tags:
  - name: Charging
    description: Commands for controlling vehicle charging behavior.
  - name: Security
    description: Commands for controlling vehicle door locks.
  - name: Navigation
    description: Commands for setting destinations in the vehicle navigation system.
  - name: Command Executions
    description: Retrieve the recorded result of a previously issued vehicle command.
  - name: Charge Schedules
    description: Create and delete recurring charge schedules on a vehicle.
  - name: Schedule Executions
    description: >-
      Retrieve the recorded result of a previously issued schedule create or
      delete request.
  - name: Charge
    description: Signals and attributes for the Charge group.
  - name: Climate
    description: Signals and attributes for the Climate group.
  - name: Closure
    description: Signals and attributes for the Closure group.
  - name: ConnectivitySoftware
    description: Signals and attributes for the ConnectivitySoftware group.
  - name: ConnectivityStatus
    description: Signals and attributes for the ConnectivityStatus group.
  - name: Diagnostics
    description: Signals and attributes for the Diagnostics group.
  - name: HVAC
    description: Signals and attributes for the HVAC group.
  - name: InternalCombustionEngine
    description: Signals and attributes for the InternalCombustionEngine group.
  - name: Location
    description: Signals and attributes for the Location group.
  - name: LowVoltageBattery
    description: Signals and attributes for the LowVoltageBattery group.
  - name: Motion
    description: Signals and attributes for the Motion group.
  - name: Odometer
    description: Signals and attributes for the Odometer group.
  - name: Service
    description: Signals and attributes for the Service group.
  - name: Surveillance
    description: Signals and attributes for the Surveillance group.
  - name: TractionBattery
    description: Signals and attributes for the TractionBattery group.
  - name: Transmission
    description: Signals and attributes for the Transmission group.
  - name: VehicleIdentification
    description: Signals and attributes for the VehicleIdentification group.
  - name: VehicleUserAccount
    description: Signals and attributes for the VehicleUserAccount group.
  - name: Wheel
    description: Signals and attributes for the Wheel group.
paths:
  /charge-schedule-executions/{executionId}:
    get:
      tags:
        - Schedule Executions
      summary: Get charge schedule execution
      description: >
        Returns the recorded state of a previously issued charge schedule create
        or delete request, identified by its execution id. The response includes
        data.attributes.action ("create" or "delete") so callers can distinguish
        which operation the record describes. The execution of any operation
        issued by the calling application can be read, regardless of the user or
        vehicle it was issued for. Every charge schedule response includes this
        endpoint's URL in data.links.self, so follow that link to check an
        operation's status, or to follow the operation named in
        meta.blockingOperation of an OPERATION_IN_PROGRESS error.


        When a request returns 202, its `Location` header holds this endpoint's
        URL, and its outcome is available only here. Poll this endpoint every
        Retry-After seconds until status.value is no longer PENDING. Every
        operation reaches a final status, so this loop always ends. Today that
        takes at most about 5 minutes from `meta.executedAt`, but the limit may
        change, so don't rely on a fixed timeout. If `meta.requestId` no longer
        matches the one you received, the execution now describes a newer
        operation, and yours has finished.


        A status.value of EXPIRED means the operation didn't record a result
        within the time allowed, so the outcome is unknown: it may or may not
        have taken effect on the vehicle. It no longer blocks other requests, so
        you can retry it.


        An execution is kept for at least 30 days after its most recent
        operation. After it is removed, this endpoint returns 404.
      operationId: getChargeScheduleExecution
      parameters:
        - $ref: '#/components/parameters/ExecutionId'
      responses:
        '200':
          $ref: '#/components/responses/ScheduleExecutionResponse'
        '400':
          $ref: '#/components/responses/BadRequest2'
        '401':
          $ref: '#/components/responses/Unauthorized2'
        '403':
          $ref: '#/components/responses/Forbidden2'
        '404':
          $ref: '#/components/responses/NotFound2'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError2'
      security:
        - bearerAuth: []
components:
  parameters:
    ExecutionId:
      in: path
      name: executionId
      required: true
      description: >
        The id returned as data.id in the response that initiated the operation,
        or as meta.blockingOperation.id on an OPERATION_IN_PROGRESS error.
      schema:
        type: string
        pattern: ^exec_[A-Za-z0-9_-]{22}$
      example: exec_5VMuu6yNbuwNcf8ANim75g
  responses:
    ScheduleExecutionResponse:
      description: Schedule execution response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ScheduleExecutionResponse'
          examples:
            create_success_200:
              summary: Create — finished within the wait time
              value:
                data:
                  id: exec_u30M8e5ErKC8wPc5t3uTXw
                  type: charge-schedule-execution
                  attributes:
                    action: create
                    scheduleType: daily
                    status:
                      value: SUCCESS
                    executionMode: sync
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    scheduleId: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
                    parameters:
                      location:
                        latitude: 37.7749
                        longitude: -122.4194
                      startTime: '08:00'
                      stopTime: '10:00'
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_u30M8e5ErKC8wPc5t3uTXw
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
                    completedAt: '2024-01-01T12:00:02Z'
                    durationInSeconds: 2
            delete_success_200:
              summary: Delete — finished within the wait time
              value:
                data:
                  id: exec_bJsZy5Z7Vj2dlrNBrUqJpw
                  type: charge-schedule-execution
                  attributes:
                    action: delete
                    status:
                      value: SUCCESS
                    executionMode: sync
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    scheduleId: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_bJsZy5Z7Vj2dlrNBrUqJpw
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
                    completedAt: '2024-01-01T12:00:02Z'
                    durationInSeconds: 2
            create_success_after_202:
              summary: Create — succeeded after a 202
              value:
                data:
                  id: exec_5VMuu6yNbuwNcf8ANim75g
                  type: charge-schedule-execution
                  attributes:
                    action: create
                    scheduleType: daily
                    status:
                      value: SUCCESS
                    executionMode: async
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    scheduleId: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
                    parameters:
                      location:
                        latitude: 37.7749
                        longitude: -122.4194
                      startTime: '08:00'
                      stopTime: '10:00'
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_5VMuu6yNbuwNcf8ANim75g
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
                    completedAt: '2024-01-01T12:03:10Z'
                    durationInSeconds: 190
            delete_failure_after_202:
              summary: Delete — failed after a 202
              value:
                data:
                  id: exec_bJsZy5Z7Vj2dlrNBrUqJpw
                  type: charge-schedule-execution
                  attributes:
                    action: delete
                    status:
                      value: FAILURE
                      error:
                        status: '500'
                        type: VEHICLE
                        code: SCHEDULE_DELETE_FAILED
                        title: Schedule Delete Failed
                        detail: The vehicle was unable to delete the charge schedule.
                        links:
                          about: >-
                            https://smartcar.com/docs/errors/api-errors/v3/schedule-delete-failed
                    executionMode: async
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    scheduleId: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_bJsZy5Z7Vj2dlrNBrUqJpw
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
                    completedAt: '2024-01-01T12:03:10Z'
                    durationInSeconds: 190
            pending:
              summary: In progress, within the wait time
              value:
                data:
                  id: exec_5VMuu6yNbuwNcf8ANim75g
                  type: charge-schedule-execution
                  attributes:
                    action: create
                    scheduleType: daily
                    status:
                      value: PENDING
                    executionMode: sync
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    parameters:
                      location:
                        latitude: 37.7749
                        longitude: -122.4194
                      startTime: '08:00'
                      stopTime: '10:00'
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_5VMuu6yNbuwNcf8ANim75g
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
            expired:
              summary: Expired — outcome unknown, can be retried
              value:
                data:
                  id: exec_5VMuu6yNbuwNcf8ANim75g
                  type: charge-schedule-execution
                  attributes:
                    action: delete
                    status:
                      value: EXPIRED
                    executionMode: async
                    userId: user_789xyz
                    vehicleId: 36ab27d0-fd9d-4455-823a-ce30af709ffc
                    scheduleId: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
                  links:
                    self: >-
                      https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_5VMuu6yNbuwNcf8ANim75g
                  meta:
                    executedAt: '2024-01-01T12:00:00Z'
                    requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
    BadRequest2:
      description: 400 Bad Request
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '400'
                type: VALIDATION
                code: BAD_REQUEST
                title: Bad Request
                detail: >-
                  The request could not be understood by the server due to
                  malformed syntax.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/validation-errors
    Unauthorized2:
      description: 401 Unauthorized
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '401'
                type: AUTHENTICATION
                code: UNAUTHORIZED
                title: Unauthorized
                detail: The Authorization token is missing or invalid.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication
    Forbidden2:
      description: 403 Forbidden
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '403'
                type: AUTHENTICATION
                code: FORBIDDEN
                title: Forbidden
                detail: You do not have permission to access this resource.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/authentication-errors
    NotFound2:
      description: 404 Not Found
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '404'
                type: RESOURCE_NOT_FOUND
                code: NOT_FOUND
                title: Not Found
                detail: The requested resource could not be found.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors
    TooManyRequests:
      description: 429 Too Many Requests
      headers:
        retry-after:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
          example: 60
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '429'
                type: RATE_LIMIT
                code: SMARTCAR_API
                title: Too Many Requests
                detail: >-
                  You have reached the throttling rate limit for this vehicle.
                  Please see the retry-after header for when to retry the
                  request.
                links:
                  about: >-
                    https://smartcar.com/docs/errors/api-errors/v3/rate-limit-errors
    InternalError2:
      description: 500 Internal Server Error
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - status
                    - type
                    - code
                    - title
                    - detail
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                      enum:
                        - AUTHENTICATION
                        - BILLING
                        - COMPATIBILITY
                        - CONNECTED_SERVICES_ACCOUNT
                        - RATE_LIMIT
                        - RESOURCE_NOT_FOUND
                        - SERVER
                        - UPSTREAM
                        - VALIDATION
                        - VEHICLE_STATE
                    code:
                      type: string
                    title:
                      type: string
                    detail:
                      type: string
                    resolution:
                      type: object
                      description: >-
                        Optional field providing guidance on how to resolve the
                        error, if applicable. The structure of this object can
                        vary based on the error type and is intended to provide
                        actionable information to clients.
                      properties:
                        type:
                          type: string
                          description: >-
                            The type of resolution recommended (e.g.,
                            "RETRY_LATER", "CONTACT_SUPPORT", etc.)
                    suggestedUserMessage:
                      type: string
                      description: >-
                        Optional field providing a user-friendly message that
                        can be displayed to end-users, if applicable. This
                        message is intended to be easily understandable and
                        actionable for users who encounter the error.
                    links:
                      type: object
                      properties:
                        about:
                          type: string
                          format: uri
                    meta:
                      type: object
                      properties:
                        debug:
                          type: object
                          description: >
                            Information that helps Smartcar support investigate
                            this error. Include it when contacting support.
                            Clients should not parse it or build logic on it.
                          properties:
                            applicationId:
                              type: string
                              description: The unique identifier for the application
                            requestId:
                              type: string
                              description: >
                                Opaque support reference for this error; quote
                                it to support. May differ from `meta.requestId`.
                            origin:
                              type: string
                              description: The origin of the error
                          example:
                            applicationId: app_123abc
                            requestId: >-
                              8c2f7d1e-5b3a-4c9e-a1f2-3d4e5f6a7b8c:5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                            origin: internal.com/path
          example:
            errors:
              - status: '500'
                type: SERVER
                code: INTERNAL
                title: Internal Server Error
                detail: An unexpected error occurred on the server.
                links:
                  about: https://smartcar.com/docs/errors/api-errors/v3/server-errors
  schemas:
    ScheduleExecutionResponse:
      type: object
      required:
        - data
      description: >
        Response to a charge schedule create or delete request.
        data.attributes.action identifies the operation ("create" or "delete").
        data.attributes.scheduleId is the id of the schedule: for a create, it
        appears once the schedule has been created successfully; for a delete,
        it is the id from the request path. data.links.self contains the URL of
        this execution resource.
      properties:
        data:
          type: object
          required:
            - id
            - type
            - attributes
            - links
            - meta
          properties:
            id:
              type: string
              description: >
                The identifier of the execution for this schedule operation on
                this vehicle, for this application and user. It does not
                identify a single request: every create for the same schedule
                type and location, or every delete for the same scheduleId,
                returns the same id. The execution reflects the most recent
                operation for that combination, and each new operation replaces
                the previous one.
              example: exec_u30M8e5ErKC8wPc5t3uTXw
            type:
              type: string
              enum:
                - charge-schedule-execution
              description: Resource type, always "charge-schedule-execution".
            attributes:
              $ref: '#/components/schemas/ScheduleExecutionAttributes'
            links:
              type: object
              required:
                - self
              properties:
                self:
                  type: string
                  format: uri
                  description: >
                    The execution resource for this charge schedule operation.
                    GET this URL to check the operation's status.
                  example: >-
                    https://vehicle.api.smartcar.com/v3/charge-schedule-executions/exec_u30M8e5ErKC8wPc5t3uTXw
            meta:
              $ref: '#/components/schemas/ExecutionMeta'
    ScheduleExecutionAttributes:
      type: object
      required:
        - action
        - status
        - executionMode
        - userId
        - vehicleId
      properties:
        action:
          type: string
          enum:
            - create
            - delete
          readOnly: true
          description: >
            The operation that was executed. "create" for POST schedule
            requests; "delete" for DELETE schedule requests. Reported in the
            response only.
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
          description: The type of schedule that was acted on.
        userId:
          type: string
          readOnly: true
          description: >
            The id of the vehicle user on whose behalf the schedule operation
            was executed. Reported in the response only.
          example: user_789xyz
        vehicleId:
          type: string
          readOnly: true
          description: >
            The id of the vehicle the schedule operation was executed on.
            Reported in the response only.
          example: 36ab27d0-fd9d-4455-823a-ce30af709ffc
        status:
          $ref: '#/components/schemas/ExecutionStatus'
        executionMode:
          type: string
          enum:
            - sync
            - async
          readOnly: true
          description: >
            `sync`: the outcome was returned in the response to the original
            request. `async`: the original request returned `202`, so the
            outcome had to be read by polling this execution. Reported in the
            response only — callers cannot specify this.
        parameters:
          description: >
            The parameters submitted with the schedule create request. Mirrors
            request body data.attributes. Absent on delete operations.
          oneOf:
            - $ref: '#/components/schemas/DailyChargeSchedule'
            - $ref: '#/components/schemas/WeekdayChargeSchedule'
            - $ref: '#/components/schemas/WorkWeekChargeSchedule'
        scheduleId:
          type: string
          description: >
            The id of the schedule acted on. For "create" operations, present
            only on SUCCESS, because the id is assigned by the vehicle on
            creation and does not exist until then; it is absent while a create
            is PENDING or EXPIRED, and when it fails. Use this id to delete the
            schedule. For "delete" operations, always present: it is the id from
            the request path, whatever the outcome.
          example: 8f2c4e1a-6b3d-4f7e-9a2c-1d5e8b7f3a60
    ExecutionMeta:
      type: object
      required:
        - executedAt
        - requestId
      properties:
        executedAt:
          type: string
          format: date-time
          description: ISO 8601 UTC timestamp when the operation started.
        requestId:
          type: string
          readOnly: true
          description: >
            The `X-Amzn-Requestid` response header value of the call that
            initiated the operation described in this execution.
        completedAt:
          type: string
          format: date-time
          description: >
            ISO 8601 UTC timestamp when the operation completed. Absent while
            `status.value` is `PENDING` or `EXPIRED`.
        durationInSeconds:
          type: integer
          description: >
            Elapsed time from the operation's start to its completion, in
            seconds. Absent while `status.value` is `PENDING` or `EXPIRED`.
      example:
        executedAt: '2024-01-01T12:00:00Z'
        requestId: 3f9a2c1b-7d4e-4b8a-9c6f-1e2d3a4b5c6d
        completedAt: '2024-01-01T12:00:02Z'
        durationInSeconds: 2
    ScheduleType:
      type: string
      description: Schedule type
      enum:
        - daily
        - weekly
        - workweek
    ExecutionStatus:
      type: object
      required:
        - value
      properties:
        value:
          type: string
          description: >
            The state of the operation.

            - `PENDING`: the operation is in progress.

            - `SUCCESS`: the operation completed successfully.

            - `FAILURE`: the operation failed. `error` describes why.

            - `EXPIRED`: the operation didn't record a result within the time
            allowed, so the outcome is unknown: it may or may not have taken
            effect on the vehicle. It no longer blocks other requests, so you
            can retry it.
          enum:
            - SUCCESS
            - FAILURE
            - PENDING
            - EXPIRED
        error:
          $ref: '#/components/schemas/ExecutionError'
      example:
        value: SUCCESS
    DailyChargeSchedule:
      description: >
        A charge window that repeats every day. If stopTime is earlier than
        startTime, the window runs overnight and ends the next day (for example,
        23:00 to 03:00). startTime and stopTime must be different.
      allOf:
        - type: object
          required:
            - location
            - startTime
            - stopTime
          properties:
            location:
              $ref: '#/components/schemas/NavigationPoint'
        - $ref: '#/components/schemas/Timeframe'
    WeekdayChargeSchedule:
      type: object
      required:
        - location
        - days
      properties:
        location:
          $ref: '#/components/schemas/NavigationPoint'
        days:
          type: object
          description: >
            Per-day charge windows. Include only the days you want to configure;
            omitted days are not scheduled. At least one day must be provided.
            Keys other than the day names below are ignored.
          minProperties: 1
          properties:
            monday:
              $ref: '#/components/schemas/Timeframe'
            tuesday:
              $ref: '#/components/schemas/Timeframe'
            wednesday:
              $ref: '#/components/schemas/Timeframe'
            thursday:
              $ref: '#/components/schemas/Timeframe'
            friday:
              $ref: '#/components/schemas/Timeframe'
            saturday:
              $ref: '#/components/schemas/Timeframe'
            sunday:
              $ref: '#/components/schemas/Timeframe'
    WorkWeekChargeSchedule:
      type: object
      required:
        - location
        - weekdays
        - weekends
      properties:
        location:
          $ref: '#/components/schemas/NavigationPoint'
        weekdays:
          $ref: '#/components/schemas/Timeframe'
        weekends:
          $ref: '#/components/schemas/Timeframe'
    ExecutionError:
      type: object
      description: >-
        Error details present when `status.value` is `FAILURE`. Failure details
        appear here only when the execution resource is read through the
        execution GET, e.g. after a 202. A request that fails within the wait
        time is answered with the error's HTTP status and an `ErrorResponse`.
      required:
        - status
        - type
        - code
      properties:
        status:
          type: string
        type:
          type: string
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        links:
          type: object
          properties:
            about:
              type: string
              format: uri
        resolution:
          type: object
          description: Guidance on resolving the error. Structure varies by error type.
          additionalProperties: true
        suggestedUserMessage:
          type: string
          description: A user-facing message that can be displayed directly to end users.
    NavigationPoint:
      type: object
      description: Geographic point
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          format: double
          minimum: -90
          maximum: 90
          description: The latitude coordinate of the location point (-90 to 90)
        longitude:
          type: number
          format: double
          minimum: -180
          maximum: 180
          description: The longitude coordinate of the location point (-180 to 180)
      example:
        latitude: 37.7749
        longitude: -122.4194
    Timeframe:
      type: object
      required:
        - startTime
        - stopTime
      description: A time window within a day, expressed as a start and stop time.
      properties:
        startTime:
          $ref: '#/components/schemas/TimeString'
        stopTime:
          $ref: '#/components/schemas/TimeString'
      example:
        startTime: '08:00'
        stopTime: '10:00'
    TimeString:
      type: string
      description: >
        A 24-hour clock time in HH:MM format. Used to express a time of day for
        scheduling

        purposes (e.g. when a charge schedule should activate). Valid values
        range from

        "00:00" (midnight) to "23:59".


        This value is intentionally timezone-naive — it represents a clock time
        within a day.
      pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
      example: '08:00'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or opaque
      description: |
        The Authorization header must be provided with a valid bearer token.
        Example: `Authorization: Bearer {token}`

````