> For the complete documentation index, see [llms.txt](https://ynteq.gitbook.io/ynteq-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ynteq.gitbook.io/ynteq-docs/api-docs/parts-inventory.md).

# Parts Inventory

Collect the current spare part inventory

## List Parts

> Retrieve a list of parts with pagination support.

```json
{"openapi":"3.0.0","info":{"title":"Ynteq API","version":"0.22.2"},"tags":[{"name":"Parts inventory","description":"Collect the current spare part inventory"}],"paths":{"/api/rest/parts":{"get":{"tags":["Parts inventory"],"summary":"List Parts","description":"Retrieve a list of parts with pagination support.","parameters":[{"description":"Bearer your-access-token","in":"header","name":"Authorization","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"offset","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"limit":{"nullable":true,"title":"Int","type":"integer"},"offset":{"nullable":true,"title":"Int","type":"integer"}},"type":"object"}}},"description":"Query parameters can also be provided in the request body as a JSON object","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"parts_inventory":{"items":{"description":"columns and relationships of \"parts_inventory\"","nullable":false,"properties":{"condition":{"nullable":true,"title":"String","type":"string"},"created_at":{"$ref":"#/components/schemas/timestamp"},"created_by_user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"},"criticality":{"nullable":true,"title":"Int","type":"integer"},"custom_field_values":{"items":{"description":"columns and relationships of \"parts_custom_field_values\"","nullable":false,"properties":{"custom_field":{"description":"columns and relationships of \"parts_custom_fields\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"parts_custom_fields","type":"object"},"value":{"nullable":false,"title":"String","type":"string"}},"title":"parts_custom_field_values","type":"object"},"nullable":false,"type":"array"},"custom_id":{"nullable":true,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"locations":{"items":{"description":"columns and relationships of \"parts_locations\"","nullable":false,"properties":{"location":{"description":"columns and relationships of \"locations\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"locations","type":"object"}},"title":"parts_locations","type":"object"},"nullable":false,"type":"array"},"manufacturer":{"nullable":true,"title":"String","type":"string"},"min_stock":{"nullable":true,"title":"Int","type":"integer"},"name":{"nullable":false,"title":"String","type":"string"},"on_stock":{"nullable":false,"title":"Int","type":"integer"},"parts_categories_assignments":{"items":{"description":"columns and relationships of \"parts_categories_assignments\"","nullable":false,"properties":{"parts_category":{"description":"columns and relationships of \"parts_categories\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"parts_categories","type":"object"}},"title":"parts_categories_assignments","type":"object"},"nullable":false,"type":"array"},"parts_comments":{"items":{"description":"columns and relationships of \"parts_comments\"","nullable":false,"properties":{"content":{"nullable":false,"title":"String","type":"string"},"created_at":{"$ref":"#/components/schemas/timestamp!"},"user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"}},"title":"parts_comments","type":"object"},"nullable":false,"type":"array"},"parts_substitutes":{"items":{"description":"columns and relationships of \"parts_substitutes\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"}},"title":"parts_substitutes","type":"object"},"nullable":false,"type":"array"},"parts_vendors":{"items":{"description":"columns and relationships of \"parts_vendors\"","nullable":false,"properties":{"currency":{"nullable":true,"title":"String","type":"string"},"price":{"$ref":"#/components/schemas/float8"},"vendor":{"description":"columns and relationships of \"vendors\"","nullable":true,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"vendors","type":"object"}},"title":"parts_vendors","type":"object"},"nullable":false,"type":"array"},"qr_code_content":{"nullable":true,"title":"String","type":"string"},"serial_number":{"nullable":true,"title":"String","type":"string"},"updated_at":{"$ref":"#/components/schemas/timestamp"},"updated_by_user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"}},"title":"parts_inventory","type":"object"},"nullable":false,"type":"array"}}}}},"description":"Responses for GET /api/rest/parts"}}}}},"components":{"schemas":{"timestamp":{"nullable":true,"title":"timestamp"},"uuid!":{"nullable":false,"pattern":"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}","title":"uuid","type":"string"},"timestamp!":{"nullable":false,"title":"timestamp"},"float8":{"nullable":true,"title":"float8"}}}}
```

## Get Part

> Retrieve detailed information about a specific part by its ID.

```json
{"openapi":"3.0.0","info":{"title":"Ynteq API","version":"0.22.2"},"tags":[{"name":"Parts inventory","description":"Collect the current spare part inventory"}],"paths":{"/api/rest/parts/{id}":{"get":{"tags":["Parts inventory"],"summary":"Get Part","description":"Retrieve detailed information about a specific part by its ID.","parameters":[{"description":"Bearer your-access-token","in":"header","name":"Authorization","schema":{"type":"string"}},{"description":"_\"id\" is required (enter it either in parameters or request body)_","in":"path","name":"id","schema":{"pattern":"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"$ref":"#/components/schemas/uuid!"}},"type":"object"}}},"description":"Query parameters can also be provided in the request body as a JSON object","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"parts_inventory_by_pk":{"description":"columns and relationships of \"parts_inventory\"","nullable":true,"properties":{"condition":{"nullable":true,"title":"String","type":"string"},"created_at":{"$ref":"#/components/schemas/timestamp"},"created_by_user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"},"criticality":{"nullable":true,"title":"Int","type":"integer"},"custom_field_values":{"items":{"description":"columns and relationships of \"parts_custom_field_values\"","nullable":false,"properties":{"custom_field":{"description":"columns and relationships of \"parts_custom_fields\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"parts_custom_fields","type":"object"},"value":{"nullable":false,"title":"String","type":"string"}},"title":"parts_custom_field_values","type":"object"},"nullable":false,"type":"array"},"custom_id":{"nullable":true,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"locations":{"items":{"description":"columns and relationships of \"parts_locations\"","nullable":false,"properties":{"location":{"description":"columns and relationships of \"locations\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"locations","type":"object"}},"title":"parts_locations","type":"object"},"nullable":false,"type":"array"},"manufacturer":{"nullable":true,"title":"String","type":"string"},"min_stock":{"nullable":true,"title":"Int","type":"integer"},"name":{"nullable":false,"title":"String","type":"string"},"on_stock":{"nullable":false,"title":"Int","type":"integer"},"parts_categories_assignments":{"items":{"description":"columns and relationships of \"parts_categories_assignments\"","nullable":false,"properties":{"parts_category":{"description":"columns and relationships of \"parts_categories\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"parts_categories","type":"object"}},"title":"parts_categories_assignments","type":"object"},"nullable":false,"type":"array"},"parts_comments":{"items":{"description":"columns and relationships of \"parts_comments\"","nullable":false,"properties":{"content":{"nullable":false,"title":"String","type":"string"},"created_at":{"$ref":"#/components/schemas/timestamp!"},"user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"}},"title":"parts_comments","type":"object"},"nullable":false,"type":"array"},"parts_substitutes":{"items":{"description":"columns and relationships of \"parts_substitutes\"","nullable":false,"properties":{"id":{"$ref":"#/components/schemas/uuid!"}},"title":"parts_substitutes","type":"object"},"nullable":false,"type":"array"},"parts_vendors":{"items":{"description":"columns and relationships of \"parts_vendors\"","nullable":false,"properties":{"currency":{"nullable":true,"title":"String","type":"string"},"price":{"$ref":"#/components/schemas/float8"},"vendor":{"description":"columns and relationships of \"vendors\"","nullable":true,"properties":{"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"vendors","type":"object"}},"title":"parts_vendors","type":"object"},"nullable":false,"type":"array"},"qr_code_content":{"nullable":true,"title":"String","type":"string"},"serial_number":{"nullable":true,"title":"String","type":"string"},"updated_at":{"$ref":"#/components/schemas/timestamp"},"updated_by_user":{"description":"columns and relationships of \"users\"","nullable":true,"properties":{"email":{"nullable":false,"title":"String","type":"string"},"id":{"$ref":"#/components/schemas/uuid!"},"name":{"nullable":false,"title":"String","type":"string"}},"title":"users","type":"object"}},"title":"parts_inventory","type":"object"}}}}},"description":"Responses for GET /api/rest/parts/{id}"}}}}},"components":{"schemas":{"uuid!":{"nullable":false,"pattern":"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}","title":"uuid","type":"string"},"timestamp":{"nullable":true,"title":"timestamp"},"timestamp!":{"nullable":false,"title":"timestamp"},"float8":{"nullable":true,"title":"float8"}}}}
```
