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

# Machines

## Get Machines

> Returns a list of machines in your organization.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"PaginatedMachines":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Machine"},"type":"array","title":"Data"},"metadata":{"$ref":"#/components/schemas/Metadata","description":"This field contains pagination metadata."}},"additionalProperties":false,"type":"object","required":["data","metadata"],"title":"PaginatedMachines"},"Machine":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid"},"name":{"type":"string","title":"Name"},"site":{"type":"string","format":"uuid","title":"Site"},"genesis_date":{"type":"string","format":"date","title":"Genesis Date"}},"type":"object","required":["uuid","name","site","genesis_date"],"title":"Machine"},"Metadata":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pagination continuation point. Specify its value as the `cursor` parameter in a request with otherwise the same parameters to fetch the next page. `None`, if there is no more data to be fetched from the server."}},"additionalProperties":false,"type":"object","required":["next_cursor"],"title":"Metadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines":{"get":{"tags":["Machines"],"summary":"Get Machines","description":"Returns a list of machines in your organization.","operationId":"get_machines_v2_machines_get","parameters":[{"name":"site","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"type":"string","format":"uuid"},"maxItems":50},{"type":"null"}],"title":"Filter by one or more site UUIDs."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","title":"Get page starting at cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMachines"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Create Machine

> Create a new machine.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"MachineCreateRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Name of your Machine. Can be changed later"},"site":{"type":"string","format":"uuid","title":"Site","description":"UUID of the site this machine belongs to"}},"type":"object","required":["name","site"],"title":"MachineCreateRequest"},"Machine":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid"},"name":{"type":"string","title":"Name"},"site":{"type":"string","format":"uuid","title":"Site"},"genesis_date":{"type":"string","format":"date","title":"Genesis Date"}},"type":"object","required":["uuid","name","site","genesis_date"],"title":"Machine"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines":{"post":{"tags":["Machines"],"summary":"Create Machine","description":"Create a new machine.","operationId":"create_machine_v2_machines_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Machine"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Machine

> Returns details for a specific machine.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Machine":{"properties":{"uuid":{"type":"string","format":"uuid","title":"Uuid"},"name":{"type":"string","title":"Name"},"site":{"type":"string","format":"uuid","title":"Site"},"genesis_date":{"type":"string","format":"date","title":"Genesis Date"}},"type":"object","required":["uuid","name","site","genesis_date"],"title":"Machine"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines/{uuid}":{"get":{"tags":["Machines"],"summary":"Get Machine","description":"Returns details for a specific machine.","operationId":"get_machine_v2_machines__uuid__get","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The UUID of the machine to retrieve."}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Machine"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Update Machine

> Update a machine.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"MachineUpdateRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Name of your Machine. Can be changed later"}},"type":"object","title":"MachineUpdateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines/{uuid}":{"patch":{"tags":["Machines"],"summary":"Update Machine","description":"Update a machine.","operationId":"update_machine_v2_machines__uuid__patch","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The UUID of the machine to update."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete Machine

> Delete a machine

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines/{machine_uuid}":{"delete":{"tags":["Machines"],"summary":"Delete Machine","description":"Delete a machine","operationId":"delete_machine_v2_machines__machine_uuid__delete","parameters":[{"name":"machine_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The UUID of the machine."}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Productivity Metrics

> Get productivity metrics for a specific machine over a set of datetime ranges.

```json
{"openapi":"3.1.0","info":{"title":"ENLYZE API","version":"v2"},"tags":[{"name":"Machines"}],"servers":[{"url":"/api"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Body_productivity_metrics_v2_machines__uuid__productivity_metrics_post":{"properties":{"datetime_ranges":{"items":{"$ref":"#/components/schemas/DatetimeRange"},"type":"array","maxItems":31,"minItems":1,"title":"Datetime Ranges"},"cursor":{"type":"string","title":"Get page starting at cursor"}},"type":"object","required":["datetime_ranges"],"title":"Body_productivity_metrics_v2_machines__uuid__productivity_metrics_post"},"DatetimeRange":{"properties":{"start":{"type":"string","format":"date-time","title":"Start","description":"Datetime with timezone in ISO Format e.g. '2000-01-02T09:10:0.0+00:00'. Must be 10-minute aligned starting at 0, i.e. the valid values for the minute portion are [0, 10, 20, 30, 40, 50]. The second and microsecond portions must be 0."},"end":{"type":"string","format":"date-time","title":"End","description":"Datetime with timezone in ISO Format e.g. '2000-01-02T09:10:0.0+00:00'. Must be 10-minute aligned starting at 0, i.e. the valid values for the minute portion are [0, 10, 20, 30, 40, 50]. The second and microsecond portions must be 0."}},"type":"object","required":["start","end"],"title":"DatetimeRange"},"PaginatedProductivityMetrics":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ProductivityMetrics"},"type":"array","title":"Data"},"metadata":{"$ref":"#/components/schemas/Metadata","description":"This field contains pagination metadata."}},"additionalProperties":false,"type":"object","required":["data","metadata"],"title":"PaginatedProductivityMetrics"},"ProductivityMetrics":{"properties":{"start":{"type":"string","format":"date-time","title":"Start","description":"The start of the range in ISO8601 format with timezone info."},"end":{"type":"string","format":"date-time","title":"End","description":"The end of the range in ISO8601 format with timezone info."},"availability":{"anyOf":[{"$ref":"#/components/schemas/OEEComponent"},{"type":"null"}],"title":"OEE Availability","description":"OEE component that reflects when the machine did not produce."},"performance":{"anyOf":[{"$ref":"#/components/schemas/OEEComponent"},{"type":"null"}],"title":"OEE Performance","description":"OEE component that reflects how fast the machine has run."},"quality":{"anyOf":[{"$ref":"#/components/schemas/OEEComponent"},{"type":"null"}],"title":"OEE Quality","description":"OEE component that reflects how many defects have been produced."},"productivity":{"anyOf":[{"$ref":"#/components/schemas/OEEComponent"},{"type":"null"}],"title":"OEE Productivity","description":"Aggregate OEE score that comprises availability, performance and quality."},"quantity_scrap":{"anyOf":[{"$ref":"#/components/schemas/Quantity"},{"type":"null"}],"title":"Scrap Quantity","description":"The amount of product produced that doesn't meet quality criteria."},"quantity_yield":{"anyOf":[{"$ref":"#/components/schemas/Quantity"},{"type":"null"}],"title":"Yield Quantity","description":"The amount of product produced that can be sold."}},"type":"object","required":["start","end","availability","performance","quality","productivity","quantity_scrap","quantity_yield"],"title":"ProductivityMetrics"},"OEEComponent":{"properties":{"score":{"type":"number","title":"Score","description":"The score is expressed as a ratio between 0 and 1.0, with 1.0 meaning 100 %."},"time_loss":{"type":"integer","title":"Time Loss","description":"Time lost (in seconds) due to non-ideal production."}},"type":"object","required":["score","time_loss"],"title":"OEEComponent"},"Quantity":{"properties":{"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Physical unit of quantity"},"value":{"type":"number","title":"The quantity expressed in `unit`"}},"type":"object","required":["unit","value"],"title":"Quantity"},"Metadata":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pagination continuation point. Specify its value as the `cursor` parameter in a request with otherwise the same parameters to fetch the next page. `None`, if there is no more data to be fetched from the server."}},"additionalProperties":false,"type":"object","required":["next_cursor"],"title":"Metadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v2/machines/{uuid}/productivity-metrics":{"post":{"tags":["Machines"],"summary":"Productivity Metrics","description":"Get productivity metrics for a specific machine over a set of datetime ranges.","operationId":"productivity_metrics_v2_machines__uuid__productivity_metrics_post","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The UUID of the machine to retrieve productivity metrics for."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_productivity_metrics_v2_machines__uuid__productivity_metrics_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedProductivityMetrics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
