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

# Bulk update accounts for a company

> Allows an authenticated API user to bulk update accounts for a company. The only supported update is to set an account as tracked or not tracked. All accounts are updated to the same isTracked status. Either all accounts are updated, or if there is an error, no accounts are updated. All associated meters will be set to the same isTracked status as the account. Optionally, pass in a parameter updateMeters = false to prevent meter isTracked status from being updated.



## OpenAPI

````yaml /api-reference/openapi-v2-2.json patch /account/bulk
openapi: 3.1.0
info:
  title: Nectar API Documentation
  version: 1.0.0 (v1)
  description: >-
    Complete API documentation for v2.2 endpoints to managing companies, sites,
    data, and documents
servers:
  - url: https://external.nectarclimate.com/v2.2
    description: Nectar API Server
security: []
paths:
  /account/bulk:
    patch:
      tags:
        - Accounts
      summary: Bulk update accounts for a company
      description: >-
        Allows an authenticated API user to bulk update accounts for a company.
        The only supported update is to set an account as tracked or not
        tracked. All accounts are updated to the same isTracked status. Either
        all accounts are updated, or if there is an error, no accounts are
        updated. All associated meters will be set to the same isTracked status
        as the account. Optionally, pass in a parameter updateMeters = false to
        prevent meter isTracked status from being updated.
      operationId: account_bulk_partial_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAccountBulkUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAccountBulkUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAccountBulkUpdateRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Account'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '403':
          description: 'Forbidden: Access to the company is denied.'
        '404':
          description: Account not found.
      security:
        - ExternalAuthentication: []
components:
  schemas:
    PatchedAccountBulkUpdateRequest:
      type: object
      description: Serializer for bulk updating accounts for a company.
      properties:
        isTracked:
          type: boolean
          description: Indicates whether this account is currently being tracked by Nectar.
        account_ids:
          type: array
          items:
            type: string
            format: uuid
          description: List of account IDs to update.
        updateMeters:
          type: boolean
          default: true
          description: >-
            Indicates whether to update the tracking status of the account's
            meters along with the account status. Defaults to true.
    Account:
      type: object
      description: Serializer for externally available fields of an Account object.
      properties:
        id:
          type: string
          format: uuid
          description: UUID of the account.
        accountNumber:
          type: string
          description: >-
            The actual account number. For utilities without account numbers,
            leave blank.
          maxLength: 200
        meters:
          type: array
          items:
            type: string
            format: uuid
            description: UUID of the meter site usage data entry.
        isTracked:
          type: boolean
          description: >-
            Deprecated boolean alias. UNSET is treated as True for backward
            compatibility.
        trackingStatus:
          allOf:
            - $ref: '#/components/schemas/TrackingStatusEnum'
          description: >-
            User-mutable tracking intent for this account. When set to DISABLED,
            data collection stops and the status field reflects as
            CUSTOMER_NOT_TRACKED. ENABLED resumes data collection. UNSET means
            no tracking decision has been made yet.


            * `ENABLED` - Enabled

            * `DISABLED` - Disabled

            * `UNSET` - Unset
        isDuplicated:
          type: string
        dataCollectionStartDate:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Date when data collection for the account begins. This is the date
            from which Nectar will pull historical data. This field overrides
            the site, company, and connection level dataCollectionStartDate
            fields.
        isCollectingInvoiceData:
          type: boolean
          description: >-
            Indicates whether this account is collecting invoice data. If True,
            Nectar will collect invoice data with a maximum granularity of
            weekly intervals.
        isCollectingSmartMeterData:
          type: boolean
          description: >-
            Indicates whether this account is smart metered. If True, Nectar
            will collect metered data with a maximum granularity of daily
            intervals.
        datasourceTypes:
          type: array
          items:
            type: string
          description: >-
            List of unique datasource types for all meters associated with the
            account.
        lastServiceDate:
          type:
            - string
            - 'null'
          format: date
          description: >-
            The date when the account was closed by the utility (the end date of
            the last meter reading).
      required:
        - id
        - isDuplicated
        - isTracked
        - meters
    ErrorResponse:
      type: object
      description: Serializer for error responses.
      properties:
        detail:
          type: string
        error:
          type: string
    TrackingStatusEnum:
      enum:
        - ENABLED
        - DISABLED
        - UNSET
      type: string
      description: |-
        * `ENABLED` - Enabled
        * `DISABLED` - Disabled
        * `UNSET` - Unset
  securitySchemes:
    ExternalAuthentication:
      type: apiKey
      in: header
      name: X-API-KEY

````