Trigger
The Trigger API allows you to list, create, update, patch, search by ID, and delete event triggers.
Refer to the Trigger API calls below:
- List triggers
- Create trigger
- Get trigger by ID
- Update trigger by ID
- Patch trigger by ID
- Delete trigger by ID
List triggers
Endpoints
GET platform-notificationsvc/api/v1/trigger
Permissions
You need the READ action on notificationsvc:trigger:* in each namespace the request acts on.
The namespaces come from the namespaces you name in the request, or from nsfilter when you name none. If neither names a namespace, the request requires the Platform Manager role. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
count | Integer | Maximum number of triggers to return. Defaults to 10. | Optional |
offset | Integer | Index of the first result to return. Defaults to 0. | Optional |
name | String | Exact name of the trigger to match. | Optional |
namespaces | String | Namespace to match. Repeat the parameter to match more than one. | Optional |
ids | String | ID to match. Repeat the parameter to match more than one. | Optional |
createdAt.after | String | Match records created after this ISO-8601 timestamp. | Optional |
createdAt.before | String | Match records created before this ISO-8601 timestamp. | Optional |
updatedAt.after | String | Match records updated after this ISO-8601 timestamp. | Optional |
updatedAt.before | String | Match records updated before this ISO-8601 timestamp. | Optional |
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
Response
{
_offset?: integer
_pageSize?: integer
_total?: integer
_list: {
_id?: string
_namespaces?: string[]
_createdAt?: string
_updatedAt?: string
_version?: integer
_name: string
_description?: string
_type: enum[EVENT]
_event: {
_filters: {
}
}
_script: {
id?: string
userType?: string
name?: string
versionId?: string
}
_senders: {
_id?: string
}[]
_templates:#/components/schemas/Ref[]
_groups:#/components/schemas/Ref[]
}[]
}
Create trigger
Endpoints
POST platform-notificationsvc/api/v1/trigger
Permissions
You need the CREATE action on notificationsvc:trigger:* in each namespace the request acts on.
The namespaces come from the namespaces you name in the request, or from nsfilter when you name none. If neither names a namespace, the request requires the Platform Manager role. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
Request body
{
_description?: string
_type: enum[EVENT]
_event: {
_filters: {
}
}
_script: {
id?: string
userType?: string
name?: string
versionId?: string
}
_senders: {
_id?: string
}[]
_templates:#/components/schemas/Ref[]
_groups:#/components/schemas/Ref[]
_namespaces?: string[]
_name: string
}
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
Response
{
_id?: string
_namespaces?: string[]
_createdAt?: string
_updatedAt?: string
_version?: integer
_name: string
_description?: string
_type: enum[EVENT]
_event: {
_filters: {
}
}
_script: {
id?: string
userType?: string
name?: string
versionId?: string
}
_senders: {
_id?: string
}[]
_templates:#/components/schemas/Ref[]
_groups:#/components/schemas/Ref[]
}
Get trigger by ID
Endpoints
GET platform-notificationsvc/api/v1/trigger/{id}
Permissions
You need the READ action on the trigger, which the service checks as notificationsvc:trigger:{id}. A grant on notificationsvc:trigger:* covers every trigger.
The namespaces come from the trigger itself, so a read by ID needs no nsfilter and does not require the Platform Manager role. Sending nsfilter does not bound a read by ID. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
id | String | ID of the trigger, as a path segment. | Required |
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
Response
{
_id?: string
_namespaces?: string[]
_createdAt?: string
_updatedAt?: string
_version?: integer
_name: string
_description?: string
_type: enum[EVENT]
_event: {
_filters: {
}
}
_script: {
id?: string
userType?: string
name?: string
versionId?: string
}
_senders: {
_id?: string
}[]
_templates:#/components/schemas/Ref[]
_groups:#/components/schemas/Ref[]
}
Update trigger by ID
Endpoints
PUT platform-notificationsvc/api/v1/trigger/{id}
Permissions
You need the EDIT action on the trigger, which the service checks as notificationsvc:trigger:{id}. A grant on notificationsvc:trigger:* covers every trigger.
The namespaces come from the trigger itself, so the request needs no nsfilter and does not require the Platform Manager role. If you do send nsfilter, it must cover the trigger's namespaces, or the request fails with HTTP 403. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
version | Integer | Expected current version of the trigger. The request fails if it does not match. | Optional |
Request body
{
_description?: string
_type: enum[EVENT]
_event: {
_filters: {
}
}
_script: {
id?: string
userType?: string
name?: string
versionId?: string
}
_senders: {
_id?: string
}[]
_templates:#/components/schemas/Ref[]
_groups:#/components/schemas/Ref[]
}
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
Response
Returns the updated trigger, in the same shape as Get trigger by ID.
Patch trigger by ID
Endpoints
PATCH platform-notificationsvc/api/v1/trigger/{id}
Permissions
You need the EDIT action on the trigger, which the service checks as notificationsvc:trigger:{id}. A grant on notificationsvc:trigger:* covers every trigger.
The namespaces come from the trigger itself, so the request needs no nsfilter and does not require the Platform Manager role. If you do send nsfilter, it must cover the trigger's namespaces, or the request fails with HTTP 403. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
version | Integer | Expected current version of the trigger. The request fails if it does not match. | Optional |
Request body
Send only the fields you want to change. Fields you omit keep their current values.
This applies to top-level fields only. A nested object or a list that you do send replaces the stored one outright, rather than merging into it, so send the whole of any nested value you change.
{
_description?: string
}
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
Response
Returns the updated trigger, in the same shape as Get trigger by ID.
Delete trigger by ID
Endpoints
DELETE platform-notificationsvc/api/v1/trigger/{id}
Permissions
You need the DELETE action on the trigger, which the service checks as notificationsvc:trigger:{id}. A grant on notificationsvc:trigger:* covers every trigger.
The namespaces come from the trigger itself, so the request needs no nsfilter and does not require the Platform Manager role. If you do send nsfilter, it must cover the trigger's namespaces, or the request fails with HTTP 403. For the full model, see Permissions and namespaces.
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespaces this request acts within. Repeat the parameter, or separate values with commas, to name more than one. See Permissions and namespaces. | Optional |
version | Integer | Expected current version of the trigger. The request fails if it does not match. | Optional |
Response
Codes
| Code | Description |
|---|---|
204 | No Content |
400 | Bad Request |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
Response
No response body.