Get Entity Incident

This endpoint returns the list of incidents associated with a given entity (booking or lead).

GET/api/integration/incident

Request

cURL
curl -X GET "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/incident?entity=booking&entityId=135" \
  -H "Authorization: Bearer $SODTRACK_TOKEN"

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

Query parameters

NameTypeDescription
entitystring
booking
entityIdstring
135

Responses

Get Entity Incident
[
  {
    "id": 53,
    "description": "Prueba de inyección de un incidente vía integración. 17-11-2025 incidente 1",
    "bookingId": 2343,
    "bookingVariantName": "Presupuesto instalación Electrodomésticos",
    "bookingStatus": "done",
    "bookingDate": "2025-11-18T11:00:00.000Z",
    "bookingReference": "UPDT-2-FROM-EXT-INT",
    "bookingIncidentReason": {
      "id": 18,
      "name": "Incidentes naturales",
      "description": "Árboles caídos, hoyos en el camino, agua en exceso, nieve, etc"
    },
    "bookingIncidentStatus": {
      "id": 1,
      "name": "Create",
      "description": "Created status"
    },
    "userReporter": {
      "id": 15,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe@sodtrack.com",
      "reference": null
    },
    "userCreator": {
      "id": 15,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe@sodtrack.com",
      "reference": null
    },
    "userAccountable": {
      "id": 15,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe@sodtrack.com",
      "reference": null
    },
    "bookingIncidentAttachments": [],
    "offlineCreatedDate": null,
    "createdDate": "2025-11-17T17:34:46.856Z",
    "updatedDate": "2025-11-17T17:34:46.856Z",
    "reference": "ext-int-creation#1"
  },
  {
    "id": 54,
    "description": "Prueba de inyección de un incidente vía integración. 17-11-2025 incidente 2 update 1",
    "bookingId": 2343,
    "bookingVariantName": "Presupuesto instalación Electrodomésticos",
    "bookingStatus": "done",
    "bookingDate": "2025-11-18T11:00:00.000Z",
    "bookingReference": "UPDT-2-FROM-EXT-INT",
    "bookingIncidentReason": {
      "id": 18,
      "name": "Incidentes naturales",
      "description": "Árboles caídos, hoyos en el camino, agua en exceso, nieve, etc"
    },
    "bookingIncidentStatus": {
      "id": 2,
      "name": "resuelto",
      "description": "El incidente fue resuelto"
    },
    "userReporter": {
      "id": 15,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe@sodtrack.com",
      "reference": null
    },
    "userCreator": {
      "id": 15,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe@sodtrack.com",
      "reference": null
    },
    "userAccountable": {
      "id": 16,
      "name": "Felipe",
      "lastName": "Hanckes",
      "email": "felipe+2@sodtrack.com",
      "reference": null
    },
    "bookingIncidentAttachments": [],
    "offlineCreatedDate": null,
    "createdDate": "2025-11-17T17:38:59.290Z",
    "updatedDate": "2025-11-20T03:55:46.668Z",
    "reference": "ext-int-creation#2"
  }
]

Error responses for this endpoint follow the shared error reference.

General Description

This endpoint returns the list of incidents associated with a given entity (booking or lead). The entity is identified by query parameters entity and entityId. Only booking and lead entities are supported for incident detail; project is not supported and returns an error.


Query Parameters

ParameterTypeRequiredDescription
entityenumYesEntity type. Must be one of: booking, lead, project. Only booking and lead are supported for incident detail.
entityIdnumberYesID of the booking or lead to fetch incidents for.

Success Response

Returns an array of incident objects. Each item includes:

FieldTypeDescription
idnumberIncident ID.
descriptionstringIncident description.
entityTypestringEntity type (booking or lead).
entityIdnumberEntity ID.
bookingIncidentReasonobject{ id, name, description }.
bookingIncidentStatusobject{ id, name, description }.
userReporterobject{ id, name, lastName, email, reference }.
userCreatorobject{ id, name, lastName, email, reference }.
userAccountableobject{ id, name, lastName, email, reference } (nullable).
bookingIncidentAttachmentsarrayAttachments linked to the incident.
tasksarrayTasks linked to the incident.
offlineCreatedDatestringOffline creation date (when applicable).
createdDatestringCreation date.
updatedDatestringLast update date.
referencestringExternal reference (optional).
bookingIdnumberPresent when entity is booking.
bookingVariantNamestringPresent when entity is booking.
bookingStatusstringPresent when entity is booking.
bookingDatestringPresent when entity is booking.
bookingReferencestringPresent when entity is booking.
leadIdnumberPresent when entity is lead.
leadReferencestringPresent when entity is lead (optional).

Example Request

http
GET /integration/api/incident?entity=booking&entityId=73

Example Response

http
HTTP/1.1 200 OK
Content-Type: application/json
json
[
  {
    "id": 1,
    "description": "Customer reported delay",
    "entityType": "booking",
    "entityId": 12345,
    "bookingIncidentReason": { "id": 1, "name": "Delay", "description": "Service delay" },
    "bookingIncidentStatus": { "id": 1, "name": "Open", "description": "Open" },
    "userReporter": { "id": 10, "name": "John", "lastName": "Doe", "email": "john@example.com", "reference": "USR-001" },
    "userCreator": { "id": 10, "name": "John", "lastName": "Doe", "email": "john@example.com", "reference": "USR-001" },
    "userAccountable": { "id": 11, "name": "Jane", "lastName": "Smith", "email": "jane@example.com", "reference": "USR-002" },
    "bookingIncidentAttachments": [],
    "tasks": [],
    "createdDate": "2025-02-20T10:00:00.000Z",
    "updatedDate": "2025-02-20T10:00:00.000Z",
    "reference": "INC-EXT-001",
    "bookingId": 12345,
    "bookingVariantName": "Installation",
    "bookingStatus": "scheduled",
    "bookingDate": "2025-02-25",
    "bookingReference": "BKG-123"
  }
]

Example Error Response

json
{
  "statusCode": 400,
  "message": "ENTITY_NOT_SUPPORTED: Only booking and lead entities are supported for incident detail.",
  "error": "Bad Request"
}