> For the complete documentation index, see [llms.txt](https://docs.imperialcad.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imperialcad.app/api-and-integrations/api-integrations/emergency-endpoints/get-unit-status.md).

# Get Unit Status

This endpoint allows you to retrieve a user's current unit status inside ImperialCAD.

This is intended for integrations that need to check whether a user is actively logged into a department, unavailable, off duty, or inactive inside the community.

{% hint style="warning" %}
This endpoint requires **an Advanced** ImperialCAD subscription or higher.
{% endhint %}

`POST` `https://imperialcad.app/api/1.1/wf/getunit`

***

### Request Body

| Name              | Type   | Description                              |
| ----------------- | ------ | ---------------------------------------- |
| `commId`          | string | Your ImperialCAD community ID            |
| `users_discordID` | string | The Discord ID of the user being checked |

***

### Headers

Use the standard ImperialCAD API headers shown in the API Getting Started documentation.

***

### Example

```json
{
  "commId": "1723018855907x983892761338183700",
  "users_discordID": "601892764086435851"
}
```

### Successful Active Unit Response

If the user is actively logged into a department in the provided community, the endpoint may return:

{% code overflow="wrap" %}

```jsonl
{
  "status": "success",
  "response": {
    "dept": "Blaine County Sheriffs Office",
    "dept-type": "Law Enforcement",
    "logged-in": true,
    "status": "AVAIL",
    "desc": "(MDC) Logged In",
    "callsign": "123A"
  }
}
```

{% endcode %}

***

### Unavailable Response

If the user is currently active in another community or unavailable due to activity elsewhere, the endpoint may return:

```
{  "status": "BUSY",  "message": "This user is unavailable"}
```

***

### Off Duty / Inactive Response

If the user is part of the community but is not actively logged into a department or doing anything in a community department, the endpoint may return:

```json
{
  "status": "success",
  "response": {
    "logged-in": false,
    "status": "ONDT",
    "callsign": "123A"
  }
}
```

***

### Notes

This endpoint checks a user's current unit status based on the provided community ID and Discord ID.

If the user is actively logged into a department in the community, the response will include department information, department type, unit status, status description, and callsign.

If the user is logged into the community but is not actively doing anything in a community department, the response may still include their last entered or last set unit information, such as their callsign.

If the user is active somewhere else or otherwise unavailable, the API may return a `BUSY` status instead of a standard success response.
