> ## 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.

# Retry a mass write operation

> Sends the failed points of an operation again. The operation runs again under the same id.

The operation must be done and have failed points. An operation that was cut off with points that never got an outcome also qualifies. Those points are marked `FAILED` with the code `TIMEOUT` and sent again. Points that failed with `NOT_IN_PLAN` are not sent again.

The operation goes back to `RUNNING`, and `metadata.retries` goes up by one. Poll it as you did after the apply. An operation you do not read stays `RUNNING` and blocks the next mass write in its buildings.

> [!NOTE]
>
> The call returns `400` while the operation is not done, when no failed point can be sent again, or while another mass write is running in the same buildings.


## OpenAPI

````yaml /openapi/kode-api.yaml post /api/v1/mass-write/operations/{operationId}:retry
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/{operationId}:retry:
    post:
      tags:
        - Mass write
      summary: Retry a mass write operation
      description: >-
        Sends the failed points of an operation again. The operation runs again
        under the same id.
      operationId: retryMassWriteOperation
      parameters:
        - name: operationId
          in: path
          required: true
          schema:
            type: string
            pattern: '[^\p{C}\p{Z}]{1,128}'
          description: Identifier of the operation.
        - description: >-
            Comma-separated top-level fields to return. One or more of `name`,
            `done`, `metadata`, `response`, and `error`. The default is every
            field. An unknown name returns `400`.
          name: fields
          in: query
          schema:
            type: string
      responses:
        '200':
          description: The operation, running again. The response is the operation itself.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PointMassWriteOperationPublic'
        '400':
          description: >-
            The operation is not done ("Only a finished operation can be
            retried"), has no failed point to send again, or another mass write
            is running in the same buildings ("Another point mass write is
            running"). `fields` with an unknown name also returns `400`.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The service account lacks permission to manage mass writes, or has
            no assigned building.
        '404':
          description: No operation with this id exists for your service account.
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    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.