Microsoft Windows 10 Tasks API

The Tasks API from Microsoft Windows 10 — 2 operation(s) for tasks.

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/uwp/api/
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/uwp/get-started/
📖
Documentation
https://learn.microsoft.com/en-us/windows/win32/apiindex/windows-api-list
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/win32/desktop-programming
📖
Documentation
https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/adaptive-interactive-toasts
📖
Documentation
https://learn.microsoft.com/en-us/windows/ai/windows-ml/api-reference
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/ai/windows-ml/get-started
📖
Documentation
https://learn.microsoft.com/en-us/uwp/api/windows.storage
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/uwp/files/
📖
Documentation
https://learn.microsoft.com/en-us/cortana/voice-commands/vcd
📖
Documentation
https://learn.microsoft.com/en-us/uwp/api/windows.ui.input.inking
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/uwp/design/input/pen-and-stylus-interactions
📖
Documentation
https://learn.microsoft.com/en-us/windows/uwp/composition/visual-layer
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/uwp/composition/using-the-visual-layer-with-xaml
📖
Documentation
https://learn.microsoft.com/en-us/windows/win32/directx
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/win32/getting-started-with-directx-graphics
📖
Documentation
https://learn.microsoft.com/en-us/windows/apps/develop/audio-video-camera
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/win32/medfound/audio-video-capture-in-media-foundation
📖
Documentation
https://learn.microsoft.com/en-us/windows/uwp/networking/which-networking-technology
📖
Documentation
https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/bluetooth-dev-faq
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/win32/bluetooth/bluetooth-programming-with-windows-sockets
📖
Documentation
https://learn.microsoft.com/en-us/uwp/api/windows.devices.geolocation
📖
Documentation
https://learn.microsoft.com/en-us/windows/win32/sensorsapi/introduction-to-the-sensor-and-location-platform-in-windows
📖
Documentation
https://learn.microsoft.com/en-us/windows/apps/develop/security/windows-hello
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/apps/develop/security/windows-hello-auth-service
📖
Documentation
https://learn.microsoft.com/en-us/windows/apps/winui/winui2/
📖
GettingStarted
https://learn.microsoft.com/en-us/windows/apps/winui/winui2/getting-started
📖
Documentation
https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/applifecycle/background-tasks

Specifications

Other Resources

🔗
Samples
https://github.com/Microsoft/Windows-universal-samples
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/
🔗
SDKs
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/
🔗
Reference
https://learn.microsoft.com/en-us/windows/win32/api/
🔗
Samples
https://github.com/microsoft/Windows-classic-samples
🔗
Samples
https://github.com/WindowsNotifications/quickstart-sending-local-toast-win10
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications
🔗
Tutorials
https://learn.microsoft.com/en-us/windows/ai/windows-ml/tutorials
🔗
Samples
https://github.com/Microsoft/Windows-Machine-Learning
🔗
Best Practices
https://learn.microsoft.com/en-us/windows/uwp/files/best-practices-for-writing-to-files
🔗
Guidelines
https://learn.microsoft.com/en-us/cortana/voice-commands/voicecommand-design-guidelines
🔗
Samples
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/SimpleInk
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/windows.ui.composition
🔗
Samples
https://github.com/microsoft/Windows.UI.Composition-Win32-Samples
🔗
Samples
https://github.com/microsoft/DirectX-Graphics-Samples
🔗
Reference
https://microsoft.github.io/DirectX-Specs/
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/windows.media.capture
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/windows.networking.sockets
🔗
Samples
https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/websocket/
🔗
Reference
https://learn.microsoft.com/en-us/windows/win32/api/_bluetooth/
🔗
Reference
https://learn.microsoft.com/en-us/windows/win32/locationapi/windows-location-api-portal
🔗
Samples
https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/geolocation/
🔗
Reference
https://learn.microsoft.com/en-us/uwp/api/windows.devices.sensors
🔗
Reference
https://learn.microsoft.com/en-us/windows/security/identity-protection/hello-for-business/webauthn-apis
🔗
Reference
https://learn.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls
🔗
Samples
https://github.com/microsoft/microsoft-ui-xaml
🔗
Samples
https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/backgroundtask/

OpenAPI Specification

microsoft-windows-10-tasks-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft Windows 10 Windows Background Accelerometer Tasks API
  description: API for running code in the background when an application is suspended or not running. Based on the Windows.ApplicationModel.Background namespace, it supports time-triggered, system-triggered, and maintenance-triggered background tasks. Key classes include BackgroundTaskBuilder, BackgroundTaskRegistration, SystemTrigger, TimeTrigger, and BackgroundTaskCompletedEventArgs.
  version: 1.0.0
  contact:
    name: Microsoft Developer Support
    url: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/applifecycle/background-tasks
  license:
    name: Microsoft Software License
    url: https://www.microsoft.com/en-us/legal/terms-of-use
servers:
- url: https://api.windows.com
  description: Windows Platform API
