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

# \_decision

Sets what decision will be done for a pending Availability made.

### Parameter

#### id

The ID of the Availability which will be decided on.

#### status

What will be done with the Availability:

* 1 = Approve
* 2 = Reject
* 3 = Cancel

### Example

```
FM_api('Availability_decision',[
	  'id'=>'60004',
		'status'=>'3'
	]
);
```

### Result

```
{"ok":1,"event":{"id":60004,"obj_type":"department","obj_id":2,"event_type":"unpaid_leave","availability":1,"status":3,"status_name":"cancelled","name":"The J_Day","start_e":1781823600,"end_e":1781910000,"all_day":1,"paid":1,"requested_by":113747,"approved_by":113747,"approved_at":1781700745,"notes":"test availability","meta":[],"cdate":1781616860,"last_edited":1781702071,"created_by":113747}}
```

#### On Failure

If the "id" parameter is not set or it does not match the ID of an existing Availability:

```
{"error":"availability event not found"}
```

If the "status" parameter is set to a value outside 1, 2 or 3:

```
{"error":"invalid status"}
```
