Skip to content

Bulk create or update assets

POST
/assets/bulk
curl --request POST \
--url https://safe-api.safetyradar.com/v2/assets/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "assets": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "address1": "example", "address2": "example", "city": "example", "state": "example", "zip": "example", "latitude": 1, "longitude": 1, "status": "active", "type": "equipment", "parentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "externalId": "example", "metadata": { "additionalProperty": "example" }, "createdAt": "example", "updatedAt": "example", "deletedAt": "example", "equipmentTypeId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tagIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "externalParentId": "example", "tags": [ "Region North" ] } ] }'

Create or update multiple assets in a single request. Assets are upserted based on externalId. Maximum 1000 assets per request. Equipment assets require equipmentTypeId. externalParentId may name an existing asset OR another asset in the same request, in any order: parents are written before their children, so a new parent and all its children (for example a re-org) need only one request. A row that cannot be placed fails alone and the rest of the batch is written: its result has success: false and an error when its parent is in neither the database nor the request, when it is its own parent, when it is part of a parent cycle, when the move would put it under one of its own descendants, when an earlier row has the same externalId, or when its parent row failed (the error names the parent). Results are in request order. tags (tag names) and tagIds follow the same rules as the single upsert: omitted = tags unchanged, [] = clear, a list = replace; an unknown tag name fails that row; a row with both tags and tagIds rejects the request with 400.

Media typeapplication/json
object
assets
required
Array<object>
>= 1 items <= 1000 items
object
id
string format: uuid
name
required
string
description
string
nullable
address1
string
nullable
address2
string
nullable
city
string
nullable
state
string
nullable
zip
string
nullable
latitude
number
nullable >= -140737488355328 <= 140737488355327
longitude
number
nullable >= -140737488355328 <= 140737488355327
status
string
Allowed values: active inactive
type

Asset type. If omitted on update, preserves existing type.

string
Allowed values: equipment location
parentId
string format: uuid
nullable
externalId
required

External identifier (required for bulk upsert)

string
>= 1 characters
metadata
Any of:
string
createdAt
string
updatedAt
string
deletedAt
string
nullable
equipmentTypeId
string format: uuid
nullable
tagIds

Resource tag ids, with the same semantics as tags. Send tags or tagIds, not both.

Array<string>
externalParentId

External ID of the parent asset. If provided, resolves to parentId. Takes precedence over parentId if both are specified. null moves the asset to the root (top level); parentId: null does NOT, it leaves the parent unchanged. A parentId must be an asset of your organization.

string
nullable
tags

Resource tag NAMES, matched trimmed and case-insensitively against the organization’s tags (for example ["Region North"]). Omitted = the asset’s tags are not changed; [] = remove all tags; a list = replace the tags with exactly this set. Tags are not created by the API: an unknown name fails that row. Send tags or tagIds, not both.

Array<string>
Example
[
"Region North"
]

Bulk operation completed

Media typeapplication/json
object
data
required
object
results
required
Array<object>
object
externalId
required
string
success
required
boolean
created
boolean
id
string format: uuid
error
string
summary
required
object
total
required
number
created
required
number
updated
required
number
failed
required
number
Examplegenerated
{
"data": {
"results": [
{
"externalId": "example",
"success": true,
"created": true,
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"error": "example"
}
],
"summary": {
"total": 1,
"created": 1,
"updated": 1,
"failed": 1
}
}
}

Bad request - equipment assets require equipmentTypeId, an unknown tag, or both tags and tagIds sent

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Unauthorized

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Rate limit exceeded (rate_limit_exceeded)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Unexpected server error (internal_error)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Version bd999fd · Released November 23, 2026