Skip to main content

Get Plant Compliance Report

Written by Support

GET [ plant-compliance-report ]

Production Endpoint: https://app.complyflow.com.au/app/public/index.php/api/acu/plant-compliance-report?category_id={id}
Test Endpoint: https://test.complyflow.com.au/app/public/index.php/api/acu/plant-compliance-report?category_id={id}

Overview

This endpoint returns the compliance status of each Plant item in a Plant Category against that Plant Category's Required Document Categories. Every Required Document Category is returned for every Plant item, including those with no document uploaded, so you can report on both satisfied and outstanding requirements in Power BI or another reporting tool.

The response also includes the Plant Category's full list of Required Document Categories, even when no Plant items are assigned to it yet.

If you can't find what you are looking for or need further assistance, please contact support@complyflow.com.au

Authentication instructions

Refer to the Authentication method for Authentication Methods (for Login and Logout).

Permissions Required

  • API User

  • User is Staff

  • Plant & Vehicles > View Plant & Vehicles (or Manage Plant & Vehicles), or Super User

Please also review the Permissions Overview guide.

Query parameters

FIELD

TYPE

DESCRIPTION

Example

REQUIRED

DEFAULT

PATTERN

category_id

integer

Plant Category ID (must belong to your organisation). Refer to Get Plant Category List

8

Yes

null

\d+

page

integer

Page number (minimum 1)

2

No

1

\d+

per_page

integer

Number of Plant items per page (1 to 100)

100

No

50

\d+

Request Example

curl --location 'https://test.complyflow.com.au/app/public/index.php/api/acu/plant-compliance-report?category_id=8&page=1&per_page=50' \
--header 'Authorization: Bearer {token}'

Response Example

The API request returns the Plant Category, its Required Document Categories, and the document status of each Plant item in the category:

{
"token": "refreshed_jwt_token",
"data": {
"category": { "id": 8, "name": "Earthmoving Equipment" },
"required_documents": [
{ "id": 301, "name": "Plant Risk Assessment" },
{ "id": 305, "name": "Service Record" },
{ "id": 310, "name": "Registration Certificate" }
],
"pagination": {
"current_page": 1,
"per_page": 50,
"total": 2,
"total_pages": 1
},
"plants": [
{
"id": 28017,
"plant_record_id": "P28017",
"item_name": "Excavator CAT 320",
"contractor_id": 100,
"company_name": "Smith Excavations Pty Ltd",
"sites": ["Northern Depot", "Western Depot"],
"overall_status": "non_compliant",
"documents": [
{
"document_category_id": 301,
"document_category_name": "Plant Risk Assessment",
"status": "compliant",
"upload_date": "2026-03-14",
"approval_date": "2026-03-18",
"expiry_date": "2027-03-14",
"uploaded_by": "Jane Smith"
},
{
"document_category_id": 305,
"document_category_name": "Service Record",
"status": "missing",
"upload_date": null,
"approval_date": null,
"expiry_date": null,
"uploaded_by": null
},
{
"document_category_id": 310,
"document_category_name": "Registration Certificate",
"status": "expired",
"upload_date": "2025-06-02",
"approval_date": "2025-06-05",
"expiry_date": "2026-06-02",
"uploaded_by": "Mark Taylor"
},
{
"document_category_id": 318,
"document_category_name": "Lifting Equipment Inspection Certificate",
"status": "pending_approval",
"upload_date": "2026-09-10",
"approval_date": null,
"expiry_date": null,
"uploaded_by": "Mark Taylor"
}
]
},
{
"id": 28022,
"plant_record_id": "P28022",
"item_name": "Skid Steer Loader",
"contractor_id": null,
"company_name": "",
"sites": ["Northern Depot"],
"overall_status": "compliant",
"documents": [
{
"document_category_id": 301,
"document_category_name": "Plant Risk Assessment",
"status": "compliant",
"upload_date": "2026-02-01",
"approval_date": "2026-02-03",
"expiry_date": "2027-02-01",
"uploaded_by": "Jane Smith"
},
{
"document_category_id": 305,
"document_category_name": "Service Record",
"status": "expiring_soon",
"upload_date": "2025-10-01",
"approval_date": "2025-10-02",
"expiry_date": "2026-10-01",
"uploaded_by": "Jane Smith"
},
{
"document_category_id": 310,
"document_category_name": "Registration Certificate",
"status": "compliant",
"upload_date": "2026-01-20",
"approval_date": "2026-01-21",
"expiry_date": "2027-01-20",
"uploaded_by": "Jane Smith"
}
]
}
]
}
}

In this example, "Lifting Equipment Inspection Certificate" is a Document Category assigned directly to the Excavator, so it appears in that Plant item's documents but not in required_documents.

