---
title: "Bulk replace assets' resource_mappings"
method: PUT
path: "/machine-to-machine/assets/resource-mappings/batch"
tags: ["Assets"]
---

# Bulk replace assets' resource_mappings

`PUT /machine-to-machine/assets/resource-mappings/batch`

## Request

- Base URL: `https://api.equipmentshare.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.equipmentshare.com/machine-to-machine/assets/resource-mappings/batch`
- Auth: HTTP bearer

Each item replaces that asset's whole resource_mappings. An item whose source_as_of is older than the stored value's is skipped. When an asset appears more than once, the newest source_as_of wins. Writes only the resource_mappings column: no asset event is published and fleet-configuration-api is not called.

## Request body

- AssetResourceMappingsBatch
  - `items` AssetResourceMappingsItem[], required
    - `asset_id` integer, required
    - `resource_mappings` ResourceMappings, required
      - `resources` ResourceMappingEntry[], required
        - `company_id` integer, required
        - `hierarchy_id` string, required
        - `hierarchy_map_type` 'location' | 'org-unit' | 'custom', required
        - `relationship_type` 'TSP' | 'ISP' | 'MSP' | 'RSP' | 'LOCATION' | 'ORG_UNIT' | 'CUSTOM', required
        - `resource_id` string, required
      - `source_as_of` string, date-time, required

## Response `200`

- AssetResourceMappingsBatchResponse
  - `applied` integer[]
  - `not_found` integer[]
  - `skipped_stale` integer[]

## Other responses

- `401`: Valid machine Bearer token required.
- `403`: Machine token missing asset-resource-mappings:write scope.
- `422`: Request body is invalid or has more items than the batch limit.

---

[API](https://skmtc.dev/equipmentshare/apis/es-api.md) - [All operations](https://skmtc.dev/equipmentshare/apis/es-api/llms.txt) - [OpenAPI document](https://skmtc.dev/equipmentshare/apis/es-api/revisions/40651e1558ac?raw)
