> 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/_setarchived.md).

# \_setArchived

Sets whether the Job Type is archived or not.

### Parameters

#### id

The ID of the Job Type.

#### val

Decides if the Job Type is archived or not:\
0 => No,\
1 => Yes

### Example

```
FM_api(
    'JobType_setArchived',[
        'id' => '122041',
        'val' => '0'
    ]
);
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If there is no "id" value set or it is less than 1

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

If there is no "val" variable set

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