---
title: "CreateTriggerBody"
description: "Request body for creating a Trigger."
section: "Reference"
group: "Types"
order: 244
---

## Definition

```ts
interface CreateTriggerBody {
  workspaceId: string;
  eventType: string;
  targetId: string;
  subjectId?: string | undefined;
  filter?:
    | {
        version: 1;
        root: import("/home/runner/work/aeontel/aeontel/packages/shared/src/conditions/schema").ConditionNode;
      }
    | null
    | undefined;
}
```

## Fields

| Field         | Type                                                                                                                                          | Notes                                                                                         |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `workspaceId` | `string`                                                                                                                                      | `required` — Workspace that will own the new listener.                                        |
| `eventType`   | `string`                                                                                                                                      | `required` — Event type to listen for                                                         |
| `targetId`    | `string`                                                                                                                                      | `required` — Target entity ID                                                                 |
| `subjectId`   | `string \| undefined`                                                                                                                         | `optional` — Optional subject scope. When set, only fires for events whose subjectId matches. |
| `filter`      | `{ version: 1; root: import("/home/runner/work/aeontel/aeontel/packages/shared/src/conditions/schema").ConditionNode; } \| null \| undefined` | `optional` — Optional filter condition evaluated against the event.                           |