Response Fields

Report Fields

Field Name

Type

Description

category

object

The Plant Category (id, name)

required_documents

array

The Plant Category's Required Document Categories (id, name). Returned even when no Plant items are assigned to the Plant Category

pagination

object

current_page, per_page, total (number of Plant items) and total_pages

plants

array

One entry per Plant item on this page

Plant Fields

Field Name

Type

Description

id

integer

Plant ID

plant_record_id

string

Plant record ID (the Plant ID prefixed with P)

item_name

string

Plant item name

contractor_id

integer or null

ID of the Supplier that owns the Plant item (null if your organisation owns it)

company_name

string

Name of the Supplier that owns the Plant item (empty if your organisation owns it)

sites

array of strings

Names of the Sites the Plant item is assigned to

overall_status

string

compliant or non_compliant (see Status Values)

documents

array

One entry per Required Document Category, followed by any Document Categories assigned directly to this Plant item

Document Fields

Field Name

Type

Description

document_category_id

integer

Document Category ID

document_category_name

string

Document Category name

status

string

Compliance status (see Status Values)

upload_date

string or null

Date the document was uploaded (YYYY-MM-DD)

approval_date

string or null

Date the document was approved (YYYY-MM-DD)

expiry_date

string or null

Expiry date of the approved or expired document (YYYY-MM-DD). Null if the document has no expiry date

uploaded_by

string or null

Full name of the person who uploaded the document

Status Values

Status

Meaning

compliant

An approved document is held and hasn't expired

expiring_soon

An approved document is held but expires within 30 days

expired

The most recent document has expired, and no approved or pending document is held

pending_approval

A document has been uploaded and is awaiting approval

missing

No document has been uploaded for this Document Category

rejected

The most recent document was rejected, and no approved or pending document is held

overall_status: compliant only if every entry in the Plant item's documents is compliant or expiring_soon. Otherwise non_compliant.

Error Responses

Errors are returned with HTTP status 200 in the standard response format, with the error details inside data, for example { "token": "...", "data": { "status": false, "error": "The category_id field is required.", "error_code": 1 } }. If more than one parameter is invalid, only the first error is returned. Token errors are returned before the request reaches ComplyFlow, with the HTTP status shown.

Scenario

Response

category_id not supplied

{ "status": false, "error": "The category_id field is required.", "error_code": 1 }

category_id isn't an integer

{ "status": false, "error": "The category_id must be an integer.", "error_code": 1 }

Plant Category isn't in your organisation

{ "status": false, "error": "The specified plant category does not exist in your organisation.", "error_code": 2 }

page isn't an integer, or is less than 1

{ "status": false, "error": "The page must be an integer.", "error_code": 1 } or "The page must be at least 1."

per_page isn't an integer, is less than 1, or is more than 100

{ "status": false, "error": "The per_page must be an integer.", "error_code": 1 }, "The per_page must be at least 1." or "The per_page must not exceed 100."

No API access, not a Staff User, or no Plant & Vehicles permission

{ "status": false, "error": "Access denied", "error_code": 20 }

No token supplied

HTTP 400 { "error": "token_not_provided" }

Token has expired

HTTP 401 { "error": "token_expired" }

Token is invalid, or has already been replaced by a refreshed token

HTTP 400 or 401 { "error": "token_invalid" }

Usage Pattern (Power BI)

  1. Call GET /api/acu/plant-categories to get all Plant Category IDs. Refer to Get Plant Category List

  2. For each Plant Category, call GET /api/acu/plant-compliance-report?category_id={id}

  3. Page through the results with &page=2, &page=3, etc. until current_page equals total_pages

  4. Use the token returned in each response for your next request

Notes

  • All results are scoped to your organisation via the JWT token

  • Archived Plant items and Plant items set to Not in Use are excluded

  • A Plant item assigned to more than one Plant Category appears in the report for each of them, checked against that Plant Category's requirements

  • Document Categories assigned directly to a Plant item appear in that Plant item's documents, but not in required_documents

  • A Plant item with no Required Document Categories and no directly assigned Document Categories has an empty documents array and an overall_status of compliant

  • Documents with no expiry date are never shown as expired or expiring_soon

  • Plant items are returned in Plant ID order. per_page sets the number of Plant items per page, with each Plant item's documents nested inside it

  • When no Plant items are assigned to the Plant Category, plants is empty and total_pages is 1

  • Requesting a page after the last page returns an empty plants array

  • Operator Competencies (the competencies a Plant Category requires from the Staff Users who operate its plant) are not included in this report. Refer to Get Operator Competency Compliance Report

  • Inspection Templates configured on the Plant Category are not included in this report

Did this answer your question?