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

# \_setName

Edit the name of an existing Contract

### Parameters

#### id

The ID of the Contract to be edited

#### name

The new name of the Contract

### Example

```
FM_api('Contract_setName',[
  'id'=>'34521',
  'name'=>'test contract'
  ]
);
```

### Results

#### On Success

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

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

#### On Failure

If the "id" parameter is not set or has an integer value less than 1:

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

If the "name" parameter has over 64 characters after being trimmed:

```
{"error":"parameter too long: name"}
```

If the "name" parameter is empty:

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

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

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