Skip to content

Create or update an action item

POST
/action-items
curl --request POST \
--url https://safe-api.safetyradar.com/v2/action-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-team: my-team-slug' \
--data '{ "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 an action item, or update an existing one. externalId is the action item’s own correlation ID (unique per organization) and acts as an upsert key: if an action item already carries it, that record is updated with the supplied fields and the response is 200 — otherwise a new item is created and the response is 201. Use eventExternalId to link the item to an event (by the event’s external ID, verified against your org); omit it for a floating action item. locationExternalId sets the location/equipment and statusExternalId sets the status from your organization’s Action Item flow — both are ignored if unrecognised, so check assetExternalId / statusExternalId on the response to confirm what was mapped. Every response echoes the external IDs of the related records — assignedToUserExternalId, completedByExternalId, createdByExternalId, statusExternalId and assetExternalId — so you can map an action item back to your own users, statuses and assets without further lookups; every user / asset custom field in fields is read back the same way, as { id, name, externalId } in place of its uuid. statusExternalId takes precedence over status. On the update path the event linkage and the completion fields are ignored. The team is taken from the X-Team header.

Send your organization’s custom fields in fields, keyed by definition key (GET /v2/modules/action_item/fields lists them). They are validated against the organization’s definitions in the same transaction as the record: a refused envelope is a 400 with a per-key list and the item is not created. On the upsert path fields is a partial patch — an omitted key keeps its stored value.

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
title
required
string
>= 1 characters
description
string
assignedToUserId
string format: uuid
assignedToUserExternalId
string
assignedToDepartmentId
string format: uuid
assignedToRoleSlug
string
dueDate
string format: date-time
priority
string
Allowed values: low medium high urgent
status
string
Allowed values: open in_progress complete
completedAt
string format: date-time
completedByExternalId
string
externalId
string
>= 1 characters
eventExternalId
string
locationExternalId
string
statusExternalId
string
fields

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
key
additional properties
any
Example
{
"crew": "A-shift",
"corrective_cost": 1250,
"supervisor": {
"id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6",
"name": "Jordan Lee",
"externalId": "EMP-0123"
}
}
metadata

Verbatim, unvalidated. Use fields — typed, admin-defined, validated. See GET /v2/modules/action_item/fields.

object
key
additional properties
nullable

Existing action item updated (matched on externalId)

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
entityType
required
string
nullable
entityId
required
string format: uuid
nullable
formSubmissionId
required
string format: uuid
nullable
sourceSectionNodeId
required
string
nullable
title
required
string
description
required
string
nullable
assignedToUserId
required
string format: uuid
nullable
assignedToUserName
string
nullable
assignedToUserExternalId
required
string
nullable
assignedToDepartmentId
required
string format: uuid
nullable
assignedToRoleSlug
required
string
nullable
dueDate
required
string
nullable
priority
required
string
Allowed values: low medium high urgent
statusId
required
string format: uuid
nullable
statusName
required
string
nullable
statusExternalId
required
string
nullable
statusGroup
required
string
nullable
Allowed values: new in_progress complete on_hold cancelled
status
required
string
Allowed values: open in_progress complete
assetId
required
string format: uuid
nullable
assetName
required
string
nullable
assetExternalId
required
string
nullable
externalId
required
string
nullable
responseNotes
required
string
nullable
attachments
required
Array<object>
nullable
object
key
additional properties
nullable
completedAt
required
string
nullable
completedById
required
string format: uuid
nullable
completedByName
required
string
nullable
completedByExternalId
required
string
nullable
createdById
required
string format: uuid
nullable
createdByExternalId
required
string
nullable
fields
required

The organization’s custom module fields, keyed by definition key. Always present; {} when the organization has configured none, and a defined key this item holds no value for is absent rather than null. A user (person) or asset (location / equipment) field is read back as an ActionItemFieldReference — { id, name, externalId } — in place of its uuid, so you can map it to your own records without a lookup; every other type is its plain value. Discover the keys, types and filter operators at GET /v2/modules/action_item/fields.

object
key
additional properties
any
metadata
required

Verbatim, unvalidated. Use fields — typed, admin-defined, validated. See GET /v2/modules/action_item/fields.

object
key
additional properties
nullable
organizationId
required
string format: uuid
teamId
required
string format: uuid
nullable
createdAt
required
string
updatedAt
required
string
Example
{
"data": {
"priority": "low",
"statusGroup": "new",
"status": "open",
"fields": {
"crew": "A-shift",
"corrective_cost": 1250,
"supervisor": {
"id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6",
"name": "Jordan Lee",
"externalId": "EMP-0123"
}
}
}
}

Action item created

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
entityType
required
string
nullable
entityId
required
string format: uuid
nullable
formSubmissionId
required
string format: uuid
nullable
sourceSectionNodeId
required
string
nullable
title
required
string
description
required
string
nullable
assignedToUserId
required
string format: uuid
nullable
assignedToUserName
string
nullable
assignedToUserExternalId
required
string
nullable
assignedToDepartmentId
required
string format: uuid
nullable
assignedToRoleSlug
required
string
nullable
dueDate
required
string
nullable
priority
required
string
Allowed values: low medium high urgent
statusId
required
string format: uuid
nullable
statusName
required
string
nullable
statusExternalId
required
string
nullable
statusGroup
required
string
nullable
Allowed values: new in_progress complete on_hold cancelled
status
required
string
Allowed values: open in_progress complete
assetId
required
string format: uuid
nullable
assetName
required
string
nullable
assetExternalId
required
string
nullable
externalId
required
string
nullable
responseNotes
required
string
nullable
attachments
required
Array<object>
nullable
object
key
additional properties
nullable
completedAt
required
string
nullable
completedById
required
string format: uuid
nullable
completedByName
required
string
nullable
completedByExternalId
required
string
nullable
createdById
required
string format: uuid
nullable
createdByExternalId
required
string
nullable
fields
required

The organization’s custom module fields, keyed by definition key. Always present; {} when the organization has configured none, and a defined key this item holds no value for is absent rather than null. A user (person) or asset (location / equipment) field is read back as an ActionItemFieldReference — { id, name, externalId } — in place of its uuid, so you can map it to your own records without a lookup; every other type is its plain value. Discover the keys, types and filter operators at GET /v2/modules/action_item/fields.

object
key
additional properties
any
metadata
required

Verbatim, unvalidated. Use fields — typed, admin-defined, validated. See GET /v2/modules/action_item/fields.

object
key
additional properties
nullable
organizationId
required
string format: uuid
teamId
required
string format: uuid
nullable
createdAt
required
string
updatedAt
required
string
Example
{
"data": {
"priority": "low",
"statusGroup": "new",
"status": "open",
"fields": {
"crew": "A-shift",
"corrective_cost": 1250,
"supervisor": {
"id": "5c8d32f1-bf63-432e-a087-9ceeaf86a3b6",
"name": "Jordan Lee",
"externalId": "EMP-0123"
}
}
}
}

Validation error, malformed JSON, or a fields envelope the organization’s definitions refuse (code: invalid_fields, with the per-key list under details.fields)

Media typeapplication/json
Any of:
object
code
required
string
Allowed values: invalid_fields
message
required
string
details
required
object
fields
required
Array<object>
object
key
required
string
message
required
string
Example
{
"code": "invalid_fields"
}

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"
}

Referenced event or assignee not found

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"
}

ExternalId is already in use by another action item

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