> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/jobtype/_setnotification.md).

# \_setNotification

Toggles Email Notifications based on the Job Type

### Parameters

#### id

The id of the Job Type

#### val

The chosen option for the Notifications toggle

0 = blank (Notifications are sent based on job form or Notification settings)\
1 = no\
2 = yes

### Example

```
FM_api(
    'JobType_setNotification',[
        'id' => '122039',
        'val' => '1'
    ]
);
```

#### On Success

```
{"ok":1}
```

#### On Failure

If there's no Job Type with the chosen ID

```
{"error":"job type does not exist"}
```

If there's no chosen ID or the chosen ID is less than 1

```
{"error":"missing or invalid parameter: id"}
```

If the val parameter is less than 0

```
{"error":"missing or invalid parameter: val"}
```
