Bulk create or update a module's records
const url = 'https://safe-api.safetyradar.com/v2/modules/jsa/records/bulk';const options = { method: 'POST', headers: { 'x-team': 'my-team-slug', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"records":[{"externalId":"JSA-00042","title":"example","description":"example","recordDate":"2026-11-19","statusId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","statusExternalId":"OPEN","assignedToUserId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assignedToUserExternalId":"EMP-0123","locationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locationExternalId":"SITE-7","ownerId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","ownerExternalId":"EMP-0456","fields":{"task_steps":"Rig the load; clear the swing radius","hazard_level":"high","supervisor":{"id":"5c8d32f1-bf63-432e-a087-9ceeaf86a3b6","name":"Jordan Lee","externalId":"EMP-0123"}}}],"dryRun":true}'};
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/modules/jsa/records/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-team: my-team-slug' \ --data '{ "records": [ { "externalId": "JSA-00042", "title": "example", "description": "example", "recordDate": "2026-11-19", "statusId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "statusExternalId": "OPEN", "assignedToUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assignedToUserExternalId": "EMP-0123", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationExternalId": "SITE-7", "ownerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ownerExternalId": "EMP-0456", "fields": { "task_steps": "Rig the load; clear the swing radius", "hazard_level": "high", "supervisor": { "id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6", "name": "Jordan Lee", "externalId": "EMP-0123" } } } ], "dryRun": true }'Create or update up to 500 records of a custom module in one request (body up to 5 MB). externalId is each record’s upsert key: a record that already carries it is updated — and restored, if it was removed — otherwise one is created. Re-sending the same payload writes nothing (action: unchanged).
On update only the keys a row sends are written; null clears a value. Status, assignee, location and owner each take a uuid or your external id. Custom fields go in fields, validated against your organization’s definitions — GET /v2/modules/{slug}/fields lists them.
A row that fails is returned in rejected with its index and every reason, keyed by the spine or field key; the rest of the batch is still written. Read records back with GET /v2/modules/{slug}/records/{externalId}.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The custom module’s slug, unique within your organization. Core modules (action_item) have their own routes.
Example
jsaThe custom module’s slug, unique within your organization. Core modules (action_item) have their own routes.
Header Parameters
Section titled “Header Parameters”Deprecated — accepted but ignored; the v2 API is org-scoped.
Example
my-team-slugDeprecated — accepted but ignored; the v2 API is org-scoped.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
The record’s own correlation id: an existing record with it is updated (and restored if it was removed), otherwise one is created.
Example
JSA-00042Required to create a record.
YYYY-MM-DD (stored at 08:00 UTC) or an ISO 8601 instant.
Example
2026-11-19The status’s uuid. null clears it.
A status in this module’s status flow, by its external id. Send this or statusId, not both.
Example
OPENThe assignee’s uuid. null clears it.
A member of your organization, by external id. Send this or assignedToUserId.
Example
EMP-0123The location’s uuid. null clears it.
A location / equipment, by external id. Send this or locationId.
Example
SITE-7Write-once: honoured when the record is created, ignored on update. Omit for a record with no owner.
The owner, by member external id. Write-once, as ownerId.
Example
EMP-0456Custom fields, keyed by definition key (GET /v2/modules/{slug}/fields). A PARTIAL patch on update: an omitted key keeps its stored value and null clears one. A user / asset field takes the uuid or the { id, name, externalId } object a GET returns (only id is read).
object
Example
{ "task_steps": "Rig the load; clear the swing radius", "hazard_level": "high", "supervisor": { "id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6", "name": "Jordan Lee", "externalId": "EMP-0123" }}Run every check and report what would happen, then write nothing. The id of a would-be-created record is not kept.
Responses
Section titled “Responses”Every row was processed; refused rows are listed in rejected
object
object
object
The row’s index in records.
unchanged: the row matched the stored record exactly, so nothing was written.
The row brought back a removed record.
object
The row’s index in records.
Every reason the row was refused, keyed by the spine key or the custom field key.
object
object
Example
{ "data": { "results": [ { "action": "created" } ] }}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"}Missing or invalid API key (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"}No custom module with this slug is installed for your organization
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"}The body is over 5 MB (payload_too_large)
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"}
