Get all users from a roster page in a flat format.
This endpoint returns all users from a roster page in a flat format, making it easier to work with user data without the hierarchical structure of ranks. The response includes user details such as name, Discord ID, rank, certifications, subdivisions, and patrol hours (if enabled).
Name | Type | Required | Description |
---|---|---|---|
page_id | string | Yes | The UUID of the roster page (e.g., c88006c8-b9ea-433c-8a8b-749ec1af0756) |
Name | Required | Description |
---|---|---|
X-API-Key | Yes | Your API key for authentication |
The response is an array of user objects, each containing the following fields:
Field | Type | Description |
---|---|---|
name | string | The name of the user |
discord_id | string | The Discord ID of the user |
discord_username | string | The Discord username of the user |
rank | string | The rank of the user |
is_command | boolean | Whether the user's rank is a command rank |
certifications | array | Array of certification names the user has |
subdivisions | array | Array of subdivision names the user belongs to |
promotion_date | string | The date the user was promoted to their current rank (YYYY-MM-DD) |
promotion_officer | string | The name of the officer who promoted the user |
patrol_hours | number | The number of patrol hours the user has (if patrol logs are enabled) |
[ { "name": "John Doe", "discord_id": "123456789012345678", "discord_username": "johndoe", "rank": "Commander", "is_command": true, "certifications": ["Firearms", "Driving"], "subdivisions": ["SWAT", "K9"], "promotion_date": "2025-01-15", "promotion_officer": "Jane Smith", "patrol_hours": 42.5 }, { "name": "Jane Smith", "discord_id": "987654321098765432", "discord_username": "janesmith", "rank": "Lieutenant", "is_command": true, "certifications": ["Leadership", "Tactics"], "subdivisions": ["Training"], "promotion_date": "2025-02-05", "promotion_officer": "Michael Johnson", "patrol_hours": 68.2 } ]
{ "error": "Roster page not found" }
{ "error": "Invalid or missing API key" }
{ "error": "API access requires premium subscription" }
{ "error": "You do not have permission to access this roster" }
This error occurs when you try to access a roster that you don't own. For security reasons, API keys can only access rosters owned by the user who created the API key.
curl -X GET "https://autorosters.com/api/roster/c88006c8-b9ea-433c-8a8b-749ec1af0756/users" \ -H "X-API-Key: your-api-key-here"
import requests api_key = "your-api-key-here" page_id = "c88006c8-b9ea-433c-8a8b-749ec1af0756" url = f"https://autorosters.com/api/roster/${page_id}/users" headers = { "X-API-Key": api_key } response = requests.get(url, headers=headers) data = response.json() print(data)
const apiKey = "your-api-key-here"; const pageId = "c88006c8-b9ea-433c-8a8b-749ec1af0756"; const url = `https://autorosters.com/api/roster/${pageId}/users`; fetch(url, { method: "GET", headers: { "X-API-Key": apiKey } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error("Error:", error));