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

# \_setActive

Sets whether an Asset is Active or not.

### Parameters

#### id

The ID of the Asset.

#### val

An integer value which decides if the Asset is Active or not\
0 => Inactive\
1 => Active

### Example

```
FM_api('Asset_setActive',[
    'id'=>'526191',
    'val'=>'0'
    ]
);
```

### Result

#### On Success

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

If the "val" parameter's value already matches the current status of the Asset:

```
{'ok':1,'msg':'no change needed'}
```

#### On Failure

If the "id" parameter is not given a value or has a value less than 1:

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

If the "value" parameter is not given a set value:

```
{'error':'missing parameter: val'}
```

If the "id" parameter does not match an existing asset:

```
{'error':'asset does not exist'}
```
