Bulk create or update events
POST
/events/bulk
const url = 'https://safe-api.safetyradar.com/v2/events/bulk';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
events
required
Array<object>
object
externalId
required
string
type
required
string
title
required
string
eventDate
required
string
reportDate
string
address1
string
address2
string
city
string
state
string
zip
string
latitude
number
longitude
number
description
required
string
ownerId
string format: uuid
reportedBy
string format: uuid
locationId
string format: uuid
statusId
string format: uuid
actionTaken
string
metadata
object
key
additional properties
media
Array<string>
metricData
object
key
additional properties
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" } ]}Responses
Section titled “Responses”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
Examplegenerated
{ "code": "example", "message": "example", "details": { "additionalProperty": "example" }}
