Create or update event
const url = 'https://safe-api.safetyradar.com/v2/events';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"externalId":"example","type":"example","title":"example","eventDate":"2026-05-19T14:23:00.000Z","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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "externalId": "example", "type": "example", "title": "example", "eventDate": "2026-05-19T14:23:00.000Z", "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 a new event or update an existing one. Without id, matches by externalId (upsert). With id, looks up the event and can rename its externalId.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Event date and time in UTC. Accepts a full ISO 8601 timestamp (e.g. “2026-05-19T14:23:00Z”) or a date-only string (“2026-05-19”); date-only inputs are anchored at 08:00 UTC for backwards compatibility.
Example
2026-05-19T14:23:00.000Zobject
object
Responses
Section titled “Responses”Event updated
object
object
Event date and time in UTC. Accepts a full ISO 8601 timestamp (e.g. “2026-05-19T14:23:00Z”) or a date-only string (“2026-05-19”); date-only inputs are anchored at 08:00 UTC for backwards compatibility.
object
object
object
object
object
object
Example
{ "data": { "eventDate": "2026-05-19T14:23:00.000Z", "location": { "status": "active", "type": "equipment" }, "status": { "group": "new" } }}Event created
object
object
Event date and time in UTC. Accepts a full ISO 8601 timestamp (e.g. “2026-05-19T14:23:00Z”) or a date-only string (“2026-05-19”); date-only inputs are anchored at 08:00 UTC for backwards compatibility.
object
object
object
object
object
object
Example
{ "data": { "eventDate": "2026-05-19T14:23:00.000Z", "location": { "status": "active", "type": "equipment" }, "status": { "group": "new" } }}Unauthorized
object
object
Examplegenerated
{ "code": "example", "message": "example", "details": { "additionalProperty": "example" }}Event not found (when id is provided but does not match an event in this org)
object
object
Examplegenerated
{ "code": "example", "message": "example", "details": { "additionalProperty": "example" }}ExternalId already in use by another event
object
object
Examplegenerated
{ "code": "example", "message": "example", "details": { "additionalProperty": "example" }}
