Update Incident

Updates an existing incident in Sodtrack.

PATCH/api/integration/incident

Request

cURL
curl -X PATCH "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/incident" \
  -H "Authorization: Bearer $SODTRACK_TOKEN"

Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com Β· other environments

Responses

Create Incident
{
  "id": 45,
  "bookingId": 1515,
  "incidentStatus": {
    "id": 1
  }
}

Error responses for this endpoint follow the shared error reference.

Purpose

Updates an existing incident in Sodtrack.

The incident is identified by incident (by incidentId or incidentReference). Only the fields you send are updated; omitted fields keep their current values. You can update the description, incident status, accountable user, and dynamic forms data.


Field Definitions

πŸ“‹ Request body

FieldTypeRequiredDescription
incidentobjectβœ…Incident identifier (by ID or reference).
descriptionstring❌New incident description. Only sent if you want to change it.
incidentStatusobject❌New incident status identifier. Only statusId is supported; statusReference is not yet supported.
accountableUserobject❌New user accountable for the incident. If provided, must resolve to an existing user.
dynamicFormsarray[object]❌Optional form data (if configured for incident status change). See Dynamic forms below.

πŸ“ Dynamic forms

FieldTypeRequiredDescription
dynamicFormsarray[object]❌List of form snapshots to submit.
dynamicForms[].formReferencestringβœ… when form sentIdentifier of the form (must match a form configured for the incident status change flow).
dynamicForms[].valuesarray[object]βœ… when form sentList of field values for this form.
dynamicForms[].values[].fieldReferencestringβœ…Identifier of the form field (must match a field in the form).
dynamicForms[].values[].valuestringβœ…Submitted value for the field. Numbers are accepted and converted to string.

πŸ“Œ Incident status identifier

FieldTypeRequiredDescription
incidentStatus.typestringβœ… when incidentStatus sentMust be "statusId". "statusReference" is not yet supported.
incidentStatus.valuestringβœ… when incidentStatus sentNumeric ID of the incident status (must exist in Sodtrack).

πŸ‘€ User information (accountable)

FieldTypeRequiredDescription
typestringβœ… when accountableUser sentUser identifier type: "userId", "userEmail", or "userReference".
valuestringβœ… when accountableUser sentThe user ID, email, or reference according to type.

Example Request (by incident reference)

json
{
  "incident": {
    "type": "incidentReference",
    "value": "INC-EXT-2025-001"
  },
  "description": "Actualizado: resoluciΓ³n en progreso.",
  "incidentStatus": {
    "type": "statusId",
    "value": "2"
  },
  "accountableUser": {
    "type": "userEmail",
    "value": "manager@example.com"
  }
}

Example Request (by incident ID)

json
{
  "incident": {
    "type": "incidentId",
    "value": "101"
  },
  "description": "DescripciΓ³n actualizada del incidente.",
  "incidentStatus": {
    "type": "statusId",
    "value": "3"
  },
  "dynamicForms": [
        {
            "formReference": "incident_status_update_form",
            "values": [
                {
                    "fieldReference": "incident_status_update_form_field_1",
                    "value": "yesterday"
                }
            ]
        }
    ]
}

Example Request (minimal β€” change status only)

json
{
  "incident": {
    "type": "incidentId",
    "value": "101"
  },
  "incidentStatus": {
    "type": "statusId",
    "value": "2"
  }
}

Response Example

json
{
  "id": 101,
  "entityType": "booking",
  "entityId": 12345,
  "bookingId": 12345,
  "incidentStatus": {
    "id": 2,
    "name": "In Progress",
    "description": "In Progress",
    "isFinalStatus": false,
    "isInitialStatus": false,
    "bookingStatusUpdate": ""
  }
}

Response Fields

FieldTypeDescription
idnumberIncident ID.
entityTypestringEntity type: "booking" or "lead".
entityIdnumberEntity ID (booking id or lead id).
bookingIdnumberPresent only when entityType is "booking".
incidentStatusobjectUpdated incident status (id, name, description, isFinalStatus, isInitialStatus, bookingStatusUpdate).

Error Responses

HTTP StatusErrorDescription
400 Bad RequestINCIDENT_NOT_FOUNDNo incident found for the given ID or reference.
400 Bad RequestMULTIPLE_INCIDENTS_FOUND_FOR_REFERENCEMore than one incident matches the given reference.
400 Bad RequestINVALID_INCIDENT_TYPEInvalid incident identifier type (must be incidentId or incidentReference).
400 Bad RequestINVALID_ACCOUNTABLE_USERaccountableUser was provided but could not be resolved to an existing user.
400 Bad RequestINVALID_INCIDENT_STATUS_IDStatus id must be a number.
400 Bad RequestINCIDENT_STATUS_NOT_FOUNDThe incident status ID does not exist in Sodtrack.
400 Bad RequestINCIDENT_STATUS_REFERENCE_NOT_SUPPORTEDResolution by statusReference is not yet supported. Use statusId.
400 Bad RequestINVALID_INCIDENT_STATUS_TYPEInvalid incident status identifier type.
400 Bad RequestInvalidParametersOne or more required fields are missing or invalid.
401 Unauthorizedβ€”Authentication token missing or expired.
403 Forbiddenβ€”The API key or origin is not authorized.
500 Internal Server Errorβ€”Unexpected server error. Contact Sodtrack support.

Business Rules & Constraints

Incident identification

  • incident is required, with type and value.

  • type must be incidentId or incidentReference. Any other value returns INVALID_INCIDENT_TYPE.

  • If no incident is found for the given ID or reference, the API returns INCIDENT_NOT_FOUND.

  • When type = incidentReference, if more than one incident matches the reference, the API returns MULTIPLE_INCIDENTS_FOUND_FOR_REFERENCE.


Update behavior

  • description, incidentStatus, and accountableUser are optional. Only provided fields are updated; omitted fields leave existing values unchanged.

  • You can send only incident plus one or more of description, status, and accountable user.


Accountable user

  • When accountableUser is provided, it must resolve to an existing user (by userId, userEmail, or userReference). If the user cannot be resolved, the request fails with INVALID_ACCOUNTABLE_USER.

Incident status

  • incidentStatus (when provided) must use type = statusId. statusReference is not yet supported and returns INCIDENT_STATUS_REFERENCE_NOT_SUPPORTED.

  • value must be a valid numeric status ID that exists in Sodtrack. Invalid number returns INVALID_INCIDENT_STATUS_ID; non-existent status returns INCIDENT_STATUS_NOT_FOUND.


Data and format

  • Dynamic form data (when provided) is validated and stored according to the incident status change flow configuration.

  • All timestamps in responses follow ISO 8601 format (UTC) where applicable.