> 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"}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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