Critical Quality Points (CQP)
A critical quality point (CQP) captures a quality risk for a product, item, or material, together with how the risk is mitigated during production and how it is verified, for example by a lab test or an inspection. With the CQP API, you can create, read, replace, and delete CQPs directly from your own systems, instead of entering or uploading them through the UI.
Before you start​
- Generate an API key for your organization and use it to authenticate your API requests.
- The product, item, or material must already exist in Inspectorio. See Products, Styles, Items, and Materials.
- You need the business form ID of an active CQP form in your organization. The CQP uses this form's latest template version.
Endpoints​
All CQP endpoints use the same base path, where entity_type is product, item, or material, and custom_id is the identifier of the record in your system:
/api/v1/customer-data/{entity_type}/{custom_id}/cqps
| Action | Endpoint |
|---|---|
| Create a CQP | POST .../cqps |
| List CQPs | GET .../cqps |
| Get a CQP | GET .../cqps/{cqp_id} |
| Replace a CQP | PUT .../cqps/{cqp_id} |
| Delete a CQP | DELETE .../cqps/{cqp_id} |
Create a CQP​
Use the Create a CQP endpoint. The required fields are:
name: the name of the CQPcqpType:safety,functional, orregulationcqpForm: the business form ID of an active CQP form in your organization
The combination of name and cqpType must be unique. Optionally, add mitigations (how the risk is controlled during production), verifications (how and when it is checked, and by whom), and attachments.
curl --request POST \
--url "https://sight.inspectorio.com/api/v1/customer-data/item/ITEM-001/cqps" \
--header "apiKey: <YOUR_API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"name": "Small parts choking hazard",
"cqpType": "safety",
"cqpForm": "cqpform-2024-001",
"verifications": [
{
"stageType": "pre_production",
"methodType": "certified_lab_test",
"assignedTo": "third_party"
}
]
}'
A successful request returns 201 with the created CQP, including its id. CQPs created through the API have source set to api.
List and get CQPs​
Use List CQPs to retrieve the CQPs of a record, with limit (up to 50) and offset for pagination and createdFrom/createdTo or updatedFrom/updatedTo to filter by date. Use Get a CQP to retrieve a single CQP by its id.
To read CQPs shared by another organization, add the dataProviderCustomId parameter. It is supported by list and get only.
Replace a CQP​
Replace a CQP replaces the CQP in full:
- Optional fields you leave out are reset to their defaults.
- The
mitigations,verifications, andattachmentslists are replaced in full. - The
cqpFormfield is ignored. A CQP keeps the form version assigned when it was created.
To change one field, first get the CQP, change the field, and send the full CQP back.
Delete a CQP​
Delete a CQP returns 204 when successful. You cannot delete a CQP that is used by inspections: the request returns 409 with the code CQP_IN_USE. After a CQP is deleted, its name and cqpType combination can be reused.