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

# \_setContractId

Assigns a Contract to a Job.

### Parameters

#### id

The ID of the Job to assign the Contract to.

#### contract\_id

The ID of the Contract to assign to the Job.

### Example

```
FM_api('Job_setContractId', ['id' => '123', 'contract_id' => '234']);
```

### Result

#### On Success

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

If the Contract ID given is already assigned to the Job:

```
{'ok':1,'warning':'value already set'}
```

#### On Failure

If no Job ID is provided:

```
{'error':'no ID supplied'}
```

If no Contract ID is provided:

```
{'error':'no contract_id supplied'}
```

If the Job does not exist:

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