Incident
Manage incidents, including reporting, updating, deleting, and advanced search.
Incidents can be linked to offices, projects, and categories, and support metadata and filtering.
- Version
- 2.0.0
- OpenAPI version
- 3.0.0
Operations
Section titled “Operations” POST /v2/incident/index
Returns a paginated and filterable list of incidents.
Use POST to allow complex filters via JSON payload.
Request Body
Section titled “Request Body ”Parameters for searching incidents
object
object
The field of the model to sort the list for, use a minus to revert the sort. Es -name is to require the sort in reverse order
The field establishes whether to also include historized elements that are no longer active in the results. If you leave this parameter empty the response returns only actual entries.
Example
{ "filter": { "name": "Incident 1", "category": "Injury" }, "per-page": 10, "page": 1, "sort": "name"}
Responses
Section titled “ Responses ”List of incidents
object
Example
{ "office_incident_id": "inc-1", "code": "INC-001", "name": "Incident 1", "date_incident": "2024-01-01", "category": "Injury", "description_event": "Minor injury occurred", "status": "open", "tenant_id": "ten-1", "subtenant_id": "sub-1"}
Headers
Section titled “Headers ”Current page
Total number of pages
Number of items per page
Total number of items
create
Section titled “create” POST /v2/incident/create
Create a new incident by providing the required details.
Request Body required
Section titled “Request Body required ”Incident object to be created
object
Example
{ "code": "INC-002", "name": "Incident 2", "date_incident": "2024-02-01", "category": "Fire", "description_event": "Small fire in warehouse", "status": "new", "tenant_id": "ten-1", "subtenant_id": "sub-1"}
Responses
Section titled “ Responses ”Incident created successfully
object
Example
{ "office_incident_id": "inc-2", "code": "INC-002", "name": "Incident 2", "date_incident": "2024-02-01", "category": "Fire", "description_event": "Small fire in warehouse", "status": "new", "tenant_id": "ten-1", "subtenant_id": "sub-1"}
GET /v2/incident/view/{id}
Retrieve an incident by its unique ID.
Path Parameters
Section titled “Path Parameters ”ID of the incident to retrieve
Responses
Section titled “ Responses ”Incident found
object
Example
{ "office_incident_id": "inc-1", "code": "INC-001", "name": "Incident 1", "date_incident": "2024-01-01", "category": "Injury", "description_event": "Minor injury occurred", "status": "open", "tenant_id": "ten-1", "subtenant_id": "sub-1"}
Incident not found
delete
Section titled “delete” DELETE /v2/incident/delete/{id}
Delete an incident by its unique ID.
If force=true, all related entities will also be deleted.
Path Parameters
Section titled “Path Parameters ”ID of the incident to delete
Query Parameters
Section titled “Query Parameters ”Force the deletion of the entity and all related entities
Responses
Section titled “ Responses ”Incident deleted successfully
If force=false, the operation is interrupted and the list of connected entities that will be deleted in case of confirmation (force=true) is returned
update
Section titled “update” PUT /v2/incident/update/{id}
Update an existing incident by its unique ID.
Path Parameters
Section titled “Path Parameters ”ID of the incident to update
Request Body required
Section titled “Request Body required ”Incident object with updated data
object
Example
{ "name": "Updated Incident", "category": "Near Miss"}
Responses
Section titled “ Responses ”Incident updated successfully
object
Example
{ "office_incident_id": "inc-1", "name": "Updated Incident", "category": "Near Miss"}
Incident not found