Skip to content

Bulk create or update a module's records

POST
/modules/{slug}/records/bulk
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}.

slug
required

The custom module’s slug, unique within your organization. Core modules (action_item) have their own routes.

string
>= 1 characters
Example
jsa

The custom module’s slug, unique within your organization. Core modules (action_item) have their own routes.

x-team

Deprecated — accepted but ignored; the v2 API is org-scoped.

string
Example
my-team-slug

Deprecated — accepted but ignored; the v2 API is org-scoped.

Media typeapplication/json
object
records
required
Array<object>
>= 1 items <= 500 items
object
externalId
required

The record’s own correlation id: an existing record with it is updated (and restored if it was removed), otherwise one is created.

string
>= 1 characters <= 255 characters
Example
JSA-00042
title

Required to create a record.

string
description
string
nullable
recordDate

YYYY-MM-DD (stored at 08:00 UTC) or an ISO 8601 instant.

string
nullable
Example
2026-11-19
statusId

The status’s uuid. null clears it.

string format: uuid
nullable
statusExternalId

A status in this module’s status flow, by its external id. Send this or statusId, not both.

string
>= 1 characters
Example
OPEN
assignedToUserId

The assignee’s uuid. null clears it.

string format: uuid
nullable
assignedToUserExternalId

A member of your organization, by external id. Send this or assignedToUserId.

string
>= 1 characters
Example
EMP-0123
locationId

The location’s uuid. null clears it.

string format: uuid
nullable
locationExternalId

A location / equipment, by external id. Send this or locationId.

string
>= 1 characters
Example
SITE-7
ownerId

Write-once: honoured when the record is created, ignored on update. Omit for a record with no owner.

string format: uuid
nullable
ownerExternalId

The owner, by member external id. Write-once, as ownerId.

string
>= 1 characters
Example
EMP-0456
fields

Custom 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
key
additional properties
any
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"
}
}
dryRun

Run every check and report what would happen, then write nothing. The id of a would-be-created record is not kept.

boolean

Every row was processed; refused rows are listed in rejected

Media typeapplication/json
object
data
required
object
dryRun
required
boolean
results
required
Array<object>
object
index
required

The row’s index in records.

number
externalId
required
string
id
required
string format: uuid
action
required

unchanged: the row matched the stored record exactly, so nothing was written.

string
Allowed values: created updated unchanged
restored
required

The row brought back a removed record.

boolean
rejected
required
Array<object>
object
index
required

The row’s index in records.

number
externalId
required
string
errors
required

Every reason the row was refused, keyed by the spine key or the custom field key.

Array<object>
object
key
required
string
message
required
string
summary
required
object
total
required
number
created
required
number
updated
required
number
unchanged
required
number
rejected
required
number
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)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Missing or invalid API key (unauthorized)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

No custom module with this slug is installed for your organization

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

The body is over 5 MB (payload_too_large)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Rate limit exceeded (rate_limit_exceeded)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Unexpected server error (internal_error)

Media typeapplication/json
object
code
required

Machine-readable error code

string
message
required

Human-readable error message

string
details

Additional error details. For validation_error: issues, a list of { location, path, message } (location is query, param, header or json).

object
key
additional properties
nullable
Example
{
"code": "validation_error",
"message": "Request validation failed"
}

Version bd999fd · Released November 23, 2026