Public API

Fetch Unit

GET https://api.dutylogs.com/v1/public/units

An endpoint to gather the details of a unit, with the option to include some metric data.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <public_api_key>

Query Parameters

Name
Type
Description
Example

unit_id

integer

Unique Identifier for the Unit

1234

discord_id

string

If you use discord_id instead of unit_id, you must specify the entity_id

"123456789123456789

entity_id

string

Entity Identifier, only used if you're using discord_id instead of unit_id

"lspd"

metrics [optional]

boolean

Optionally include total active and afk time from past 14 days

true/false

actions [optional]

boolean

Optionally include the actions received by the unit from the past 28 days

true/false

Response

{
  "id": 1232,
  "username": "Michael Scott",
  "callsign": "1234",
  "entity": "bcso",
  "entity_name": "Blaine County Sheriff's Office",
  "rank": "command_staff",
  "rank_name": "Command Staff",
  "equips_loadout": 0,
  "bodycam_status": null,
  "is_on_duty": 1,
  "last_on_duty": "2026-04-23T06:48:23.038Z",
  "last_on_duty_relative": "2 hours ago",
  "first_joined": "2025-11-14T03:34:56.204Z",
  "recent_actions": [],
  "is_suspended": false
}
rectangle-api

Rate Limit: 5/minute

Fetch Unit Analytics

GET https://api.dutylogs.com/v1/public/units/analytics

An endpoint to gather the details of a unit, with the option to include some metric data.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <public_api_key>

Query Parameters

Name
Type
Description
Example

unit_id

integer

Unique Identifier for the Unit

1234

discord_id

string

If you provide discord_ids, you must provide an entity_id

"123456789123456789

entity_id

string

An entity (department) identifier, required if you provide a discord_id

"lspd"

range

string

The range: days, weeks

"weeks"

period

integer

The period of days or weeks

4

Response

rectangle-api

Rate Limit: 10/minute

Fetch Unit Actions History

GET https://api.dutylogs.com/v1/public/units/actions

An endpoint to gather the actions history of a unit for the past 28 days, with the option for all time.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <public_api_key>

Query Parameters

Name
Type
Description
Example

unit_id

integer

Unique Identifier for the Unit

1234

discord_id

string

If you provide discord_ids, you must provide an entity_id

"123456789123456789

entity_id

string

An entity (department) identifier, required if you provide a discord_id

"lspd"

all_time

boolean

Optionally extends the search to all time

true/false

Response

rectangle-api

Rate Limit: 5/minute

Bulk Fetch Unit Analytics

POST https://api.dutylogs.com/v1/public/units/analytics

An endpoint to bulk gather the analytics of a collection of units.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <public_api_key>

Query Parameters

Name
Type
Description
Example

entity_id

string

Entity Identifier, required if you're using discord_ids

"lspd"

range

string

The range: days, weeks

"weeks"

period

integer

The period of days or weeks

4

Body

Name
Type
Description
Example

unit_ids

array

An array of unit identifiers

["1234", "1235", "1236", "1237"]

discord_ids

array

If you provide discord_ids, you must provide an entity_id

["123456789123456789", "123456789123456781", "123456789123456782"]

Response

rectangle-api

Rate Limit: 30/hour

Fetch Player

GET https://api.dutylogs.com/v1/public/players

An endpoint to gather the details of a player, with the option to include some metric data.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <public_api_key>

Query Parameters

Name
Type
Description
Example

discord_id

string

If you use discord_id instead of unit_id, you must specify the entity_id

"123456789123456789

metrics [optional]

boolean

Optionally include total active and afk time from past 14 days

true/false

Response

rectangle-api

Rate Limit: 5/minute

Last updated