Skip to content

Create or update location

POST
/locations
curl --request POST \
--url https://safe-api.safetyradar.com/v2/locations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "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", "parentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "externalId": "example", "metadata": { "additionalProperty": "example" }, "createdAt": "example", "updatedAt": "example", "deletedAt": "example", "tagIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "tags": [ "Region North" ] }'

Create a new location or update an existing one if externalId matches (upsert behavior)

Media typeapplication/json
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
parentId
string format: uuid
nullable
externalId

External identifier for upsert behavior

string
metadata
Any of:
string
createdAt
string
updatedAt
string
deletedAt
string
nullable
tagIds
Array<string>
tags

Resource tag NAMES, matched trimmed and case-insensitively against the organization’s tags (for example ["Region North"]). Omitted = tags unchanged; [] = remove all tags; a list = replace them. An unknown name returns 400; tags are not created by the API. Send tags or tagIds, not both.

Array<string>
Example
[
"Region North"
]

Location updated (existing location found by externalId)

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
organizationId
required
string format: uuid
name
required
string
description
required
string
nullable
slug
required
string
address1
required
string
nullable
address2
required
string
nullable
city
required
string
nullable
state
required
string
nullable
zip
required
string
nullable
latitude
required
number
nullable >= -140737488355328 <= 140737488355327
longitude
required
number
nullable >= -140737488355328 <= 140737488355327
status
required
string
Allowed values: active inactive
type
required
string
Allowed values: equipment location
parentId
required
string format: uuid
nullable
externalId
required
string
nullable
metadata
required
Any of:
string
createdById
required
string format: uuid
nullable
lastEditedById
required
string format: uuid
nullable
searchText
nullable
createdAt
required
string
updatedAt
required
string
deletedAt
required
string
nullable
tagNames
required

Names of the resource tags on the location, sorted. Single-location responses (GET by id, POST) also carry tags as { id, name } objects; tagNames is the same set as plain names.

Array<string>
Example
{
"data": {
"status": "active",
"type": "equipment",
"tagNames": [
"Region North"
]
}
}

Location created

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
organizationId
required
string format: uuid
name
required
string
description
required
string
nullable
slug
required
string
address1
required
string
nullable
address2
required
string
nullable
city
required
string
nullable
state
required
string
nullable
zip
required
string
nullable
latitude
required
number
nullable >= -140737488355328 <= 140737488355327
longitude
required
number
nullable >= -140737488355328 <= 140737488355327
status
required
string
Allowed values: active inactive
type
required
string
Allowed values: equipment location
parentId
required
string format: uuid
nullable
externalId
required
string
nullable
metadata
required
Any of:
string
createdById
required
string format: uuid
nullable
lastEditedById
required
string format: uuid
nullable
searchText
nullable
createdAt
required
string
updatedAt
required
string
deletedAt
required
string
nullable
tagNames
required

Names of the resource tags on the location, sorted. Single-location responses (GET by id, POST) also carry tags as { id, name } objects; tagNames is the same set as plain names.

Array<string>
Example
{
"data": {
"status": "active",
"type": "equipment",
"tagNames": [
"Region North"
]
}
}

Bad request (e.g., externalId already used by equipment)

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