The SafetyCulture API gives you direct access to your Actions data. There are methods to search and retrieve actions.
Action format
This section describes the complete action response format.
Action top level
{
"action": {
"task": {
"task_id": "d6658a5a-6154-4802-b1f3-953a67e492c6",
"creator": {
"user_id": "c3aa4fae-bbad-4abf-8550-29c683012796",
"firstname": "SafetyCulture",
"lastname": "User"
},
"title": "Test Action",
"description": "This is a test action generated by the SafetyCulture API.",
"created_at": "2022-02-21T23:59:00.226559Z",
"due_at": null,
"priority_id": "58941717-817f-4c7c-a6f6-5cd05e2bbfde",
"status_id": "17e793a1-26a3-4ecd-99ca-f38ecc6eaa2e",
"collaborators": [],
"template_id": "",
"inspection": {
"inspection_id": "",
"inspection_name": ""
},
"inspection_item": {
"inspection_item_id": "",
"inspection_item_name": "",
"inspection_item_type": "",
"inspection_item_response_values": []
},
"site": {
"id": "",
"name": "",
"region": "",
"area": ""
},
"modified_at": "2022-02-21T23:59:00.226559Z",
"references": [],
"completed_at": null,
"template_name": "",
"status": {
"status_id": "17e793a1-26a3-4ecd-99ca-f38ecc6eaa2e",
"key": "TO_DO",
"label": "To Do",
"display_order": 1
}
}
}
}
Key | Type | Description |
---|---|---|
task_id | String (UUID) | The action ID. |
template_id | String (UUID) | The template ID of the inspection which the action belongs to. |
template_name | String | The template name of the inspection which the action belongs to. |
inspection | Object | The inspection which the action belongs to inspection. |
inspection_item | Object | The inspection item which the action belongs to inspection_item. |
creator | Object | Information about the action creator. |
title | String | The title of the action. |
description | String | The description of the action. |
created_at | String (ISO8601) | Date and time when the action was created. |
modified_at | String (ISO8601) | Date and time when the action was last modified. |
completed_at | String (ISO8601) | Date and time when the action was completed. |
due_at | String (ISO8601) | Date and time when the action is due. |
priority_id | String (UUID) | ID of the action priority. |
status | Object | Status information of the action status. |
site | Object | General information of the site where the action was created. |
collaborators | Array | List of Collaborators of the action. |
reference | Object | Information about from where the action was created. Only available when the action was created from an Inspection or a Sensor Alert. |
Inspection
.inspection
contains the information about the inspection which action belongs to.
{
"inspection": {
"inspection_id": "40a57fda-bb93-4891-9db3-d34466adeedd",
"inspection_name": "25 Nov 2021 / Safetyculture user"
}
}
Key | Type | Description |
---|---|---|
inspection_id | String (UUID) | ID of the inspection. |
inspection_name | String | name of the inspection. |
Inspection item
.inspection_item
contains the information about the inspection item which action belongs to.
{
"inspection_item": {
"inspection_item_id": "09ce922d-a3c4-426b-8860-27adfcb5e89f",
"inspection_item_name": "question name",
"inspection_item_type": "question"
}
}
Key | Type | Description |
---|---|---|
inspection_item_id | String (UUID) | ID of the inspection item. |
inspection_item_name | String | name of the inspection item. |
inspection_item_type | String | type of the inspection item. |
Creator
.creator
contains the information about the creator of the action.
{
"creator": {
"user_id": "c3aa4fae-bbad-4abf-8550-29c683012796",
"firstname": "SafetyCulture",
"lastname": "User"
}
}
Key | Type | Description |
---|---|---|
id | String (UUID) | ID of the creator of the action. |
firstname | String | First name of the creator of the action. |
lastname | String | Last name of the creator of the action. |
Action site
.site
contains the information about the site which the action belongs to.
{
"site": {
"id": "704d6061-0383-4e2c-a8dc-a1804712677a",
"name": "Bilpin",
"region": "NSW",
"area": "Australia"
}
}
Key | Type | Description |
---|---|---|
id | String (UUID) | ID of the site. |
name | String | Name of the site. |
region | String | The region of the site. |
area | String | The area of the site. |
Priority
.priority_id
contains the id of the priority of an action.
The current accepted priorities are:
ID | Value |
---|---|
58941717-817f-4c7c-a6f6-5cd05e2bbfde | None |
16ba4717-adc9-4d48-bf7c-044cfe0d2727 | Low |
ce87c58a-eeb2-4fde-9dc4-c6e85f1f4055 | Medium |
02eb40c1-4f46-40c5-be16-d32941c96ec9 | High |
Status
.status
contains the information about the status of an action.
{
"status": {
"status_id": "17e793a1-26a3-4ecd-99ca-f38ecc6eaa2e",
"key": "TO_DO",
"label": "To Do",
"display_order": 1
}
}
Key | Type | Description |
---|---|---|
status_id | String (UUID) | ID of the status. |
label | String | Name of the status. |
Action status labels can be customized for an organization. If an action status's label is not customized, it should be using one of the following default labels:
ID | Label | Action is completed? |
---|---|---|
17e793a1-26a3-4ecd-99ca-f38ecc6eaa2e | To do | No |
20ce0cb1-387a-47d4-8c34-bc6fd3be0e27 | In progress | No |
7223d809-553e-4714-a038-62dc98f3fbf3 | Complete | Yes |
06308884-41c2-4ee0-9da7-5676647d3d75 | Can't do | Yes |
Collaborators
.collaborators
contains the information about the collaborators of the action. It can contain multiple users, groups or external users.
{
"collaborators": [
{
"collaborator_id": "c3aa4fae-bbad-4abf-8550-29c683012796",
"collaborator_type": "USER",
"assigned_role": "ASSIGNEE",
"user": {
"user_id": "c3aa4fae-bbad-4abf-8550-29c683012796",
"firstname": "SafetyCulture",
"lastname": "User"
}
},
{
"collaborator_id": "f877808b-9b86-4147-9269-274e0169e021",
"collaborator_type": "GROUP",
"assigned_role": "ASSIGNEE",
"group": {
"group_id": "f877808b-9b86-4147-9269-274e0169e021",
"name": "Test Group"
}
},
{
"collaborator_id": "4251c7c8-9af6-4233-8d4e-967b28a48c93",
"collaborator_type": "EXTERNAL_USER",
"assigned_role": "ASSIGNEE",
"external_user": {
"id": "4251c7c8-9af6-4233-8d4e-967b28a48c93",
"email": "[email protected]"
}
}
]
}
Collaborator data
Key | Type | Description |
---|---|---|
collaborator_id | String (UUID) | ID of the collaborator of the action. |
collaborator_type | String | The type of collaborator of the action. |
assigned_role | String | The role of collaborator of the action. |
user | Object | Information about the user. Only available when the collaborator_type is COLLABORATOR_TYPE_USER . |
group | Object | Information about the group. Only available when the collaborator_type is COLLABORATOR_TYPE_GROUP . |
external_user | Object | Information about the external user. Only available when the collaborator_type is COLLABORATOR_TYPE_EXTERNAL_USER . |
Collaborator type
The type of the collaborator.
Key | Description |
---|---|
USER | The collaborator is a specific user. |
GROUP | The collaborator is a group. This means that every user that belongs to that group is also a collaborator. |
EXTERNAL_USER | The collaborator is not a SafetyCulture user. |
Collaborator role
The current role of an action collaborator.
Key | Description |
---|---|
ASSIGNEE | The collaborator is an assignee of the action. |
User
.collaborators[].user
contains the information about a specific user.
{
"user": {
"user_id": "c3aa4fae-bbad-4abf-8550-29c683012796",
"firstname": "SafetyCulture",
"lastname": "User"
}
}
Key | Type | Description |
---|---|---|
user_id | String (UUID) | ID of the user. |
firstname | String | First name of the user. |
lastname | String | Last name of the user. |
Group
.collaborators[].group
contains the information about a group.
{
"group": {
"group_id": "f877808b-9b86-4147-9269-274e0169e021",
"name": "Test Group"
}
}
Key | Type | Description |
---|---|---|
group_id | String (UUID) | ID of the group. |
name | String | Name of the group. |
External user
.collaborators[].external_user
contains the information about an external user (an user who do not belong to the organisation).
{
"external_user": {
"id": "4251c7c8-9af6-4233-8d4e-967b28a48c93",
"email": "[email protected]"
}
}
Key | Type | Description |
---|---|---|
id | String (UUID) | ID of the external user. |
email | String | Email of the external user. |
Reference
.reference
contains information about the entity that originated the action. Not available for standalone actions.
{
"reference": {
"type": "INSPECTION",
"id": "51d4482f-f78b-5a30-9618-2217025f55cc",
"inspection_context": {},
"sensor_alert_context": {}
}
}
Key | Type | Description |
---|---|---|
type | String | Type of the reference. |
id | String (UUID) | ID of the referenced entity. |
inspection_context | Object | Information about the Inspection that originated the action. Only available when the action was created from an Inspection. |
sensor_alert_context | Object | Information about the Sensor Alert that originated the action. Only available when the action was created from a Sensor Alert. |
Reference type
.reference.type
contains the type of the entity that originated the action.
Type | Description |
---|---|
INSPECTION | Indicates that the action was created from an inspection or inspection item. When the reference is from this type, the reference.id will be the ID of the Inspection. |
SENSOR_ALERT | Indicates that the action was created from a sensor alert. When the reference is from this type, the reference.id will be the ID of the Sensor Alert. |
Inspection context
.reference.inspection_context
contains the information of the inspection and inspection item that originated the action.
{
"inspection_context": {
"inspection_id": "effa93bb-8cfb-4783-af5d-c507340dc6e0",
"inspection_name": "11 Aug 2021 / Checklist",
"inspection_item_id": "67034555-c11e-4411-bf75-140866c555be",
"inspection_item_name": "Question Name",
"inspection_item_type": "",
"inspection_item_path": []
}
}
Key | Type | Description |
---|---|---|
inspection_id | String (UUID) | ID of the inspection (UUID). |
inspection_name | String | Name of the inspection. |
inspection_item_id | String (UUID) | ID of the inspection item (UUID). |
inspection_item_name | String | Name of the inspection item. |
inspection_item_type | String | Name of the inspection item type. |
inspection_item_path | String | The ancestor Names of the inspection item. |
Sensor alert context
.reference.sensor_alert_context
contains the information of the sensor alert that originated the action.
{
"sensor_alert_context": {
"sensor_alert_id": "79ce7380-0809-5a0a-9d58-a7ead30d078e",
"level": "OK",
"created_at": "2021-12-01T12:39:09.313635Z",
"detected_at": "2021-11-30T22:55:00Z",
"sensor_id": "a5ea5ae1-304c-46ef-9dfd-ce845208290f",
"site_name": "2 Lacey St - L1",
"metric_type": "WIND_GUST",
"sensor_name": "Weather"
}
}
Key | Type | Description |
---|---|---|
sensor_alert_id | String (UUID) | ID of the sensor alert. |
level | String | Level of importance of the sensor alert. |
created_at | String (ISO8601) | Date and time when the alert was created. |
detected_at | String (ISO8601) | Date and time when the alert was detected. |
sensor_id | String (UUID) | ID of the sensor where the alert was created. |
site_name | String | Name of the site where the alert was created. |
metric_type | String | Type of the alert metric. |
sensor_name | String | Name of the sensor where the alert was created. |
Sensor alert event level
.reference.sensor_alert_context.level
represents the level of importance of the sensor alert.
Level | Description |
---|---|
ALERT_EVENT_LEVEL_OK | Indicates that the device metric becomes healthy. |
ALERT_EVENT_LEVEL_INFO | Indicates that the first alert was sent. |
ALERT_EVENT_LEVEL_WARN | Indicates that the second alert was sent. |
ALERT_EVENT_LEVEL_CRITICAL | Indicates that the third alert was sent. |
Sensor alert metric type
.reference.sensor_alert_context.metric_type
represents the type of received metric.
Type | Description |
---|---|
METRIC_TYPE_TEMPERATURE | Temperature metric. |
METRIC_TYPE_HUMIDITY | Humidity metric. |
METRIC_TYPE_BATTERY | Battery level. Percentage based i.e. 0 - 100. |
METRIC_TYPE_SIGNAL | Signal strength metric. |
METRIC_TYPE_AIR_QUALITY_PM25 | Air quality for particulate matter less than 2.5 microns. |
METRIC_TYPE_AIR_QUALITY_PM10 | Air quality for particulate matter less than 10 microns. |
METRIC_TYPE_TEMPERATURE_2 | Alternative temperature for hardware that sends 2 temperatures. |
METRIC_TYPE_DIFFERENTIAL_AIR_PRESSURE | Differential air pressure. |
METRIC_TYPE_CO | Carbon monoxide. |
METRIC_TYPE_DOOR_OPEN_CLOSED | Door open/closed (boolean metric). |
METRIC_TYPE_BATTERY_VOLTAGE | Battery voltage metric. |