---
title: "Find the most recent engagement event by name"
method: GET
path: "/engagements/{engagementId}/findLatest/{eventName}"
tags: ["engagements"]
---

# Find the most recent engagement event by name

`GET /engagements/{engagementId}/findLatest/{eventName}`

## Request

- Base URL: `https://api.lumahealth.io/api/v2`
- URL: `https://api.lumahealth.io/api/v2/engagements/{engagementId}/findLatest/{eventName}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lumahealth/apis/rest-service/docs/engagements/:engagementId/findLatest/:eventName/get.ts> (a function with typed inputs; its response is checked against the schema)

Finds the most recent EngagementEvent for this engagement whose `payload.name` matches `eventName`.

## Path parameters

- `engagementId` string, required
- `eventName` string, required

## Response `200`

The most recent matching engagement event

- EngagementEventResponse: An EngagementEvent is an immutable, append-only log record of something that happened during an Engagement, such as an agent being assigned, a message being sent or received, a voice call starting or ending, or a lifecycle transition. Each event belongs to exactly one Engagement, and the ordered set of events for an engagement forms its event-sourcing history.
  - `_id` string: Luma's internal ID of an object.
  - `user` string: The ID of the root account user.
  - `deleted` 0 | 1: Flag for logical deletion where 1 means deleted.
  - `createdBy` string: The ID of the user who created this object.
  - `updatedBy` string: The ID of the user who updated this object.
  - `createdAt` string, date-time: The date/time when this object was created.
  - `updatedAt` string, date-time: The date/time when this object was updated.
  - `engagement` string: ID of the parent Engagement this event occurred during.
  - `recipient` string: ID of the user this event is about, if applicable.
  - `payload` object: The event's contents.
    - `name` string: The kind of event, for example `AgentAssigned`, `MessageSent`, `VoiceCallStarted`, `EngagementCompleted`.
    - `body` object: Event-specific data, shape depends on `name`.
    - `metadata` object
      - `source` object
        - `service` string
        - `agent` string
        - `operation` string
      - `update` object[]
        - `fromEvent` string
        - `toEngagement` string
        - `op` '$set' | '$push' | '$pull' | '$addToSet'

## Other responses

- `401`: Not authenticated
- `403`: Access token does not have the required scope
- `404`: No matching event found

---

[API](https://skmtc.dev/lumahealth/apis/rest-service.md) - [All operations](https://skmtc.dev/lumahealth/apis/rest-service/llms.txt) - [OpenAPI document](https://skmtc.dev/lumahealth/apis/rest-service/revisions/f19aeba84a26?raw)
