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

# \_setActive

Set the status of a Contract - active or inactive

### Parameters

#### id

The id of the contract in question

#### active

The status of the contract: 1 for active, 0 for inactive (or "finished")

### Example

```
FM_api('Contract_setActive',[
		'id'=>'9',
		'active'=>'0'
	]
);
```

### Result

If the Contract status is successfully updated, the result will be:

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

If a valid "id" parameter is not supplied, the following error is returned:

```
{"error":"no ID provided"}
```

If the "id" parameter is supplied, but no status, then the following error is returned:

```
{"error":"no active value provided"}
```

If the "id" parameter does not match the ID of an existing Contract:

```
{"error":"contract does not exist"}
```
