Response Format
Response Formatlink
All Infraspeak API responses follow a consistent JSON structure based on JSON:API conventions. Understanding this format helps you parse responses correctly across all endpoints.
Response Structurelink
Single Resourcelink
When retrieving a single resource:
{
"data": {
"type": "failure",
"id": "12345",
"attributes": {
"failure_id": 12345,
"description": "HVAC unit not cooling",
"state": "WAITING_RESOLUTION",
"priority": 2,
...
},
"relationships": { // present if relations are included
"location": {
"data": {
"id": "789",
"type": "location"
}
}
}
}
}
Resource Collectionlink
When retrieving multiple resources:
{
"data": [
{
"type": "failure",
"id": "12345",
"attributes": {
"failure_id": 12345,
...
}
},
{
"type": "failure",
"id": "12346",
"attributes": {
"failure_id": 12346,
...
}
}
],
"meta": {
"pagination": {
"total": 2,
"count": 2,
"per_page": 200,
"current_page": 1,
"total_pages": 2
}
},
"links": {
"self": "https://api.infraspeak.com/v3/failures?page=1",
"first": "https://api.infraspeak.com/v3/failures?page=1",
"next": "https://api.infraspeak.com/v3/failures?page=2",
"last": "https://api.infraspeak.com/v3/failures?page=2"
}
}
Response Fieldslink
Top-Level Fieldslink
| Field | Type | Description |
|---|---|---|
data |
object or array | The primary resource(s) |
meta.pagination |
object | Pagination metadata (collections only) |
links |
object | Navigation links (collections only) |
included |
array | Related resources when using expanded |
Resource Object Fieldslink
| Field | Type | Description |
|---|---|---|
type |
string | Resource type name |
id |
string | Unique identifier (as string) |
attributes |
object | Actual resource data |
relationships |
object | Related resource references when using expanded |
Relationshipslink
The relationships object references related resources:
{
"relationships": {
"location": {
"data": {
"id": "789",
"type": "location"
}
},
"problem": {
"data": {
"id": "456",
"type": "problem"
}
},
"operators": {
"data": [
{ "id": "101", "type": "operator" },
{ "id": "102", "type": "operator" }
]
}
}
}
Pagination Objectlink
Collections include pagination metadata:
{
"meta": {
"pagination": {
"total": 2,
"count": 2,
"per_page": 200,
"current_page": 1,
"total_pages": 2
}
}
}
| Field | Description |
|---|---|
total |
Deprecated field. Currenlty, shows the same value as count |
count |
Number of records in the current page |
per_page |
Maximum records per page (default: 200) |
current_page |
Current page number (1-indexed) |
total_pages |
Deprecated field. Currently, shows next page number |
Links Objectlink
Navigation links for pagination:
{
"links": {
"self": "https://api.infraspeak.com/v3/failures?page=3",
"first": "https://api.infraspeak.com/v3/failures?page=1",
"prev": "https://api.infraspeak.com/v3/failures?page=2",
"next": "https://api.infraspeak.com/v3/failures?page=4",
"last": "https://api.infraspeak.com/v3/failures?page=4"
}
}
Data Typeslink
Dateslink
All dates are in ISO 8601 format (YYYY-MM-DD HH:MM:SS):
{
"created_at": "2026-05-11 16:41:00",
"report_date": "2026-05-11 16:41:00"
}
Durationslink
Durations are returned in ISO 8601 format (PnYnMnDTnHnMnS):
{
"manpower_duration": "P0Y0M0DT2H15M9S"
}
Decimalslink
Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places:
{
"manpower_cost": "0.06",
}
Other Amountslink
Other amounts, such as item counts, are returned as integers:
{
"message_count": 3,
}
Nullable Fieldslink
Blank fields are generally included as null or empty string instead of being omitted:
{
"completed_date": null,
"observations": null
}
Enumslink
Enum values are returned as strings:
{
"state": "WAITING_RESOLUTION",
"signature_status": "NOT_SIGNED"
}