# Get Events by Entity Type and Entity ID

Retrieve a cursor-based paginated list of events for a specific entity type and entity ID, sorted by created_at in descending order

Endpoint: GET /rmg/api/orchestration/{entityType}/events/{entityId}
Version: 1.0
Security: x-api-key

## Path parameters:

  - `entityType` (string, required)
    Type of entity for events
    Enum: "Task"

  - `entityId` (string, required)
    The ID of the entity

## Query parameters:

  - `eventType` (string)
    Optional filter by event type

  - `orgIdentifier` (string)
    Organisation Identifier

  - `projectIdentifier` (string)
    Project Identifier

  - `cursor` (string)
    Cursor Based Pagination

  - `limit` (number)
    The number of records expected

## Header parameters:

  - `Harness-Account` (string, required)
    Account Identifier

## Response 200 fields (application/json):

  - `events` (array, required)
    List of events

  - `events.entityId` (string, required)
    The ID of the entity

  - `events.entityType` (string, required)
    Type of entity for events
    Enum: "Task"

  - `events.type` (string, required)
    Type of event
    Enum: "Status"

  - `events.eventMetadata` (object, required)
    Metadata for an event

  - `events.eventMetadata.from` (string, required)
    The previous state/value

  - `events.eventMetadata.to` (string, required)
    The new state/value

  - `events.createdBy` (object, required)
    Details of the user who created the event

  - `events.createdBy.name` (string, required)
    Name of the user who created the event

  - `events.createdBy.email` (string, required)
    Email of the user who created the event

  - `events.createdBy.identifier` (string)
    Identifier of the user who created the event

  - `events.createdAt` (integer, required)
    Unix timestamp when the event was created

  - `nextRequest` (object, required)

  - `nextRequest.cursor` (string)

  - `nextRequest.limit` (integer)

  - `last` (boolean, required)
    Whether this is the last page of results

## Response 400 fields (application/json):

  - `message` (string, required)
    error message detail

  - `code` (string)
    canonical error code name
    Enum: "BAD_REQUEST", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "INTERNAL_SERVER_ERROR"


