Skip to content

Bulk create or update events

POST
/events/bulk
curl --request POST \
--url https://safe-api.safetyradar.com/v2/events/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "events": [ { "externalId": "example", "type": "example", "title": "example", "eventDate": "example", "reportDate": "example", "address1": "example", "address2": "example", "city": "example", "state": "example", "zip": "example", "latitude": 1, "longitude": 1, "description": "example", "ownerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reportedBy": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "statusId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "actionTaken": "example", "metadata": { "additionalProperty": "example" }, "media": [ "example" ], "metricData": { "additionalProperty": "example" }, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationExternalId": "example", "ownerExternalId": "example", "reportedByExternalId": "example", "statusExternalId": "example" } ] }'

Create or update multiple events in a single request. Each item without id is upserted by externalId; items with id look up the event by UUID and may rename its externalId (per-item 409 in error/conflictingEventId if the new externalId is taken). Maximum 1000 events per request.

Media typeapplication/json
object
events
required
Array<object>
>= 1 items <= 1000 items
object
externalId
required
string
type
required
string
title
required
string
eventDate
required
string
>= 1 characters
reportDate
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
description
required
string
ownerId
string format: uuid
nullable
reportedBy
string format: uuid
nullable
locationId
string format: uuid
nullable
statusId
string format: uuid
nullable
actionTaken
string
nullable
metadata
object
key
additional properties
nullable
media
Array<string>
metricData
object
key
additional properties
nullable
id
string format: uuid
locationExternalId
string
ownerExternalId
string
reportedByExternalId
string
statusExternalId
string
Examplegenerated
{
"events": [
{
"externalId": "example",
"type": "example",
"title": "example",
"eventDate": "example",
"reportDate": "example",
"address1": "example",
"address2": "example",
"city": "example",
"state": "example",
"zip": "example",
"latitude": 1,
"longitude": 1,
"description": "example",
"ownerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"reportedBy": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"statusId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"actionTaken": "example",
"metadata": {
"additionalProperty": "example"
},
"media": [
"example"
],
"metricData": {
"additionalProperty": "example"
},
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"locationExternalId": "example",
"ownerExternalId": "example",
"reportedByExternalId": "example",
"statusExternalId": "example"
}
]
}

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
conflictingEventId
string format: uuid
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",
"conflictingEventId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
],
"summary": {
"total": 1,
"created": 1,
"updated": 1,
"failed": 1
}
}
}

Unauthorized

Media typeapplication/json
object
code
required
string
message
required
string
details
object
key
additional properties
nullable
Examplegenerated
{
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
}
}