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

# \_setPriority

Set the priority of a Job Type

### Parameters

#### id

The id of the Job Type

#### priority

The chosen priority of the Job Type:

0 = Null,\
1 = None,\
2 = Low,\
3 = Normal,\
4 = High,\
5 = Top

### Example

```
FM_api(
    'JobType_setPriority',[
        'id' => '122039',
        'priority' => '5'
    ]
);
```

#### On Success

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

#### On Failure

If there's no Job Type with the chosen ID

```
{"error":"job type does not exist"}
```

If there's no chosen ID or the chosen ID is less than 1

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

If the "priority" parameter is less than 0

```
{"error":"invalid parameter: priority"}
```

If there is no "priority" parameter value set

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

If the "priority" parameter is higher the amount of priority options available, or the account does not have "appointment-priorities" set.

```
{"error":"appointment-priorities not found"}
```
