# \_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', 
	array(
		'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"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/contract/_setactive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
