> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Trigger object

> Create a Trigger object

[Triggers][1] serve as automated starting points for flows, allowing for multiple entry points and additional filters to target specific contacts. Utilize the REST [CreateDefaultWorkflowTrigger][3] endpoint to retrieve a pre-populated default `WorkflowTrigger`, ideal for initiating new triggers.

<Note>
  A new trigger can be saved alongside a [new flow][6] by including it in the flow object. Alternatively, a trigger can be saved to an existing flow using the [SaveWorkflowTrigger Agent][4].
</Note>

## Request

```http theme={null}
POST https://{{env}}.superoffice.com/{{tenant}}/v1/Agents/Workflow/CreateDefaultWorkflowTrigger HTTP/1.1
Authorization: Bearer {{access_token}}
Accept: application/json
```

## Response

```json theme={null}
{
  "WorkflowTriggerId": 0,
  "WorkflowId": 0,
  "TriggerType": "None",
  "RestrictionGroups": [],
  "TableRight": null,
  "FieldProperties": {}
}
```

### Key properties

| Property          | Description                                                                                                              |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------ |
| WorkflowTriggerId | Unique identifier assigned by the system upon saving the trigger. Should not be set manually.                            |
| WorkflowId        | Unique identifier for the flow. Automatically set to the flow's ID if the trigger is part of the flow.                   |
| TriggerType       | Name (not the enumValue) of the trigger type being created. Refer to the [type of trigger][2] documentation for details. |
| RestrictionGroups | Specifies the conditions under which the trigger should execute. Similar to `ArchiveRestrictionGroup` for [Find][5].     |

## Example of edited Trigger object

```json theme={null}
{
    "WorkflowTriggerId": 0,
    "WorkflowId": 1,
    "TriggerType": "CreatedRequest",
    "RestrictionGroups": [
        {
            "Name": "Trigger from API",
            "Description": "This trigger is created through the API",
            "Rank": 0,
            "Restrictions": [
            {
                "Name": "request/slevel",
                "Operator": "oneOf",
                "Values": [
                "[I:1]"
                ]
            }
            ]
        }
    ]
}
```

**Response:**

```json theme={null}
{
  "WorkflowTriggerId": 5,
  "WorkflowId": 1,
  "TriggerType": "CreatedRequest",
  "RestrictionGroups": [
    {
      "Name": "Trigger from API",
      "Description": "This trigger is created through the API",
      "Rank": 0,
      "Restrictions": [
        {
          "Name": "request/slevel",
          "Operator": "oneOf",
          "Values": [
            "[I:1]"
          ],
          "DisplayValues": [
            "[SR_SLEVEL_INTERNAL]"
          ],
          "ColumnInfo": {
            "DisplayName": "[SR_TICKETARCHIVE_SLEVEL]",
            "DisplayTooltip": "[SR_TICKETARCHIVE_SLEVEL]",
            "DisplayType": "string",
            "CanOrderBy": true,
            "Name": "request/slevel",
            "CanRestrictBy": true,
            "RestrictionType": "listAny",
            "RestrictionListName": "TicketSLevel",
            "IsVisible": true,
            "ExtraInfo": "",
            "Width": "10%",
            "IconHint": "Ticket",
            "HeadingIconHint": ""
          },
          "IsActive": true,
          "SubRestrictions": null,
          "InterParenthesis": 0,
          "InterOperator": "And",
          "UniqueHash": 422435087
        }
      ]
    }
  ],
  "TableRight": null,
  "FieldProperties": {}
}
```

[1]: ../../../../marketing/flows/learn/create#trigger

[2]: ../../../../database/tables/enums/workflowtriggertype

[3]: ../../../reference/restful/agent/Workflow_Agent/v1WorkflowAgent_CreateDefaultWorkflowTrigger

[4]: ../../../reference/restful/agent/Workflow_Agent/v1WorkflowAgent_SaveWorkflowTrigger

[5]: ../../../search/find-selection/index

[6]: ./rest-save-flow


## Related topics

- [Triggers](/en/customization/macros-and-scripts/admin/trigger.md)
- [Create Default Workflow Trigger](/en/api/reference/restful/agent/workflow_agent/create-default-workflow-trigger.md)
- [Create a Step object](/en/api/web-services/howto/flows/rest-create-flow-step.md)
- [Create Default Trigger Script Entity](/en/api/reference/restful/agent/crmscript_agent/create-default-trigger-script-entity.md)
- [Create an EmailFlow object](/en/api/web-services/howto/flows/rest-create-default-email-flow.md)
- [Create a SuperOffice CRM new trigger](/integrations/zapier/howto/triggers/new.md)