tags:
- name: Tasks
paths:
  /background-tasks:
    get:
      operationId: listBackgroundTasks
      summary: Microsoft Windows 10 List registered background tasks
      description: Retrieves the list of registered background tasks using BackgroundTaskRegistration.AllTasks. Returns all tasks registered by the current application including their name, trigger type, conditions, and last run status.
      tags:
      - Tasks
      responses:
        '200':
          description: Successful retrieval of background tasks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BackgroundTask'
    post:
      operationId: registerBackgroundTask
      summary: Microsoft Windows 10 Register a background task
      description: Registers a new background task using BackgroundTaskBuilder. The task must specify an entry point (IBackgroundTask implementation), a trigger (SystemTrigger, TimeTrigger, MaintenanceTrigger, etc.), and optional conditions (InternetAvailable, UserPresent, etc.).
      tags:
      - Tasks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTaskRequest'
      responses:
        '201':
          description: Background task registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackgroundTask'
        '400':
          description: Invalid task configuration
        '409':
          description: Task with same name already registered
  /background-tasks/{taskId}:
    get:
      operationId: getBackgroundTask
      summary: Microsoft Windows 10 Get background task details
      description: Retrieves details about a specific registered background task including its trigger type, conditions, progress, and completion history.
      tags:
      - Tasks
      parameters:
      - name: taskId
        in: path
        required: true
        description: Background task registration ID
        schema:
          type: string
      responses:
        '200':
          description: Successful retrieval of task details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackgroundTaskDetail'
        '404':
          description: Task not found
    delete:
      operationId: unregisterBackgroundTask
      summary: Microsoft Windows 10 Unregister a background task
      description: Unregisters a background task using BackgroundTaskRegistration.Unregister. Optionally cancels any currently running instance of the task.
      tags:
      - Tasks
      parameters:
      - name: taskId
        in: path
        required: true
        description: Background task registration ID
        schema:
          type: string
      - name: cancelRunningTask
        in: query
        required: false
        description: Whether to cancel a running instance
        schema:
          type: boolean
          default: true
      responses:
        '204':
          description: Task unregistered
        '404':
          description: Task not found
components:
  schemas:
    BackgroundTaskDetail:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        entryPoint:
          type: string
          description: Fully qualified class name implementing IBackgroundTask
        trigger:
          type: object
          properties:
            type:
              type: string
            parameters:
              type: object
              additionalProperties:
                type: string
        conditions:
          type: array
          items:
            type: string
            enum:
            - InternetAvailable
            - InternetNotAvailable
            - SessionConnected
            - SessionDisconnected
            - UserPresent
            - UserNotPresent
            - FreeNetworkAvailable
            - BackgroundWorkCostNotHigh
        progress:
          type: integer
          description: Current progress (0-100)
        lastCompletedTime:
          type: string
          format: date-time
        lastRunResult:
          type: string
          description: Result of the last execution
    BackgroundTask:
      type: object
      description: A registered background task
      properties:
        id:
          type: string
          description: Task registration ID
        name:
          type: string
          description: Task name
        triggerType:
          type: string
          description: Type of trigger
        isActive:
          type: boolean
          description: Whether the task is currently active
      required:
      - id
      - name
    RegisterTaskRequest:
      type: object
      properties:
        name:
          type: string
          description: Unique task name
        entryPoint:
          type: string
          description: Fully qualified class name implementing IBackgroundTask
        trigger:
          type: object
          properties:
            type:
              type: string
              enum:
              - SystemTrigger
              - TimeTrigger
              - MaintenanceTrigger
              - PushNotificationTrigger
              - LocationTrigger
              - BluetoothLEAdvertisementWatcherTrigger
              - DeviceUseTrigger
              - ActivitySensorTrigger
              - GattCharacteristicNotificationTrigger
              - MediaProcessingTrigger
              description: Trigger type
            systemTriggerType:
              type: string
              enum:
              - SmsReceived
              - UserPresent
              - UserAway
              - NetworkStateChange
              - ControlChannelReset
              - InternetAvailable
              - SessionConnected
              - ServicingComplete
              - LockScreenApplicationAdded
              - LockScreenApplicationRemoved
              - TimeZoneChange
              - OnlineIdConnectedStateChange
              - BackgroundWorkCostChange
              - PowerStateChange
              description: System trigger type (for SystemTrigger)
            freshnessTime:
              type: integer
              description: Interval in minutes (for TimeTrigger)
            oneShot:
              type: boolean
              description: Whether the trigger fires only once
          required:
          - type
        conditions:
          type: array
          items:
            type: string
            enum:
            - InternetAvailable
            - InternetNotAvailable
            - SessionConnected
            - SessionDisconnected
            - UserPresent
            - UserNotPresent
            - FreeNetworkAvailable
            - BackgroundWorkCostNotHigh
        isNetworkRequested:
          type: boolean
          description: Whether the task requires network access
          default: false
      required:
      - name
      - entryPoint
      - trigger
externalDocs:
  description: Background Tasks Documentation
  url: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/applifecycle/background-tasks