---
title: "Save trigger to triggers repository"
method: POST
path: "/rest/manager/triggers/save"
tags: ["Triggers APIs"]
---

# Save trigger to triggers repository

`POST /rest/manager/triggers/save`

## Request

- Base URL: `https://masonconsole.com`
- URL: `https://masonconsole.com/rest/manager/triggers/save`
- Auth: HTTP bearer

This API endpoint is used to create or update a trigger repository item. It expects an HTTP POST request with a `Trigger` object in the request body. The API performs access control checks, executes pre-save operations, and then saves the trigger repository item. If it's a new item, it sets the creation date before saving.

## Request body

- Trigger
  - `triggerId` string
  - `triggerName` string
  - `description` string
  - `domain` string
  - `owner` string
  - `triggerData` TriggerData
    - `execCondition` string
    - `execConditionSuccessCode` integer
    - `execConditionScript` boolean
    - `@class` string, required
  - `creationDate` string, date-time
  - `privateRepoItem` boolean
  - `color` string
  - `fontIcon` string

## Response `200`

Successful response

- SaveTriggersResponse
  - `data` SaveTriggersData: The data returned in the response.
    - `triggerid` string
  - `result` string: The result of the login operation. Should be either 'SUCCESS' or 'FAILURE'.
  - `message` string: The message associated with the login response (applicable in case of 'FAILURE').
  - `@class` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests
- `500`: Internal server error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/bymason/apis/mason-device-console-api-docs.md) - [All operations](https://skmtc.dev/bymason/apis/mason-device-console-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/bymason/apis/mason-device-console-api-docs/revisions/d9cdcc14b7d1?raw)
