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

# List mass write operations

> Returns the mass write operations you started in your buildings, newest first, one page at a time.

> [!NOTE]
>
> The list shows the stored state of each operation. It does not recount points, so an operation can show `RUNNING` after its points are done. [Get a mass write operation](https://docs.kodelabs.com/products/kode-api/api-reference/mass-write/get-a-mass-write-operation.md) refreshes it.

A service account sees only the operations it started. An operation that covers several buildings appears under each of them. Use `state`, `buildingId`, `from`, and `to` to narrow the list. `from` and `to` filter on the creation date, in UTC. KODE API ignores `q`, `asc`, and `dsc`.


## OpenAPI

````yaml /openapi/kode-api.yaml get /api/v1/mass-write/operations
openapi: 3.1.0
info:
  title: KODE API
  version: 1.0.0
  summary: Programmatic access to KODE OS resources and operations.
  description: >
    Use the KODE API to work with buildings, data sources, connectors, devices,
    points, virtual devices,

    timeseries data, schedules, the ontology, templating, mass writes, spaces,
    space assignments, tenants, meters, users, actions,

    and AssetOps work orders.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.kodelabs.com/kodeos
    description: KODE API
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: OAuth 2.0 discovery, token, and revocation endpoints.
  - name: Buildings
    description: Buildings and their areas.
  - name: Data sources
    description: Data sources connected to a building.
  - name: Devices
    description: Devices and their points.
  - name: Points
    description: Point queries and point writes.
  - name: Timeseries
    description: Current and historical point values.
  - name: Actions
    description: Actions exposed by building data sources.
  - name: Work orders
    description: AssetOps work orders, lookups, comments, and attachments.
  - name: Connectors
    description: KODE API connectors and the devices and points ingested through them.
  - name: Schedules
    description: Schedules discovered on building data sources.
  - name: Templating
    description: Apply ontology templates to groups of points.
  - name: Virtual devices
    description: Virtual devices that group points from other devices.
  - name: Ontology
    description: Canonical types, fields, units, and connections of the KODE ontology.
  - name: Users
    description: Users of the organization and their app access.
  - name: Mass write
    description: Write values to many points across buildings, and follow each run.
  - name: Spaces
    description: Levels and space units of a building, and the meters located in them.
  - name: Space assignments
    description: Assign tenants to leasable spaces of a building for a period.
  - name: Tenants
    description: Tenants of a building, the people or companies that lease its spaces.
  - name: Meters
    description: >-
      Meters of a building, their space assignments, parent and child links, and
      readings.
paths:
  /api/v1/mass-write/operations:
    get:
      tags:
        - Mass write
      summary: List mass write operations
      description: >-
        Returns the mass write operations you started in your buildings, newest
        first, one page at a time.
      operationId: listMassWriteOperations
      parameters:
        - name: buildingId
          in: query
          schema:
            type: string
            pattern: '[^\p{C}\p{Z}]{1,128}'
          description: Return only operations that write in this building.
        - name: from
          in: query
          schema:
            type: string
            format: date
            examples:
              - '2022-03-10'
          description: Return operations created on or after this date (`YYYY-MM-DD`, UTC).
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
            maximum: 200
            minimum: 1
            default: 50
          description: Number of items per page, from `1` to `200`. The default is `50`.
        - name: page
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
            default: 1
          description: Page number to return. The first page is `1`.
        - name: state
          in: query
          schema:
            type: string
            enum:
              - QUEUED
              - RUNNING
              - SUCCEEDED
              - FAILED
          description: Return only operations in this state.
        - name: to
          in: query
          schema:
            type: string
            format: date
            examples:
              - '2022-03-10'
          description: >-
            Return operations created on or before this date (`YYYY-MM-DD`,
            UTC).
      responses:
        '200':
          description: >-
            A page of operations. `itemCount` is the total number that match the
            filters.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedEntityPointMassWriteOperationPublic
        '400':
          description: >-
            A filter is not valid. For example, `state` is not one of the listed
            values, `from` or `to` is not a date, `buildingId` is blank, `limit`
            is above `200`, or `page` is below `1`.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The service account lacks permission to read mass writes, or has no
            assigned building.
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    PaginatedEntityPointMassWriteOperationPublic:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PointMassWriteOperationPublic'
        page:
          type: integer
          format: int32
        limit:
          type: integer
          format: int32
        pageCount:
          type: integer
          format: int32
        itemCount:
          type: integer
          format: int32
    PointMassWriteOperationPublic:
      type: object
      properties:
        name:
          description: >-
            Resource name of the operation. The last segment is the
            `operationId`.
          type: string
          examples:
            - mass-write/operations/6acf8bcf8564cb8ad4ccf8f3
        done:
          description: Whether the operation has finished.
          type: boolean
        metadata:
          $ref: '#/components/schemas/Metadata2'
          description: Progress and identifying data. Always present.
        response:
          $ref: '#/components/schemas/Response'
          description: Outcome counts. Present when the state is `SUCCEEDED`.
        error:
          $ref: '#/components/schemas/Error'
          description: Present when the state is `FAILED`.
    Metadata2:
      type: object
      properties:
        operation:
          description: Always `APPLY`.
          type: string
          examples:
            - APPLY
        state:
          description: '`QUEUED`, `RUNNING`, `SUCCEEDED`, or `FAILED`.'
          type: string
          examples:
            - RUNNING
        progress:
          description: Share of points with an outcome, as a percentage.
          type: number
          format: double
          examples:
            - 29.3
        label:
          description: The `name` you sent.
          type: string
        scope:
          description: '`BUILDING` or `PORTFOLIO`.'
          type: string
        buildings:
          description: Number of buildings in the operation.
          type: integer
          format: int32
        total:
          description: Number of points in the operation.
          type: integer
          format: int32
        counts:
          $ref: '#/components/schemas/Counts'
          description: Points by outcome. Present while the operation is not done.
          type: object
        retries:
          description: How many times the operation was retried.
          type: integer
          format: int32
        createdAt:
          $ref: '#/components/schemas/Date'
          description: When the operation was created.
        updatedAt:
          $ref: '#/components/schemas/Date'
          description: When the operation was last updated.
        finishedAt:
          $ref: '#/components/schemas/Date'
          description: When the operation finished. Empty until then.
        actorId:
          description: Id of the service account that started the operation.
          type: string
        actorType:
          description: Always `SERVICE`.
          type: string
        etag:
          description: Etag of the plan the operation started from.
          type: string
        requestId:
          description: The `requestId` the operation started with.
          type: string
        pollAfterSeconds:
          description: >-
            Seconds to wait before the next read. Present while the operation is
            not done.
          type: integer
          format: int32
          examples:
            - 15
    Response:
      type: object
      properties:
        total:
          description: Number of points.
          type: integer
          format: int32
        succeeded:
          description: Points written.
          type: integer
          format: int32
        failed:
          description: Points that failed.
          type: integer
          format: int32
        notes:
          description: Notices about the run.
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        code:
          description: '`INTERNAL_ERROR` or `TIMEOUT`.'
          type: string
          examples:
            - TIMEOUT
        message:
          description: What went wrong.
          type: string
    Counts:
      type: object
      properties:
        pending:
          description: Points still waiting for an outcome.
          type: integer
          format: int32
        succeeded:
          description: Points written.
          type: integer
          format: int32
        failed:
          description: Points that failed.
          type: integer
          format: int32
    Date:
      type: string
      description: >-
        Date and time in UTC, with a numeric offset and no colon, for example
        `2026-10-28T13:51:31+0000`.
      examples:
        - 2026-10-28T13:51:31+0000
  responses:
    Unauthorized:
      description: The access token is missing, invalid, or expired. Request a new token.
    TooManyRequests:
      description: >-
        A rate-limit window is exhausted. Wait, then retry with increasing
        delays.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Paste an access token from [Create an access
        token](/products/kode-api/api-reference/authentication/create-an-access-token).
        Tokens expire, so request a new one if you receive `401`.

````

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