Bulk create action items
const url = 'https://safe-api.safetyradar.com/v2/action-items/bulk';const options = { method: 'POST', headers: { 'x-team': 'my-team-slug', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"actionItems":[{"title":"example","description":"example","assignedToUserId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assignedToUserExternalId":"example","assignedToDepartmentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","assignedToRoleSlug":"example","dueDate":"2026-04-15T12:00:00Z","priority":"low","status":"open","completedAt":"2026-04-15T12:00:00Z","completedByExternalId":"example","externalId":"example","eventExternalId":"example","locationExternalId":"example","statusExternalId":"example","fields":{"crew":"A-shift","corrective_cost":1250,"supervisor":{"id":"5c8d32f1-bf63-432e-a087-9ceeaf86a3b6","name":"Jordan Lee","externalId":"EMP-0123"}},"metadata":{"additionalProperty":"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/action-items/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-team: my-team-slug' \ --data '{ "actionItems": [ { "title": "example", "description": "example", "assignedToUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assignedToUserExternalId": "example", "assignedToDepartmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "assignedToRoleSlug": "example", "dueDate": "2026-04-15T12:00:00Z", "priority": "low", "status": "open", "completedAt": "2026-04-15T12:00:00Z", "completedByExternalId": "example", "externalId": "example", "eventExternalId": "example", "locationExternalId": "example", "statusExternalId": "example", "fields": { "crew": "A-shift", "corrective_cost": 1250, "supervisor": { "id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6", "name": "Jordan Lee", "externalId": "EMP-0123" } }, "metadata": { "additionalProperty": "example" } } ] }'Create or update multiple action items in a single request (1-100). Each item supports the same fields as the single create: externalId is the item’s own correlation ID and upserts (see action on each result and the created / updated counts in summary), eventExternalId links to an event, locationExternalId / statusExternalId set the asset and status, and fields carries your organization’s custom fields. Per-item errors are returned in results without failing the request — an item whose fields are refused reports the per-key messages in its error and is not written, while the rest of the batch still lands. Each result identifies the item only, so read fields back with GET /action-items/{id}. The team is taken from the X-Team header.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”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 organization’s admin-defined custom fields, keyed by definition key. Validated against the organization’s own definitions: an unknown key, a bad enum value or a missing required field is a 400 carrying a per-key list. A user or asset field takes the record’s uuid, or the { id, name, externalId } object a GET returns it as (only id is read). Does not merge with metadata — the two are stored separately and neither overwrites the other. Discover the contract at GET /v2/modules/action_item/fields.
object
Example
{ "crew": "A-shift", "corrective_cost": 1250, "supervisor": { "id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6", "name": "Jordan Lee", "externalId": "EMP-0123" }}Verbatim, unvalidated. Use fields — typed, admin-defined, validated. See GET /v2/modules/action_item/fields.
object
Responses
Section titled “Responses”Bulk operation completed
object
object
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"}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"}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"}
