{"openapi":"3.1.0","info":{"title":"Level v2 REST API","version":"v2"},"tags":[{"name":"Devices","description":"Devices with the Level agent installed."},{"name":"Groups","description":"The group hierachy that contains devices."},{"name":"Alerts","description":"Alerts generated by monitoring devices."},{"name":"Updates","description":"Update operations and status for devices."},{"name":"Automations","description":"Operations on automations."},{"name":"Tags","description":"Tags that can be applied to devices."},{"name":"Custom Fields","description":"Custom fields that can have values assigned to them."},{"name":"Custom Field Values","description":"Values assigned to custom fields for the organization, groups, and devices."},{"name":"Activities","description":"Actions and changes recorded for the organization."}],"paths":{"/v2/alerts":{"get":{"summary":"List alerts","tags":["Alerts"],"operationId":"listAlerts","security":[{"api_key":[]}],"description":"Returns a list of your alerts.","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include alerts for the specified device_id."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","resolved"]},"description":"Filter to only include alerts with the given status."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/alert"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/alerts/{id}":{"get":{"summary":"Show alert","tags":["Alerts"],"operationId":"showAlert","security":[{"api_key":[]}],"description":"Retrieves the details of an existing alert.","parameters":[{"name":"id","in":"path","description":"The ID of the alert to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/alert"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}}},"/v2/alerts/{id}/resolve":{"post":{"summary":"Resolve alert","tags":["Alerts"],"operationId":"resolveAlert","security":[{"api_key":[]}],"description":"Resolves an active alert. If the alert is already resolved, this is a no-op and returns the alert as-is.","parameters":[{"name":"id","in":"path","description":"The ID of the alert to resolve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/alert"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}}},"/v2/activities":{"get":{"summary":"List activities","tags":["Activities"],"operationId":"listActivities","security":[{"api_key":[]}],"description":"Returns a list of your organization's activities from newest to oldest.","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["automation","automation_configuration","automation_run","script","script_run","device","tag","group","monitor_policy","remote_access","team","access","permission","api_key","custom_field","organization","update_exclusion"]},"description":"Filter to only include activities in the specified category."},{"name":"source_type","in":"query","required":false,"schema":{"type":"string","enum":["user","api_key","device","automation","automation_trigger"]},"description":"Filter to only include activities performed by the specified source type."},{"name":"involving_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include activities where the specified ID is the source, context, target, or related ID."},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filter to only include activities recorded at or after this time."},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Filter to only include activities recorded at or before this time."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/activity"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/automation-runs/{id}":{"get":{"summary":"Show automation run","tags":["Automations"],"operationId":"showAutomationRun","security":[{"api_key":[]}],"description":"Retrieves the status of an existing automation run.","parameters":[{"name":"id","in":"path","description":"The ID of the automation run.","required":true,"schema":{"type":"string"}},{"name":"include_steps","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include step names, statuses, and output in the response."}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/automation_run"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}}},"/v2/automations/webhooks":{"get":{"summary":"List automation webhooks","tags":["Automations"],"operationId":"listAutomationWebhooks","security":[{"api_key":[]}],"description":"Returns webhook trigger URLs and accepted parameters for non-archived automations.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/automation_webhook"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/automations":{"get":{"summary":"List automations","tags":["Automations"],"operationId":"listAutomations","security":[{"api_key":[]}],"description":"Returns a list of non-archived automations.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/automation"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/custom-field-values":{"get":{"summary":"List custom field values","tags":["Custom Field Values"],"operationId":"listCustomFieldValues","security":[{"api_key":[]}],"description":"Returns a list of custom field values for the organization, groups, or devices.","parameters":[{"name":"assigned_to_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include custom field values for the specified object. If not provided, global custom field values for the organization are returned. Otherwise, the ID should represent a group or device whose assigned custom field values will be returned."},{"name":"custom_field_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include the value for the specified custom field."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/custom_field_value"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}},"patch":{"summary":"Update custom field value","tags":["Custom Field Values"],"operationId":"updateCustomFieldValue","security":[{"api_key":[]}],"description":"Set a custom field value for the organization, group, or device.","parameters":[],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_field_value"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_id","value"],"properties":{"custom_field_id":{"type":"string","description":"The ID of the custom field to set the value for."},"assigned_to_id":{"type":["string","null"],"description":"The ID of the object to set the value for. If not provided, the value will be set globally for the organization. Otherwise, the ID should represent a group or device whose custom field value will be set."},"value":{"type":"string","description":"The value to set for the custom field."},"force":{"type":"boolean","description":"When 'force' is true, the provided value will override any custom field values that are set for descendants of the assigned_to_id. Otherwise, the value will be set only for the assigned_to_id and any descendants that don't have an explicit custom field value set."}}}}},"required":true}},"delete":{"summary":"Delete custom field value","tags":["Custom Field Values"],"operationId":"deleteCustomFieldValue","security":[{"api_key":[]}],"description":"Deletes a custom field value for the organization, group, or device.","parameters":[],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_id"],"properties":{"custom_field_id":{"type":"string","description":"The ID of the custom field to delete the value for."},"assigned_to_id":{"type":["string","null"],"description":"The ID of the object to delete the value for. If not provided, the value will be deleted globally for the organization. Otherwise, the ID should represent a group or device whose custom field value will be deleted."},"force":{"type":"boolean","description":"When 'force' is true, the value will be deleted for all descendants of the assigned_to_id. Otherwise, the value will be deleted only for the assigned_to_id and any descendants that don't have an explicit custom field value set."}}}}},"required":true}}},"/v2/custom-fields":{"get":{"summary":"List custom fields","tags":["Custom Fields"],"operationId":"listCustomFields","security":[{"api_key":[]}],"description":"Returns a list of custom fields.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/custom_field"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}},"post":{"summary":"Create custom field","tags":["Custom Fields"],"operationId":"createCustomField","security":[{"api_key":[]}],"description":"Creates a custom field.","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_field"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Region","description":"The name of the custom field."},"admin_only":{"type":"boolean","example":false,"description":"When 'admin_only' is true, this field's value can only be viewed or edited by an admin."}}}}},"required":true}}},"/v2/custom-fields/{id}":{"get":{"summary":"Show custom field","tags":["Custom Fields"],"operationId":"showCustomField","security":[{"api_key":[]}],"description":"Retrieves the details of an existing custom field.","parameters":[{"name":"id","in":"path","description":"The ID of the custom field.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_field"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}},"patch":{"summary":"Update custom field","tags":["Custom Fields"],"operationId":"updateCustomField","security":[{"api_key":[]}],"description":"Updates a custom field.","parameters":[{"name":"id","in":"path","description":"The ID of the custom field.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/custom_field"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Region","description":"The name of the custom field."},"admin_only":{"type":"boolean","example":false,"description":"When 'admin_only' is true, this field's value can only be viewed or edited by an admin."}}}}},"required":true}},"delete":{"summary":"Delete custom field","tags":["Custom Fields"],"operationId":"deleteCustomField","security":[{"api_key":[]}],"description":"Deletes a custom field.","parameters":[{"name":"id","in":"path","description":"The ID of the custom field.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}}}},"/v2/devices":{"get":{"summary":"List devices","tags":["Devices"],"operationId":"listDevices","security":[{"api_key":[]}],"description":"Returns a list of your devices.","parameters":[{"name":"group_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include devices with the given parent group id. If not provided, all devices are returned. If 'null' is provided, only devices without a parent group are returned."},{"name":"ancestor_group_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include devices with the given group id as an ancestor."},{"name":"tag_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include devices that have the specified tag."},{"name":"hostname","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include devices with the specified hostname."},{"name":"serial_number","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include devices with the specified serial number."},{"name":"include_operating_system","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed operating system information in the response."},{"name":"include_cpus","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed CPU information in the response."},{"name":"include_memory","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed memory information in the response."},{"name":"include_disks","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed disk and disk partitioninformation in the response."},{"name":"include_recovery_keys","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include active disk encryption recovery keys in the response."},{"name":"include_network_interfaces","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed network interface information in the response."},{"name":"include_motherboard","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include motherboard information in the response."},{"name":"include_security","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed security information in the response."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/device"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/devices/{id}":{"get":{"summary":"Show device","tags":["Devices"],"operationId":"showDevice","security":[{"api_key":[]}],"description":"Retrieves the details of an existing device.","parameters":[{"name":"id","in":"path","description":"The ID of the device to retrieve.","required":true,"schema":{"type":"string"}},{"name":"include_operating_system","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed operating system information in the response."},{"name":"include_cpus","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed CPU information in the response."},{"name":"include_memory","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed memory information in the response."},{"name":"include_disks","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed disk and disk partitioninformation in the response."},{"name":"include_recovery_keys","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include active disk encryption recovery keys in the response."},{"name":"include_network_interfaces","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed network interface information in the response."},{"name":"include_motherboard","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include motherboard information in the response."},{"name":"include_security","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include detailed security information in the response."}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/device"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}},"delete":{"summary":"Delete device","tags":["Devices"],"operationId":"deleteDevice","security":[{"api_key":[]}],"description":"Deletes the specified device.","parameters":[{"name":"id","in":"path","description":"The ID of the device to delete.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}}},"patch":{"summary":"Update device","tags":["Devices"],"operationId":"updateDevice","security":[{"api_key":[]}],"description":"Updates the specified device.","parameters":[{"name":"id","in":"path","description":"The ID of the device to update.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/device"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the device."},"notes":{"type":"string","description":"The notes for the device."},"group_id":{"type":["string","null"],"description":"The ID of the group to assign the device to. If null, the device will be removed from its current group."}}}}},"required":true}}},"/v2/groups/{id}/devices":{"post":{"summary":"Assign devices to group","tags":["Groups"],"operationId":"assignGroupDevices","security":[{"api_key":[]}],"description":"Assigns the specified devices to the given group.","parameters":[{"name":"id","in":"path","description":"ID of the group.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Assigned","content":{"application/json":{"schema":{"type":"object","properties":{"group":{"$ref":"#/components/schemas/group"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["device_ids"],"properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"An array of device IDs to assign to the group."}}}}},"required":true}},"delete":{"summary":"Remove devices from group","tags":["Groups"],"operationId":"removeGroupDevices","security":[{"api_key":[]}],"description":"Removes the specified devices from the group.","parameters":[{"name":"id","in":"path","description":"ID of the group.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized"},"422":{"description":"Unprocessable entity"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["device_ids"],"properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"An array of device IDs to remove from the group."}}}}},"required":true}}},"/v2/groups":{"get":{"summary":"List groups","tags":["Groups"],"operationId":"listGroups","security":[{"api_key":[]}],"description":"Returns a list of your groups.","parameters":[{"name":"parent_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include groups with the given parent id. If not provided, all groups are returned. If 'null' is provided, only root groups are returned."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/group"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}}}},"post":{"summary":"Create group","tags":["Groups"],"operationId":"createGroup","security":[{"api_key":[]}],"description":"Creates a new group.","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/group"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Servers","description":"The name of the group."},"parent_id":{"type":["string","null"],"description":"The parent group ID. If not provided, or null, a root group will be created."}}}}},"required":true}}},"/v2/groups/{id}":{"get":{"summary":"Show group","tags":["Groups"],"operationId":"showGroup","security":[{"api_key":[]}],"description":"Retrieves the details of an existing group.","parameters":[{"name":"id","in":"path","description":"The ID of the group to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/group"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}},"patch":{"summary":"Update group","tags":["Groups"],"operationId":"updateGroup","security":[{"api_key":[]}],"description":"Updates an existing group.","parameters":[{"name":"id","in":"path","description":"The ID of the group to update.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/group"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Renamed Group","description":"The name of the group."},"parent_id":{"type":["string","null"],"description":"The parent group ID. If not provided, or null, the group will be moved to the root level."}}}}},"required":true}},"delete":{"summary":"Delete group","tags":["Groups"],"operationId":"deleteGroup","security":[{"api_key":[]}],"description":"Deletes an existing group.","parameters":[{"name":"id","in":"path","description":"The ID of the group to delete.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}}}},"/v2/tags/{id}/devices":{"post":{"summary":"Tag devices","tags":["Tags"],"operationId":"tagDevices","security":[{"api_key":[]}],"description":"Applies a tag to the provided devices.","parameters":[{"name":"id","in":"path","description":"ID of the tag to apply.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Tagged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tag"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["device_ids"],"properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"An array of device IDs to tag."}}}}},"required":true}},"delete":{"summary":"Remove tag from devices","tags":["Tags"],"operationId":"removeTagFromDevices","security":[{"api_key":[]}],"description":"Removes a tag from the provided devices.","parameters":[{"name":"id","in":"path","description":"ID of the tag to remove.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized"},"422":{"description":"Unprocessable entity"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["device_ids"],"properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"An array of device IDs to remove the tag from."}}}}},"required":true}}},"/v2/tags":{"get":{"summary":"List tags","tags":["Tags"],"operationId":"listTags","security":[{"api_key":[]}],"description":"Returns a list of tags.","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include tags for the specified device. If not provided, all tags are returned."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/tag"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}}}},"post":{"summary":"Create tag","tags":["Tags"],"operationId":"createTag","security":[{"api_key":[]}],"description":"Creates a new tag.","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tag"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"The tag name."}}}}},"required":true}}},"/v2/tags/{id}":{"get":{"summary":"Show tag","tags":["Tags"],"operationId":"showTag","security":[{"api_key":[]}],"description":"Retrieves a tag.","parameters":[{"name":"id","in":"path","description":"The ID of the tag to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tag"}}}}}},"patch":{"summary":"Update tag","tags":["Tags"],"operationId":"updateTag","security":[{"api_key":[]}],"description":"Updates an existing tag.","parameters":[{"name":"id","in":"path","description":"The ID of the tag to update.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tag"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the tag."}}}}},"required":true}},"delete":{"summary":"Delete tag","tags":["Tags"],"operationId":"deleteTag","security":[{"api_key":[]}],"description":"Deletes a tag.","parameters":[{"name":"id","in":"path","description":"The ID of the tag to delete.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"}}}},"/v2/updates":{"get":{"summary":"List updates","tags":["Updates"],"operationId":"listUpdates","security":[{"api_key":[]}],"description":"Returns a list of your updates.","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include updates for the specified device_id."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["available","installed"]},"description":"Filter to only include updates with the given status."},{"name":"category","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to only include updates with the given category."},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/starting_after"}},{"name":"ending_before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ending_before"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/update"}},"has_more":{"$ref":"#/components/schemas/has_more"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}}}}},"/v2/updates/{id}":{"get":{"summary":"Show update","tags":["Updates"],"operationId":"showUpdate","security":[{"api_key":[]}],"description":"Retrieves the details of an existing update.","parameters":[{"name":"id","in":"path","description":"The ID of the update to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/update"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}}}},"/v2/automations/webhooks/{token}":{"post":{"summary":"Trigger webhook","tags":["Automations"],"operationId":"triggerWebhook","security":[{},{"api_key":[]}],"description":"Triggers an automation via a webhook. Webhooks that require an authorization header must include a write-enabled API key.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"},"description":"The token of the webhook to trigger."}],"responses":{"200":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/automation_run_reference"}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"},"example":["No enabled actions"]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Access denied"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Record not found"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"device_ids":{"type":"array","items":{"type":"string"},"description":"Trigger the automation for the specified devices. Conditions on the trigger will still be applied."}},"additionalProperties":{"type":"string","description":"Additional parameters can be mapped to variables if configured on the webhook trigger."},"example":{"device_ids":["Z2lkOi8vYXBwL0RldmljZS8x"],"email":"user@example.com","count":"42"}}}}}}}},"webhooks":{"alert_active":{"post":{"summary":"Alert Active Webhook","description":"Sent when an alert becomes active","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/alert_webhook_event"}}}}}},"alert_resolved":{"post":{"summary":"Alert Resolved Webhook","description":"Sent when an alert is resolved","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/alert_webhook_event"}}}}}},"device_created":{"post":{"summary":"Device Created Webhook","description":"Sent when a device is created","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/device_webhook_event"}}}}}},"device_updated":{"post":{"summary":"Device Updated Webhook","description":"Sent when a device is updated","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/device_webhook_event"}}}}}},"device_deleted":{"post":{"summary":"Device Deleted Webhook","description":"Sent when a device is deleted","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/device_webhook_event"}}}}}},"group_created":{"post":{"summary":"Group Created Webhook","description":"Sent when a group is created","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/group_webhook_event"}}}}}},"group_updated":{"post":{"summary":"Group Updated Webhook","description":"Sent when a group is updated","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/group_webhook_event"}}}}}},"group_deleted":{"post":{"summary":"Group Deleted Webhook","description":"Sent when a group is deleted","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/group_webhook_event"}}}}}}},"servers":[{"url":"https://api.level.io"}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"limit":{"type":"string","example":"20","description":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n"},"starting_after":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"A cursor for use in pagination. starting_after is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with ID '1234', your subsequent call can include 'starting_after=1234' in order to fetch the next page of the list."},"ending_before":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzIx","description":"A cursor for use in pagination. ending_before is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with ID '1234', your subsequent call can include 'ending_before=1234' in order to fetch the previous page of the list."},"activity_reference":{"type":"object","description":"Identifying information for a source, context, target, or related object.","properties":{"type":{"type":["string","null"],"example":"device","description":"The reference type."},"id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the reference. Null when the referenced object no longer exists."},"name":{"type":["string","null"],"example":"server-12","description":"The name recorded when the activity occurred."}},"required":["type","id","name"]},"activity":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXVkaXRFbnRyeS8x","description":"The ID of the activity."},"event_type":{"type":"string","example":"device.updated","description":"The specific type of activity."},"category":{"type":"string","enum":["automation","automation_configuration","automation_run","script","script_run","device","tag","group","monitor_policy","remote_access","team","access","permission","api_key","custom_field","organization","update_exclusion"],"example":"device","description":"The category of the activity."},"created_at":{"type":"string","format":"date-time","example":"2026-07-09T14:20:31.000Z","description":"When the activity was recorded."},"source":{"oneOf":[{"$ref":"#/components/schemas/activity_reference"},{"type":"null"}],"description":"The person or system that performed the activity."},"context":{"oneOf":[{"$ref":"#/components/schemas/activity_reference"},{"type":"null"}],"description":"The object the activity is grouped around. It is often the same as the target, but can be broader. For example, an automation can be the context while one of its actions is the target."},"target":{"oneOf":[{"$ref":"#/components/schemas/activity_reference"},{"type":"null"}],"description":"The object directly affected by the activity."},"related":{"oneOf":[{"$ref":"#/components/schemas/activity_reference"},{"type":"null"}],"description":"A secondary object involved in the activity, such as a tag applied to a device or the group a device moved into. Null when no secondary object is involved."},"details":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"example":{"changes":[{"field":"nickname","from":"Front Desk","to":"Reception"}]},"description":"Additional details about the activity. The fields vary based on event_type."}},"required":["id","event_type","category","created_at","source","context","target","related","details"]},"group":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlR3JvdXAvMQ","description":"The ID of the group."},"parent_id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvRGV2aWNlR3JvdXAvMQ","description":"The ID of the group's parent group."},"child_ids":{"type":"array","example":["Z2lkOi8vbGV2ZWwvRGV2aWNlR3JvdXAvMQ","Z2lkOi8vbGV2ZWwvRGV2aWNlR3JvdXAvMw"],"items":{"type":"string"},"description":"The IDs of the group's direct children."},"name":{"type":"string","example":"First Floor","description":"The name of the group."},"device_count":{"type":"integer","example":10,"description":"A count of devices assigned to this group."},"descendent_device_count":{"type":"integer","example":100,"description":"A count of devices in the full heiracrchy of this group."}},"required":["id","name","child_ids","device_count","descendent_device_count"]},"device":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the device."},"hostname":{"type":"string","example":"level-device-1","description":"The hostname of the device."},"nickname":{"type":["string","null"],"example":"Level's Device","description":"The nickname of the device."},"role":{"type":["string","null"],"enum":["workstation","server","domain_controller",null],"example":"workstation","description":"The role of the device."},"group_id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvRGV2aWNlR3JvdXAvMQ","description":"The ID of the group the device is assigned to."},"tags":{"type":"array","items":{"type":"string"},"example":["exchange","nginx"],"description":"The names of the tags applied to the device."},"flag":{"type":["string","null"],"example":"broken","description":"The active flag on the device."},"maintenance_mode":{"type":"boolean","example":true,"description":"Indicates if the device is in maintenance mode."},"online":{"type":"boolean","example":true,"description":"Indicates if the device is online."},"notes":{"type":["string","null"],"example":"This device is located in the server room.","description":"User-created notes about the device."},"manufacturer":{"type":["string","null"],"example":"Dell","description":"The manufacturer of the device."},"model":{"type":["string","null"],"example":"OptiPlex 5070","description":"The model of the device."},"architecture":{"type":["string","null"],"example":"amd64","description":"The architecture of the system."},"serial_number":{"type":["string","null"],"example":"1A2F3G4H","description":"The manufacturer's serial number."},"total_memory":{"type":["integer","null"],"example":1073741824,"description":"The total memory of the device in bytes."},"memory_slots":{"type":["integer","null"],"example":4,"description":"The total number of memory slots on the device."},"cpu_cores":{"type":["integer","null"],"example":6,"description":"The number of CPU cores on the device."},"last_logged_in_user":{"type":["string","null"],"example":"jdoe","description":"The last user logged in to the device."},"last_reboot_time":{"type":["string","null"],"format":"date-time","example":"2025-01-01T01:00:00.000Z","description":"The last time the device was rebooted."},"last_seen_at":{"type":["string","null"],"format":"date-time","example":"2025-01-01T01:00:00.000Z","description":"The last time the device was seen. Returns the current time if the device is online."},"city":{"type":["string","null"],"example":"Asheville","description":"The city the device is located in."},"country":{"type":["string","null"],"example":"United States","description":"The country the device is located in."},"security_score":{"type":["integer","null"],"example":90,"description":"The security score of the device."},"platform":{"type":["string","null"],"enum":["Windows","Mac","Linux",null],"example":"Windows","description":"The operating system platform of the device."},"operating_system":{"type":"object","properties":{"full_operating_system":{"type":["string","null"],"example":"Windows 10","description":"The full operating system of the device."},"major_version":{"type":["string","null"],"example":"10.0","description":"The major version of the operating system."},"minor_version":{"type":["string","null"],"example":"10.0.19045.5247","description":"The minor version of the operating system."},"architecture":{"type":["string","null"],"example":"64-bit","description":"The architecture of the operating system."},"install_date":{"type":["string","null"],"format":"date-time","example":"2020-01-01T01:00:00.000Z","description":"The install date of the operating system in UTC."},"end_of_life":{"type":"boolean","example":true,"description":"Indicates if the operating system is end of life."}}},"cpus":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string","example":"Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz","description":"The model of the CPU."},"clock_speed":{"type":"integer","example":3000,"description":"The clock speed of the CPU in MHz."},"cores":{"type":"integer","example":6,"description":"The number of cores on the CPU."}}},"description":"The CPUs on the device."},"memory":{"type":"array","items":{"type":"object","properties":{"location":{"type":"string","example":"BANK 0","description":"The location of the memory."},"manufacturer":{"type":"string","example":"Micron","description":"The manufacturer of the memory."},"memory_type":{"type":"string","example":"DDR4","description":"The type of the memory."},"clock_speed":{"type":"integer","example":2666,"description":"The clock speed of the memory in MHz."},"size":{"type":"integer","example":1073741824,"description":"The size of the memory in bytes."},"serial_number":{"type":"string","example":"0000000","description":"The serial number of the memory."},"part_number":{"type":"string","example":"ABC-123","description":"The part number of the memory."},"form_factor":{"type":"string","example":"SODIMM","description":"The form factor of the memory."}}},"description":"The memory on the device."},"disks":{"type":"array","items":{"type":"object","properties":{"disk_type":{"type":"string","example":"SCSI","description":"The type of the disk."},"model":{"type":"string","example":"SCSI Disk Device","description":"The model of the disk."},"serial_number":{"type":"string","example":"123_456","description":"The serial number of the disk."},"size":{"type":"integer","example":128849011200,"description":"The size of the disk in bytes."}}},"description":"The disks on the device."},"disk_partitions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","example":"Local Fixed Disk","description":"The label of the disk partition."},"mount_point":{"type":"string","example":"C:","description":"The mount point of the disk partition."},"encrypted":{"type":"boolean","example":false,"description":"Indicates if the disk partition is encrypted."},"primary":{"type":"boolean","example":true,"description":"Indicates if the disk partition is the primary partition."},"size":{"type":"integer","example":1073741824,"description":"The size of the disk partition in bytes."},"free_space":{"type":"integer","example":1073741824,"description":"The free space of the disk partition in bytes."},"file_system":{"type":"string","example":"NTFS","description":"The file system of the disk partition."}}},"description":"The disk partitions on the device."},"recovery_keys":{"type":"array","description":"The active disk encryption recovery keys on the device.","items":{"type":"object","properties":{"mount_point":{"type":["string","null"],"example":"C:","description":"The mount point of the partition the key unlocks."},"label":{"type":["string","null"],"example":"System","description":"The label of the partition the key unlocks."},"recovery_key":{"type":"string","example":"EXAMPLE-RECOVERY-KEY","description":"The disk encryption recovery key."}},"required":["mount_point","label","recovery_key"]}},"motherboard":{"type":"object","properties":{"manufacturer":{"type":["string","null"],"example":"Dell Inc.","description":"The manufacturer of the motherboard."},"model":{"type":["string","null"],"example":"0WWJRX","description":"The model of the motherboard."},"version":{"type":["string","null"],"example":"A01","description":"The version of the motherboard."},"serial_number":{"type":["string","null"],"example":"ABC1234","description":"The serial number of the motherboard."},"bios_version":{"type":["string","null"],"example":"1.2.3","description":"The BIOS version of the motherboard."},"release_date":{"type":["string","null"],"format":"date-time","example":"2024-01-01T00:00:00.000Z","description":"The BIOS release date."}},"description":"Motherboard information for the device."},"network_interfaces":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","example":"Microsoft Wi-Fi Direct Virtual Adapter","description":"The description of the network interface."},"interface":{"type":"string","example":"10","description":"The interface of the network interface."},"mac_address":{"type":"string","example":"00:00:00:00:00:00","description":"The MAC address of the network interface."},"ip_addresses":{"type":"array","items":{"type":"string"},"example":["192.168.1.1","192.168.1.2"],"description":"The IP addresses of the network interface."},"gateway":{"type":["string","null"],"example":"192.168.1.1","description":"The IP address of the gateway."},"domain":{"type":["string","null"],"example":"level.io","description":"The domain of the network interface."},"dhcp_server":{"type":["string","null"],"example":"192.168.1.1","description":"The IP address of the DHCP server."},"dns_servers":{"type":["string","null"],"example":"8.8.8.8","description":"The DNS servers of the network interface."},"label":{"type":"string","example":"interface 10","description":"The label of the network interface."}}},"description":"The network interfaces on the device."},"security":{"type":"object","description":"Security information for the device. Fields vary by platform.","properties":{"score":{"type":["integer","null"],"example":90,"description":"The security score of the device."},"risk":{"type":["string","null"],"enum":["very_high_risk","high_risk","moderate_risk","low_risk",null],"example":"low_risk","description":"The risk category of the device."},"patch_compliance":{"type":"boolean","example":true,"description":"Indicates if the device is patch compliant."},"patch_security_risk":{"type":"string","enum":["up_to_date","warning","critical"],"example":"up_to_date","description":"The patch security risk level."},"os_end_of_life":{"type":"boolean","example":false,"description":"Indicates if the operating system is end of life."},"primary_partition_encrypted":{"type":"boolean","example":true,"description":"Indicates if the primary partition is encrypted."},"firewall_provider":{"type":["string","null"],"example":"Windows Firewall","description":"The firewall provider. Available on Windows, Mac, and Linux."},"firewall_enabled":{"type":["boolean","null"],"example":true,"description":"Indicates if the firewall is enabled. Available on Windows, Mac, and Linux."},"firewall_status":{"type":["string","null"],"example":"good","description":"The firewall status. Available on Windows."},"antivirus_provider":{"type":["string","null"],"example":"Windows Defender","description":"The antivirus provider. Available on Windows."},"antivirus_status":{"type":["string","null"],"example":"good","description":"The antivirus status. Available on Windows."},"auto_update":{"type":["string","null"],"description":"The auto update setting. Available on Windows."},"internet_settings":{"type":["string","null"],"description":"The internet settings. Available on Windows."},"windows_security_center_service":{"type":["string","null"],"description":"The Windows Security Center service status. Available on Windows."},"user_account_control_enabled":{"type":["boolean","null"],"example":true,"description":"Indicates if User Account Control is enabled. Available on Windows."},"admin_accounts_count":{"type":["integer","null"],"example":1,"description":"The number of admin accounts on the device. Available on Windows."},"stealth_enabled":{"type":["boolean","null"],"example":false,"description":"Indicates if stealth mode is enabled. Available on Mac."},"gatekeeper_enabled":{"type":["boolean","null"],"example":true,"description":"Indicates if Gatekeeper is enabled. Available on Mac."},"security_module_provider":{"type":["string","null"],"example":"AppArmor","description":"The security module provider. Available on Linux."},"security_module_enabled":{"type":["boolean","null"],"example":true,"description":"Indicates if the security module is enabled. Available on Linux."}}}}},"tag":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvVGFnLzI","description":"The ID of the tag."},"name":{"type":"string","example":"NGINX","description":"The tag name."},"device_count":{"type":"integer","example":4,"description":"The number of devices with this tag."}},"required":["id","name","device_count"]},"automation":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbi8x","description":"The ID of the automation."},"name":{"type":"string","example":"Patch devices","description":"The automation's name."},"description":{"type":["string","null"],"example":"Install pending updates.","description":"The automation's description."},"group_id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbkdyb3VwLzE","description":"The ID of the group the automation is assigned to."},"group_name":{"type":["string","null"],"example":"Maintenance","description":"The name of the group the automation is assigned to."}},"required":["id","name"]},"automation_webhook":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbnM6OldlYmhvb2tUcmlnZ2VyLzE","description":"The ID of the webhook trigger."},"name":{"type":"string","example":"Patch webhook","description":"The webhook trigger's name."},"automation_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbi8x","description":"The ID of the automation."},"automation_name":{"type":"string","example":"Patch devices","description":"The automation's name."},"automation_description":{"type":["string","null"],"example":"Install pending updates.","description":"The automation's description."},"group_id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbkdyb3VwLzE","description":"The ID of the group the automation is assigned to."},"group_name":{"type":["string","null"],"example":"Maintenance","description":"The name of the group the automation is assigned to."},"url":{"type":"string","example":"https://api.level.io/v2/automations/webhooks/abc123","description":"The webhook URL."},"requires_authorization_header":{"type":"boolean","example":true,"description":"Whether triggering the webhook requires an Authorization header."},"parameters":{"type":"array","items":{"type":"string"},"example":["device_ids","email"],"description":"Request parameter names accepted by the webhook."}},"required":["id","name","automation_id","automation_name","url","requires_authorization_header","parameters"]},"automation_run_reference":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbnM6OlJ1bi8x","description":"The ID of the automation run."},"device_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the device the run was created for."}},"required":["id","device_id"]},"automation_run":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbnM6OlJ1bi8x","description":"The ID of the automation run."},"automation_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQXV0b21hdGlvbi8x","description":"The ID of the automation."},"automation_name":{"type":"string","example":"Patch devices","description":"The name of the automation."},"device_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the device the automation run is for."},"device_hostname":{"type":"string","example":"level-device-1","description":"The hostname of the device the automation run is for."},"status":{"type":"string","enum":["queued","running","success","warning","error","canceled"],"example":"running","description":"The automation run status."},"started_at":{"type":["string","null"],"format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"The time the automation run started in UTC."},"ended_at":{"type":["string","null"],"format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"The time the automation run ended in UTC."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/automation_run_step"},"description":"The automation run's steps. Only included when include_steps is true."}},"required":["id","automation_id","automation_name","device_id","device_hostname","status"]},"automation_run_step":{"type":"object","properties":{"name":{"type":"string","example":"Run script","description":"The step's display name."},"status":{"type":"string","enum":["pending","running","success","failed","when_next_online","skipped","canceled"],"example":"success","description":"The step status."},"output":{"type":"string","example":"Script output","description":"The step output formatted as plain text."}},"required":["name","status","output"]},"custom_field":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQ3VzdG9tRmllbGQvMQ","description":"The ID of the custom field."},"name":{"type":"string","example":"Region","description":"The custom field's name."},"reference":{"type":"string","example":"cf_region","description":"How the field is referenced in automation scripts."},"admin_only":{"type":"boolean","example":false,"description":"This field's value can only be viewed or edited by an account administrator."}},"required":["id","name","reference","admin_only"]},"custom_field_value":{"type":"object","properties":{"custom_field_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQ3VzdG9tRmllbGQvMQ","description":"The ID of the custom field this value is assigned to."},"custom_field_name":{"type":"string","example":"Region","description":"The name of the custom field this value is assigned to."},"assigned_to_id":{"type":["string","null"],"example":"Z2lkOi8vbGV2ZWwvQ3VzdG9tRmllbGQvMQ","description":"The ID of the object this value is assigned to. If the ID is null then the value is globally assigned to the organization. Otherwise, the ID will represent a group or device that the value is assigned to."},"value":{"type":["string","null"],"example":"West","description":"The value of the custom field for the assigned_to."}},"required":["custom_field_id","custom_field_name"]},"alert":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvQWxlcnQvMQ","description":"The ID of the alert."},"device_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the device the alert is for."},"device_hostname":{"type":"string","example":"level-device-1","description":"The hostname of the device the alert is for."},"name":{"type":"string","example":"Low disk space","description":"The name of the alert."},"description":{"type":"string","example":"Disk free < 5.0%","description":"The description of the alert."},"payload":{"type":["string","null"],"example":"4.37% (10.39 GB) remaining","description":"The payload of the alert."},"severity":{"type":"string","enum":["information","warning","critical","emergency"],"example":"critical","description":"The severity of the alert."},"is_resolved":{"type":"boolean","example":true,"description":"Indicates if the alert is resolved."},"started_at":{"type":"string","format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"The start time of the alert in UTC."},"resolved_at":{"type":["string","null"],"format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"The time the alert was resolved in UTC."}},"required":["id","device_id","device_hostname","name","description","severity","is_resolved","started_at"]},"update":{"type":"object","properties":{"id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvVXBkYXRlLzE","description":"The ID of the update."},"device_id":{"type":"string","example":"Z2lkOi8vbGV2ZWwvRGV2aWNlLzE","description":"The ID of the device the update is for."},"device_hostname":{"type":"string","example":"level-device-1","description":"The hostname of the device the update is for."},"name":{"type":"string","example":"2024-01 Cumulative Update for Windows 11","description":"The name of the update."},"description":{"type":["string","null"],"example":"Addresses security issues for your Windows operating system.","description":"The description of the update."},"category":{"type":"string","example":"Security Updates","description":"The category of the update."},"version":{"type":["string","null"],"example":"1.0.0","description":"The version of the update."},"size":{"type":"integer","example":12345,"description":"The size of the update in bytes."},"kb_ids":{"type":"array","items":{"type":"string"},"example":["KB5025223"],"description":"The KB identifiers associated with the update."},"is_available":{"type":"boolean","example":true,"description":"Indicates if the update is currently available to install."},"error":{"type":["string","null"],"example":"Install failed","description":"The error reported while installing the update."},"published_on":{"type":["string","null"],"format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"The time the update was published in UTC."},"installed_on":{"type":["string","null"],"format":"date-time","example":"2024-01-02T01:00:00.000Z","description":"The time the update was installed in UTC."}},"required":["id","device_id","device_hostname","name","category","size","kb_ids","is_available"]},"has_more":{"type":"boolean","example":true,"description":"Returns true if this list has another page of items after this one that can be fetched."},"alert_webhook_event":{"type":"object","description":"This object is sent to your webhook endpoint when an alert becomes active or is resolved.","properties":{"event_type":{"type":"string","description":"The type of event. For this webhook, either 'alert_active' or 'alert_resolved'."},"event_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","description":"A unique ID for this event. Remains constant across retries."},"occurred_at":{"type":"string","format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"When this event occurred."},"data":{"$ref":"#/components/schemas/alert"}},"required":["event_type","event_id","occurred_at","data"]},"device_webhook_event":{"type":"object","description":"This object is sent to your webhook endpoint when a device is created, updated, or deleted.","properties":{"event_type":{"type":"string","description":"The type of event. For this webhook, either 'device_created', 'device_updated', or 'device_deleted'."},"event_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","description":"A unique ID for this event. Remains constant across retries."},"occurred_at":{"type":"string","format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"When this event occurred."},"data":{"$ref":"#/components/schemas/device"}},"required":["event_type","event_id","occurred_at","data"]},"group_webhook_event":{"type":"object","description":"This object is sent to your webhook endpoint when a group is created, updated, or deleted.","properties":{"event_type":{"type":"string","description":"The type of event. For this webhook, either 'group_created', 'group_updated', or 'group_deleted'."},"event_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","description":"A unique ID for this event. Remains constant across retries."},"occurred_at":{"type":"string","format":"date-time","example":"2024-01-01T01:00:00.000Z","description":"When this event occurred."},"data":{"$ref":"#/components/schemas/group"}},"required":["event_type","event_id","occurred_at","data"]}}}}