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","assignedToUserId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","reportedBy":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assetId":"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", "assignedToUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reportedBy": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assetId": "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.000ZDeprecated: use assignedToUserId. Before SAFE-1903 this field set the assignee, and a value sent here is still written as the assignee. The event’s owner (who filed it) is now the API caller and cannot be set.
object
object
External id of the user to ASSIGN the event to (written to assignedToUserId).
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.
Deprecated: use assignedToUserId. Carries the ASSIGNEE’s id (same value).
object
object
object
object
Deprecated: use assignedToUser. Carries the ASSIGNEE (same value).
object
The user the event is assigned to. Null when nobody is assigned.
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.
Deprecated: use assignedToUserId. Carries the ASSIGNEE’s id (same value).
object
object
object
object
Deprecated: use assignedToUser. Carries the ASSIGNEE (same value).
object
The user the event is assigned to. Null when nobody is assigned.
object
object
Example
{ "data": { "eventDate": "2026-05-19T14:23:00.000Z", "location": { "status": "active", "type": "equipment" }, "status": { "group": "new" } }}Invalid request: a parameter or the body failed validation (validation_error), or the body is not valid JSON (invalid_json)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Unauthorized
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Event not found (when id is provided but does not match an event in this org)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}ExternalId already in use by another event
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Rate limit exceeded (rate_limit_exceeded)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}Unexpected server error (internal_error)
object
Machine-readable error code
Human-readable error message
Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).
object
Example
{ "code": "validation_error", "message": "Request validation failed"}
