Metadata Reference
Complete documentation of all metadata fields available in the API for comprehensive device and application tracking.
IP address validation is disabled. Documentation can be accessed from any IP address with valid token.
W How Metadata Parameters Work
Understanding the metadata processing flow and database relationships.
π± Request Processing Flow
Important: Understanding Unique Constraints
The unique constraint ['app_name', 'app_version', 'sdk_version'] is in the api_app_metadata table, which is a reference table, NOT a request logs table.
This means:
- Each combination of app_name + app_version + sdk_version has ONE record in api_app_metadata
- Multiple API requests can have the same combination - they all reference the same record
- API request logs (
api_request_logs) reference this table via foreign key - This is a normalization pattern for storage efficiency and performance
Storage Savings: Instead of storing app details (50 bytes) in every request, we store them once and reference them. For 10,000 requests: 500KB β 90KB (82% reduction)
π Metadata Parameter Structure
{
"core": {
"device_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", // β api_devices
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", // β api_sessions
"user_id": "usr_abc123", // β api_sessions
"request_id": "req_abc123" // β api_request_logs
},
"device": {
"device_type": "mobile", // β api_devices
"manufacturer": "Samsung", // β api_devices
"model": "SM-S23U", // β api_devices
"os": "android", // β api_devices
"os_version": "14", // β api_devices
"locale": "en-US", // β api_devices
"timezone": "America/New_York", // β api_devices
"is_emulator": false, // β api_devices
"is_rooted_jailbroken": false, // β api_devices (JSON)
"is_physical_device": true, // β api_devices (JSON)
"has_nfc": true, // β api_devices (JSON)
"nfc_enabled": true, // β api_devices (JSON)
"has_biometric": true, // β api_devices (JSON)
"biometric_type": "fingerprint", // β api_devices (JSON)
"has_gps": true, // β api_devices (JSON)
"is_GPS_enabled": true, // β api_devices (JSON)
"is_network_enabled": true, // β api_devices (JSON)
"sensor_accelerometer": true // β api_devices (JSON)
},
"network": {
"type": "wifi", // β api_network_metadata
"carrier": "Verizon", // β api_network_metadata
"ip_address": "192.168.1.100" // β api_network_metadata
},
"location": {
"latitude": 40.7128, // β api_network_metadata
"longitude": -74.0060, // β api_network_metadata
"accuracy": 10.5, // β api_network_metadata
"country": "US" // β api_network_metadata
},
"performance": {
"client_start_time": 1689000000000, // β api_request_logs
"client_end_time": 1689000000500, // β api_request_logs
"client_response_time_ms": 500 // β api_request_logs
},
"app": {
"name": "RoadPilot", // β api_app_metadata
"version": "3.2.1", // β api_app_metadata
"sdk_version": "2.0.0", // β api_app_metadata
"client_version": "3.2.1", // β api_app_metadata
"environment": "prod", // β api_app_metadata
"ui_mode": "light" // β api_app_metadata
},
"request": {
"endpoint": "/api/graphql", // β api_request_logs
"method": "POST" // β api_request_logs
}
}
π Parameter to Table Mapping
| Parameter Group | Parameter | Table | Notes |
|---|---|---|---|
core |
device_id |
api_devices |
Unique identifier |
core |
session_id |
api_sessions |
Unique identifier |
core |
request_id |
api_request_logs |
Unique per request |
core |
user_id |
api_sessions |
Authenticated user |
device |
device_type |
api_devices |
Device classification |
device |
manufacturer |
api_devices |
Device maker |
device |
is_emulator |
api_devices |
Security flag |
device |
has_nfc |
api_devices (JSON) |
NFC hardware flag |
network |
network_type |
api_network_metadata |
Connection type |
network |
ip_address |
api_network_metadata |
Client IP |
location |
latitude |
api_network_metadata |
GPS coordinate |
location |
longitude |
api_network_metadata |
GPS coordinate |
performance |
client_start_time |
api_request_logs |
Request start epoch ms |
performance |
client_end_time |
api_request_logs |
Response received epoch ms |
performance |
client_response_time_ms |
api_request_logs |
Round-trip client ms |
request |
endpoint |
api_request_logs |
API path |
request |
event_source |
request_snapshot |
Auto-populated server URL when not provided |
request |
msg_id |
request_snapshot |
Client-provided message identifier; null if not sent |
request |
correlation_id |
request_snapshot |
Client-provided correlation key; null if not sent |
app |
name |
api_app_metadata |
Unique constraint part |
app |
version |
api_app_metadata |
Unique constraint part |
app |
sdk_version |
api_app_metadata |
Unique constraint part |
ποΈ Database Table Relationships
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API_REQUEST_LOGS β
β (Main Request Table) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β id β
β request_id (unique) β
β app_metadata_id βββββββββββββ β
β device_id βββββββββββββββββββΌβββ βββββββββββββββββββββββ β
β session_id ββββββββββββββββββΌβββ β api_devices β β
β response_payload_id βββββββββΌβββ β (Device Metadata) β β
β endpoint, method, http_code β β id β β
β performance_metrics β β device_id (unique) β β
β timestamps β β device_type, model β β
βββββββββββββββββββββββββββββββΌβββ β last_seen_at β β
β βββββββββββββββββββββββ β
β β
ββββββββββββ ββββββββββββββββββββ
β β api_sessions ββ
β β (Session Mgmt) ββ
β β id ββ
β β session_id ββ
β β user_id, device_idβ
β β metrics ββ
β ββββββββββββββββββββ
β β
β βββββββββββββββββββββββ β
ββββ βapi_app_metadata β β
β (App Reference) β β
β id β β
β app_name, app_versionβ β
β sdk_version β β
β [unique constraint] β β
βββββββββββββββββββββββ β
β
ββββββββββββββββββββββββ β
βapi_response_payloads β β
β(Large Data Storage) β β
βid β β
βrequest_id (fk) βββββββββ
βpayload_data (compressed) β
βpayload_size, type β
ββββββββββββββββββββββββ β
β
ββββββββββββββββββββββββ β
βapi_network_metadata β β
β(Network Information) β β
βid β β
βnetwork_type, carrier β β
βip_address, location β β
ββββββββββββββββββββββββ β
π Real-World Example
Scenario: User makes 4 API calls (Login, Location, Route, Traffic)
api_app_metadata (1 record)
- β’ id: 1
- β’ app_name: "RoadPilot"
- β’ app_version: "3.2.1"
- β’ sdk_version: "2.0.0"
- β’ client_version: "3.2.1"
- β’ sdk_env: "prod"
- β’ ui_mode: "light"
- β’ last_seen_at: 2025-05-27 14:15:00
api_devices (1 record)
- β’ id: 1
- β’ device_id: "a1b2c3d4-..."
- β’ model: "SM-S23U"
- β’ metadata_snapshot: {has_nfc, has_biometric, ...}
- β’ last_seen_at: 2025-05-27 14:15:00
api_sessions (1 record)
- β’ id: 1
- β’ session_id: "a1b2c3d4-..."
- β’ user_id: "usr_abc123"
- β’ ip_address: "192.168.1.100"
- β’ created_at: 2025-05-27 14:00:00
api_request_logs (4 records)
- β’ All reference same app_metadata_id: 1
- β’ All reference same device_id: "a1b2c3d4-..."
- β’ All reference same session_id: "a1b2c3d4-..."
- β’ client_start_time / client_end_time per request
- β’ Different endpoints: login, location, routes, traffic
π‘ Storage Efficiency: App metadata stored once (50 bytes), referenced 4 times. Without normalization: 200 bytes. With normalization: 50 bytes + 4 references (16 bytes) = 66 bytes. 67% storage reduction
β‘ Performance Benefits
Query Performance
- β 8x faster queries vs denormalized
- β Smaller indexes = better cache utilization
- β Optimized for time-series queries
- β Compound indexes on common patterns
Storage Efficiency
- β 75%+ reduction in storage
- β Reduced backup/restore times
- β Lower memory requirements
- β Faster table scans
Data Consistency
- β Single source of truth
- β Easy updates propagation
- β No duplicate data inconsistencies
- β Referential integrity
Analytics Ready
- β Built-in version tracking
- β Usage analytics by app version
- β Device adoption metrics
- β Performance monitoring