{"openapi":"3.1.0","info":{"description":"Allows configuration and issuing of digital keys for operators","title":"Access Management","version":"1.0"},"externalDocs":{"description":"Trackunit Developer Hub","url":"https://developers.trackunit.com/"},"servers":[{"url":"https://iris.trackunit.com/api/access-management","description":"API Endpoint"}],"security":[{"authorizationBearer":[]}],"paths":{"/assets/{assetId}/configure":{"get":{"operationId":"getCurrentConfigurationForDevice","parameters":[{"description":"Id of the asset that is being configured.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"example":{"immobilizerMode":"IGNITION_SENSE","keyExpireTime":30,"keyValidTime":30,"lastChange":{"requestedDateTime":"2023-06-21T14:21:09.802Z","status":"PENDING","toImmobilizerMode":"NORMAL","toKeyValidTime":30,"toKeyExpireTime":30}},"schema":{"$ref":"#/components/schemas/DeviceConfigurationResponseRepresentation"}}},"description":"The current configuration on the device."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get device configuration","tags":["Asset setup"]},"post":{"operationId":"configureDevice","parameters":[{"description":"Id of the asset that is being configured.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceConfigurationRequestRepresentation"}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous processing."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Configure access management mode","tags":["Asset setup"]}},"/assets/{assetId}/rolling-pin-code":{"get":{"description":"Retrieves a PIN code that can unlock an asset if there is a valid active key. The request parameters are not needed if the rolling pin code is configured with operatorPinIdLength = 0.","operationId":"getActivePinCode","parameters":[{"description":"The id of the asset for which the rolling pin code should be generated.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}},{"description":"Used and required when rolling pin codes for the asset are generated per operator.","in":"query","name":"operatorId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"The id of the key for which the rolling pin code should be returned.","in":"query","name":"keyId","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"example":{"pin":"123456","validTo":"2023-06-21T14:10:17.528Z"},"schema":{"$ref":"#/components/schemas/ActivePinCodeRepresentation"}}},"description":"A rolling pin code."},"204":{"description":"There is no key that is valid currently so no pin code can be generated."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get rolling PIN code","tags":["Rolling PIN code"]}},"/assets/{assetId}/rolling-pin-code/setup":{"post":{"description":"Sends a command to the device with the appropriate shared secret (20 bytes) (sharedSecretBase64), total pin length (pinLength) and number of digits that operator id takes in the pin code (operatorPinIdLength). If sharedSecretBase64 is not provided - a random value of 20 bytes is generated","operationId":"setupRollingPinCode","parameters":[{"description":"The asset id for which the setup should be performed.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollingPinCodeSetupRequestRepresentation"}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous processing."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Setup rolling PIN code","tags":["Asset setup"]}},"/assets/{assetId}/setup":{"get":{"description":"Returns the current access management mode setup for an asset","operationId":"getCurrentModeForDevice","parameters":[{"description":"The asset id for which the digital key mode should be returned.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"example":{"accessManagementMode":"UNLOCKED_FOR_KEY","lastChange":{"requestedDateTime":"2023-06-21T14:21:09.802Z","status":"PENDING","toMode":"UNLOCKED_FOR_ALL"}},"schema":{"$ref":"#/components/schemas/AccessManagementModeResponseRepresentation"}}},"description":"The current access management mode setup on the device."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get access management mode","tags":["Asset setup"]},"post":{"description":"Creates a command to the asset with appropriate access management configuration settings.","operationId":"setupDeviceDigitalKey","parameters":[{"description":"The asset id for which the setup should be performed.","in":"path","name":"assetId","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessManagementSetupRequestRepresentation"}}},"required":true},"responses":{"202":{"description":"Accepted for asynchronous processing."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Setup access management.","tags":["Asset setup"]}},"/batch-keys":{"post":{"description":"This endpoint can create keys for multiple operators per call.\n\nThe keys can be created for multiple assets or assets in multiple sites, groups or an entire fleet depending on the payload.\n","operationId":"saveOperatorKeys","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BatchAssetKeyRepresentation"},{"$ref":"#/components/schemas/BatchFleetKeyRepresentation"},{"$ref":"#/components/schemas/BatchGroupKeyRepresentation"},{"$ref":"#/components/schemas/BatchSiteKeyRepresentation"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"keys":[{"accessType":"DIGITAL_KEY","assetId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","groupId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"},{"accessType":"DIGITAL_KEY","assetId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","groupId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","id":"999f6040-103f-11ee-be56-0242ac120002","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"}]},"schema":{"$ref":"#/components/schemas/SaveBatchKeyResponseRepresentation"}}},"description":"Keys have been created successfully. A list of created keys."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"422":{"content":{"application/json":{"example":{"status":422,"code":"request_validation_error","message":"Unable to process batch request as some target entities were not found","properties":{"assetsNotFound":["7d781d07-476a-4a6f-bc55-221bb6b1b361","719631ea-b000-4f78-ba84-1c6e7bad7bd7"],"operatorsNotFound":["9f4ab05c-fef4-472a-bada-e7034222a5c6","a35555cb-fc0c-4e6d-a558-b76c97103592"]}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Keys were not created. Validation failed on one of passed entities: assetId (properties.assetsNotFound will be populated), operatorId (properties.operatorsNotFound will be populated), groupId (properties.groupsNotFound will be populated), siteId (properties.sitesNotFound will be populated)."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Create keys","tags":["Keys"]}},"/keys":{"get":{"description":"Gets paginated list of keys. The endpoint uses [page based pagination](https://developers.trackunit.com/reference/pagination#page-based-pagination).\nKeys can be filtered by optional parameters: operatorId, assetId, description, companyName and status.\n","operationId":"getKeys","parameters":[{"description":"Zero-based page index (0..N)","example":0,"in":"query","name":"page","required":false,"schema":{"type":"integer","format":"int32","default":0,"minimum":0}},{"description":"The size of the page to be returned","example":20,"in":"query","name":"size","required":false,"schema":{"type":"integer","format":"int32","default":20,"minimum":1}},{"description":"Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).","in":"query","name":"sort","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Search query.","in":"query","name":"query","required":false,"schema":{"type":"string"}},{"description":"Id of operator that has key assigned.","in":"query","name":"operatorId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"Id of asset keys are assigned to.","in":"query","name":"assetId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"Id of site keys are assigned to.","in":"query","name":"siteId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"Id of customer keys are assigned to.","in":"query","name":"customerId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"Description of a key.","in":"query","name":"description","required":false,"schema":{"type":"string"}},{"description":"Company name associated with the key","in":"query","name":"companyName","required":false,"schema":{"type":"string"}},{"description":"Should deleted entries also be returned?","in":"query","name":"showDeleted","required":false,"schema":{"type":"boolean","default":false}},{"description":"Should expired entries also be returned?","in":"query","name":"showExpired","required":false,"schema":{"type":"boolean","default":true}},{"description":"Should future entries also be returned?","in":"query","name":"showFuture","required":false,"schema":{"type":"boolean","default":true}},{"description":"Should active entries also be returned?","in":"query","name":"showActive","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"content":{"application/json":{"example":{"content":[{"accessType":"DIGITAL_KEY","assetId":"999f6040-103f-11ee-be56-0242ac120002","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","companyName":"Company Name","id":"ba239c0a-8cff-4844-b1a4-42b54318b195","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"},{"accessType":"DIGITAL_KEY","assetId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","companyName":"Company Name","id":"b9896717-f782-4450-8414-d74198d607e5","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}],"number":0,"numberOfElements":2,"size":2,"totalElements":2,"totalPages":1},"schema":{"$ref":"#/components/schemas/PaginatedKeyRepresentation"}}},"description":"A list of keys."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get keys","tags":["Keys"]},"post":{"description":"The \"Create Key\" endpoint generates a single access key for various access methods and target scopes, allowing you to define a time period during which the key is active.\n\nThis key is used to secure and control access to assets within the system.\n\nAccess keys can be created for individual operators, asset groups, entire sites, or entire fleets of assets, with the option to specify an active time window for the key.\n\nMay return **constraint violations** if access requests:\n- Break mandatory business rules.\n- Reference non-existent objects.\n\n| Code                          | Type                    | Description |\n|-------------------------------|------------------------|-------------|\n| `assetsNotFound`              | Unknown object         | `[assetId]` not found. |\n| `operatorsNotFound`           | Unknown object         | `[operatorId]` not found. |\n| `groupsNotFound`              | Unknown object         | `[groupId]` not found. |\n| `sitesNotFound`               | Unknown object         | `[siteId]` not found. |\n| `accountOperatorKeysNotAllowed` | Business rule violation | `[operatorId]` cannot be assigned digital keys or rolling PINs due to account restrictions. |\n| `conflictingKey`              | Business rule violation | Existing key with overlapping time, same asset/group/site/fleet, and identical key card or static PIN. |\n| `conflictType`                 | Business rule violation | `\"non-customer specific access already exists\"` – generic non-customer key blocks specific customer key. <br> `\"similar access already exists\"` – similar key already exists. |\n","operationId":"saveOperatorKey","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Asset"},{"$ref":"#/components/schemas/Fleet"},{"$ref":"#/components/schemas/Group"},{"$ref":"#/components/schemas/Site"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"accessType":"DIGITAL_KEY","assetId":"0aa1586b-6535-4826-9b08-ea9ca092cd16","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","id":"999f6040-103f-11ee-be56-0242ac120002","operatorId":"ba239c0a-8cff-4844-b1a4-42b54318b195","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"},"schema":{"$ref":"#/components/schemas/KeyRepresentation"}}},"description":"Key has been created successfully. Newly created key."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Create key","tags":["Keys"]}},"/keys/{id}":{"delete":{"description":"Deletes key by id.","operationId":"deleteKeyById","parameters":[{"description":"Id of key that should be deleted.","in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Key has been successfully deleted."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Delete key","tags":["Keys"]},"get":{"description":"Gets a specific key by id.","operationId":"getKeyById","parameters":[{"description":"Requested digital key ID.","in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"}},{"description":"Should deleted entries also be returned?","in":"query","name":"showDeleted","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"content":{"application/json":{"example":{"accessType":"DIGITAL_KEY","assetId":"0aa1586b-6535-4826-9b08-ea9ca092cd16","createdDate":"2023-06-21T14:27:56.215Z","description":"Key description","id":"999f6040-103f-11ee-be56-0242ac120002","operatorId":"ba239c0a-8cff-4844-b1a4-42b54318b195","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"},"schema":{"$ref":"#/components/schemas/KeyRepresentation"}}},"description":"Returns the requested key."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get key","tags":["Keys"]}},"/keys/{keyId}":{"patch":{"operationId":"updateKey","parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKeyRepresentation"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"accessType":"DIGITAL_KEY","assetId":"0aa1586b-6535-4826-9b08-ea9ca092cd16","createdDate":"2023-06-21T14:27:56.215Z","operatorId":"ba239c0a-8cff-4844-b1a4-42b54318b195","timePeriodEnd":"2023-06-23T14:27:56.215Z","timePeriodStart":"2023-06-21T14:27:56.215Z"}}},"description":"The updated key."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Update key","tags":["Keys"]}},"/keys/{keyId}/deployment-status":{"get":{"description":"Returns the current static pin deployment status for every asset that the key was created for.\nApplicable only for STATIC_PIN and KEY_CARD key access types.\n","operationId":"getKeyDeploymentStatus","parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string","format":"uuid"}},{"description":"Zero-based page index (0..N)","example":0,"in":"query","name":"page","required":false,"schema":{"type":"integer","format":"int32","default":0,"minimum":0}},{"description":"The size of the page to be returned","example":20,"in":"query","name":"size","required":false,"schema":{"type":"integer","format":"int32","default":20,"minimum":1}},{"description":"Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).","in":"query","name":"sort","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"content":{"application/json":{"example":{"content":[{"assetId":"0aa1586b-6535-4826-9b08-ea9ca092cd16","status":"DEPLOYING","operation":"ADDING","since":"2023-06-23T14:27:56.215Z","lastUpdate":"2023-06-21T14:27:56.215Z"}],"number":0,"numberOfElements":1,"size":1,"totalElements":1,"totalPages":1},"schema":{"$ref":"#/components/schemas/PaginatedKeyDeploymentStatusRepresentation"}}},"description":"A list of key deployment statuses."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get key deployment status","tags":["Keys"]}},"/keyusage":{"get":{"description":"Gets list of events related to locking and unlocking assets. Can be queried either by operatorId or by assetId.\n\nCustom rate limits:\n- 2 requests per minute per operator or asset.\n","operationId":"getKeyUsages","parameters":[{"description":"If provided, events for the given operator are returned.","in":"query","name":"operatorId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"If provided, events for the given asset are returned.","in":"query","name":"assetId","required":false,"schema":{"type":"string","format":"uuid"}},{"description":"Only include events since this time. Defaults to the 14 days back.","in":"query","name":"dateFrom","required":false,"schema":{"type":"string"}},{"description":"Only include events until this time. Defaults to the time of request execution.","in":"query","name":"dateTo","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":[{"accessType":"DIGITAL_KEY","assetId":"ba239c0a-8cff-4844-b1a4-42b54318b195","keyId":"999f6040-103f-11ee-be56-0242ac120002","operation":"LOCK","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","success":true,"timestamp":"2023-06-21T14:49:45.468Z"},{"accessType":"DIGITAL_KEY","assetId":"b9896717-f782-4450-8414-d74198d607e5","keyId":"18c08090-1043-11ee-be56-0242ac120002","operation":"UNLOCK","error":"ALREADY_UNLOCKED","operatorId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","success":false,"timestamp":"2023-06-22T14:49:45.468Z"}],"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeyUsageRepresentation"}}}},"description":"A list of key usage events."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolationError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Invalid or missing bearer token in Authorization header"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"User not allowed to make this request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Resource not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultError"}}},"description":"Internal server error"}},"summary":"Get key usage events.","tags":["Keys"]}}},"components":{"schemas":{"AccessManagementModeChange":{"type":"object","properties":{"requestedDateTime":{"type":"string","format":"date-time","description":"When the change was made."},"status":{"type":"string","description":"The status of the change.\n\n|Status|Description|\n|-|-|\n|**PENDING**|The digital mode change has yet to be confirmed.|\n|**SUCCEEDED**|The digital mode change was processed successfully.|\n|**FAILED**|The digital mode change was not processed successfully.|\n|**UNKNOWN**|Unknown status of the digital mode change.|\n","enum":["PENDING","SUCCEEDED","FAILED","UNKNOWN"]},"toMode":{"type":"string","description":"The requested digital mode of the change.\n\n|Type|Description|\n|-|-|\n|**UNLOCKED_FOR_ALL**|Asset can be started.|\n|**UNLOCKED_FOR_KEY**|Asset can be started only after unlocking it with the PIN/mobile phone.|\n|**LOCKED_FOR_ALL**|Asset can not be started.|\n","enum":["UNLOCKED_FOR_ALL","UNLOCKED_FOR_KEY","LOCKED_FOR_ALL"]}},"required":["requestedDateTime","status","toMode"]},"AccessManagementModeResponseRepresentation":{"type":"object","properties":{"accessManagementMode":{"type":"string","description":"The access management mode.\n\n|Type|Description|\n|-|-|\n|**UNLOCKED_FOR_ALL**|Asset can be started.|\n|**UNLOCKED_FOR_KEY**|Asset can be started only after unlocking it with the Keypad/mobile phone.|\n|**LOCKED_FOR_ALL**|Asset can't be started.|\n|**UNSUPPORTED**|Asset doesn't support digital keys.|\n|**UNKNOWN**|Unknown access management mode.|\n","enum":["UNLOCKED_FOR_ALL","UNLOCKED_FOR_KEY","LOCKED_FOR_ALL","UNSUPPORTED","UNKNOWN"]},"lastChange":{"$ref":"#/components/schemas/AccessManagementModeChange","description":"The last digital key mode change."}}},"AccessManagementSetupRequestRepresentation":{"type":"object","properties":{"accessManagementMode":{"type":"string","description":"The access management mode that the asset should be updated to.\n\n|Type|Description|\n|-|-|\n|**UNLOCKED_FOR_ALL**|Asset can be started.|\n|**UNLOCKED_FOR_KEY**|Asset can be started only after unlocking it with the PIN/mobile phone.|\n|**LOCKED_FOR_ALL**|Asset can not be started.|\n","enum":["UNLOCKED_FOR_ALL","UNLOCKED_FOR_KEY","LOCKED_FOR_ALL"]}}},"ActivePinCodeRepresentation":{"type":"object","properties":{"pin":{"type":"string","description":"The pin code."},"validTo":{"type":"string","format":"date-time","description":"When the key expires."}},"required":["pin","validTo"]},"Asset":{"allOf":[{"$ref":"#/components/schemas/SaveKeyRepresentation"},{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","description":"If the key should be created for a specific asset this is the id of the asset."}}}],"description":"A key that is created for an asset.","required":["assetId"]},"BatchAssetKeyRepresentation":{"allOf":[{"$ref":"#/components/schemas/SaveBatchKeyRepresentation"},{"type":"object","properties":{"assetIds":{"type":"array","description":"The list of assets that can be accessed with the key.","items":{"type":"string","format":"uuid"},"minItems":1}}}],"required":["accessType","assetIds"]},"BatchFleetKeyRepresentation":{"allOf":[{"$ref":"#/components/schemas/SaveBatchKeyRepresentation"}],"required":["accessType"]},"BatchGroupKeyRepresentation":{"allOf":[{"$ref":"#/components/schemas/SaveBatchKeyRepresentation"},{"type":"object","properties":{"groupIds":{"type":"array","description":"The list of asset groups that can be accessed with the key.","items":{"type":"string","format":"uuid"}}}}],"required":["accessType","groupIds"]},"BatchSiteKeyRepresentation":{"allOf":[{"$ref":"#/components/schemas/SaveBatchKeyRepresentation"},{"type":"object","properties":{"siteIds":{"type":"array","description":"The list of sites that can be accessed with the key.","items":{"type":"string","format":"uuid"}}}}],"required":["accessType","siteIds"]},"ConstraintViolationError":{"type":"object","properties":{"code":{"type":["string","null"],"description":"Alphanumeric code (snake case) describing use case specific error"},"message":{"type":"string","description":"Detailed description of error"},"properties":{"type":["object","null"],"additionalProperties":{},"description":"Additional properties to be included in the error response"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"violations":{"type":"array","items":{"$ref":"#/components/schemas/Violation"}}}},"DefaultError":{"type":"object","properties":{"code":{"type":["string","null"],"description":"Alphanumeric code (snake case) describing use case specific error"},"message":{"type":"string","description":"Detailed description of error"},"properties":{"type":["object","null"],"additionalProperties":{},"description":"Additional properties to be included in the error response"},"status":{"type":"integer","format":"int32","description":"HTTP status code"}}},"DeviceConfigurationChange":{"type":"object","properties":{"requestedDateTime":{"type":"string","format":"date-time","description":"When the change was made."},"status":{"type":"string","description":"The status of the change.\n\n|Status|Description|\n|-|-|\n|**PENDING**|The device configuration change has yet to be confirmed.|\n|**SUCCEEDED**|The device configuration change was processed successfully.|\n|**FAILED**|The device configuration change was not processed successfully.|\n|**UNKNOWN**|Unknown status of the device configuration change.|\n","enum":["PENDING","SUCCEEDED","FAILED","UNKNOWN"]},"toImmobilizerMode":{"type":"string","description":"The requested immobilizer mode  of the change.\n\n|Type|Description|\n|-|-|\n|**NORMAL**|Typically used for assets with combustion engines. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n|**BOOM_SENSE**|Typically used for boom lifts. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when both ignition and boom sense is turned off.|\n|**IGNITION_SENSE**|Typically used for electrical assets. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n","enum":["NORMAL","BOOM_SENSE","IGNITION_SENSE","IS_WORKING"]},"toKeyExpireTime":{"type":"integer","format":"int32","description":"The requested key expire time of the change"},"toKeyValidTime":{"type":"integer","format":"int32","description":"The requested key valid time of the change"}},"required":["requestedDateTime","status"]},"DeviceConfigurationRequestRepresentation":{"type":"object","properties":{"immobilizerMode":{"type":"string","description":"The requested ImmobilizerMode.\nControls the logic behind the locking mechanics.\n\n|Type|Description|\n|-|-|\n|**NORMAL**|Typically used for assets with combustion engines. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n|**BOOM_SENSE**|Typically used for boom lifts. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when both ignition and boom sense is turned off.|\n|**IGNITION_SENSE**|Typically used for electrical assets. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n","enum":["NORMAL","BOOM_SENSE","IGNITION_SENSE","IS_WORKING"]},"keyExpireTime":{"type":"integer","format":"int32","description":"How many seconds after the ignition turns off until machine locks.","maximum":64800,"minimum":1},"keyValidTime":{"type":"integer","format":"int32","description":"How many seconds can ignition be turned on after the digital key has unlocked the asset via Bluetooth.","maximum":64800,"minimum":1}}},"DeviceConfigurationResponseRepresentation":{"type":"object","properties":{"immobilizerMode":{"type":"string","description":"The requested ImmobilizerMode.\nControls the logic behind the locking mechanics.\n\n|Type|Description|\n|-|-|\n|**NORMAL**|Typically used for assets with combustion engines. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n|**BOOM_SENSE**|Typically used for boom lifts. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when both ignition and boom sense is turned off.|\n|**IGNITION_SENSE**|Typically used for electrical assets. When the asset is unlocked the ignition can be turned on within the keyValidTime and will lock after keyExpireTime when ignition is turned off.|\n|**IS_WORKING**|Typically used for lifts with a specific hardware setup; relies on work logic being configured separately (typically a combination of IN2 and IN4). When the asset is unlocked it will stay unlocked until isWorking goes off, and keyExpireTime has elapsed.|\n","enum":["NORMAL","BOOM_SENSE","IGNITION_SENSE","IS_WORKING"]},"keyExpireTime":{"type":"integer","format":"int32","description":"How many seconds after the ignition turns off until machine locks.","maximum":64800,"minimum":1},"keyValidTime":{"type":"integer","format":"int32","description":"How many seconds can ignition be turned on after the digital key has unlocked the asset via Bluetooth.","maximum":64800,"minimum":1},"lastChange":{"$ref":"#/components/schemas/DeviceConfigurationChange","description":"The last device configuration change."}}},"Error":{"type":"object","properties":{"code":{"type":["string","null"],"description":"Alphanumeric code (snake case) describing use case specific error"},"message":{"type":"string","description":"Detailed description of error"},"properties":{"type":["object","null"],"additionalProperties":{},"description":"Additional properties to be included in the error response"},"status":{"type":"integer","format":"int32","description":"HTTP status code"}}},"Fleet":{"allOf":[{"$ref":"#/components/schemas/SaveKeyRepresentation"},{"type":"object","properties":{"entireFleet":{"type":"boolean","description":"If the key should be created for an entire fleet of owned and supported assets. This boolean is required to be **true**."}}}],"description":"A key that is created for an entire fleet of supported assets.","required":["entireFleet"]},"Group":{"allOf":[{"$ref":"#/components/schemas/SaveKeyRepresentation"},{"type":"object","properties":{"groupId":{"type":"string","format":"uuid","description":"If the key should be created for a group, this is the id of the group."}}}],"description":"A key that is created for a group.","required":["groupId"]},"KeyDeploymentStatusRepresentation":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","description":"The id of the asset the static pin code operation deployment status is represented for."},"deploymentStatus":{"type":"string","description":"Deployment status. In preview, may change and may not be populated yet.","enum":["PENDING_DEPLOYMENT","PENDING_REMOVAL","ACTIVE","FAILED","REMOVAL_FAILED","NOT_APPLICABLE","INCOMPLETE","UNKNOWN"]},"deploymentStatusMessage":{"type":"string","description":"Extra information, eg. can contain error message received from telematics device. Optional. In preview, may change and may not be populated yet."},"deploymentStatusReason":{"type":"string","description":"A reason why given deployment status is returned. Eg. status: FAILED and the reason is: AM_DETAILS_MISSING, meaning that not all required data is present, eg. operator key card was not configured. Field value is optional.\n\nIn preview, may change and may not be populated yet."},"id":{"type":"string","format":"uuid","description":"The internal id of the object representing deployment status."},"lastUpdate":{"type":"string","format":"date-time","description":"When current status of the deployment was published."},"operation":{"type":"string","description":"The key deployment operation.\nDeprecated, replaced by more accurate computedDeploymentStatus.\n\n|Type|Description|\n|-|-|\n|**ADDING**|New static pin code is added to the asset.|\n|**REMOVING**|Existing static pin code is removed from the asset.|\n","enum":["ADDING","REMOVING"]},"since":{"type":"string","format":"date-time","description":"When current operation was started to be deployed."},"status":{"type":"string","description":"The status of the key deployment operation.\nDeprecated, replaced by more accurate computedDeploymentStatus.\n\n|Type|Description|\n|-|-|\n|**DEPLOYING**|Static pin code operation deployment to asset in progress.|\n|**ACCEPTED**|Static pin code operation deployment to asset was successful.|\n|**FAILED**|Static pin code operation deployment to asset was unsuccessful.|\n|**NOT_APPLICABLE**|Static pin code operation deployment to asset is not applicable for the asset. Wrong key access type or asset type (KIN).|\n","enum":["NOT_APPLICABLE","DEPLOYING","ACCEPTED","FAILED"]}},"required":["assetId","id","status"]},"KeyDeploymentStatusSummaryRepresentation":{"type":"object","properties":{"accepted":{"type":"integer","format":"int32","description":"Number of successful deployments."},"deploying":{"type":"integer","format":"int32","description":"Number of deployments in progress."},"failed":{"type":"integer","format":"int32","description":"Number of unsuccessful deployments."},"notApplicable":{"type":"integer","format":"int32","description":"Number of not applicable deployments."},"removalAccepted":{"type":"integer","format":"int32","description":"Number of successful removals."},"removalFailed":{"type":"integer","format":"int32","description":"Number of unsuccessful removals."},"removalPending":{"type":"integer","format":"int32","description":"Number of removals in progress."}}},"KeyRepresentation":{"type":"object","properties":{"accessType":{"type":"string","description":"The access type of the key.\n\n|Type|Description|\n|-|-|\n|**DIGITAL_KEY**|Asset can be accessed using the mobile phone.|\n|**ROLLING_PIN**|Asset can be accessed by typing the rolling (periodically changing) pin on the attached keypad.|\n|**STATIC_PIN**|Asset can be accessed by typing the static pin on the attached keypad.|\n|**KEY_CARD**|Asset can be accessed by using the key-card.|\n","enum":["STATIC_PIN","DIGITAL_KEY","ROLLING_PIN","KEY_CARD"]},"assetId":{"type":"string","format":"uuid","description":"If the key was created for a specific asset this is the id of the asset."},"code":{"type":"string","description":"If the key has an access type of KEY_CARD or STATIC_PIN, this is the key's static code. The code for a KEY_CARD has to be 16 characters long.","maximum":16,"pattern":"^[0-9a-fA-F]+$"},"companyName":{"type":"string","description":"The company name associated with the key.","maxLength":255,"minLength":0},"createdDate":{"type":"string","format":"date-time","description":"When the key was created."},"customerId":{"type":"string","format":"uuid","description":"If the key was created for a customer, this is the id of the customer."},"deployment":{"$ref":"#/components/schemas/KeyDeploymentStatusSummaryRepresentation","description":"The summary of key deployment operation statuses. Only for STATIC_PINs and KEY_CARDs."},"description":{"type":"string","description":"The description of the key.","maxLength":65535,"minLength":0},"entireFleet":{"type":"boolean","description":"Is 'true' if the key is created for entire fleet."},"groupId":{"type":"string","format":"uuid","description":"If the key was created for a group, this is the id of the group."},"id":{"type":"string","format":"uuid","description":"The id of the key."},"isDeleted":{"type":"boolean","description":"Field is only returned when keys are queried with 'showDeleted' parameter. It's **true** when the key is deleted."},"operatorId":{"type":"string","format":"uuid","description":"The id of the operator the key is assigned to."},"siteId":{"type":"string","format":"uuid","description":"If the key was created for a site, this is the id of the site."},"timePeriodEnd":{"type":"string","format":"date-time","description":"Timestamp describing when the key expires. If not set the key is valid indefinitely."},"timePeriodStart":{"type":"string","format":"date-time","description":"Timestamp defining when the key becomes valid."}},"required":["accessType","id","timePeriodStart"]},"KeyUsageRepresentation":{"type":"object","properties":{"accessType":{"type":"string","description":"The access type of the key.\n\n|Type|Description|\n|-|-|\n|**DIGITAL_KEY**|Device was accessed by a mobile phone.|\n|**ROLLING_PIN**|Device was accessed by typing in a rolling (periodically changing) pin on attached keypad.|\n|**STATIC_PIN**|Device was accessed by typing in a static pin on attached keypad.|\n|**KEY_CARD**|Device was accessed by using a key-card on attached keypad.|\n|**KEYPAD_USE**|Device was accessed by using attached keypad, but the type of the pin code was not recognized, most probably entered pin code was invalid.|\n","enum":["DIGITAL_KEY","ROLLING_PIN","STATIC_PIN","UNKNOWN_PIN","KEY_CARD","KEYPAD_USE"]},"assetId":{"type":"string","format":"uuid","description":"The id of the asset."},"code":{"type":"string","description":"PIN or key card code used to perform the operation."},"companyName":{"type":"string","description":"The company name associated with the key.","maxLength":255,"minLength":0},"description":{"type":"string","description":"The description of the key.","maxLength":65535,"minLength":0},"error":{"type":"string","description":"The reason if operation fails.\n\n|Error|Description|\n|-|-|\n|**UNSPECIFIED**|Unknown error|\n|**SECURITY_CHECK_FAILED_INVALID_SIGNATURE**|Security check failed due to invalid signature|\n|**SECURITY_CHECK_FAILED_INVALID_SERIAL_NUMBER**|Security check failed due to invalid serial number||\n|**SECURITY_CHECK_FAILED_INVALID_MASTER_ID**|Security check failed due to invalid master ID|\n|**SECURITY_CHECK_FAILED_INVALID_BLUETOOTH_ADDRESS**|Security check failed due to invalid bluetooth address|\n|**SECURITY_CHECK_FAILED_INVALID_TIME_PERIOD**|Security check failed due to invalid time period|\n|**SECURITY_CHECK_FAILED_INVALID_REPLY_PROTECTOR**|Security check failed due to invalid replay protector|\n|**ALREADY_UNLOCKED**|Digital Key access already granted to the operator|\n|**ALREADY_UNLOCKED_FOR_OTHER**|Digital Key access already granted to another operator|\n|**UNIT_CONFIGURATION_INVALID**|Digital Key mode invalid|\n|**PIN_INVALID**|PIN Invalid|\n|**ALREADY_UNLOCKED_BY_PIN**|PIN not accepted. Access already granted via PIN|\n|**ALREADY_UNLOCKED_BY_DIGITAL_KEY**|PIN not accepted. Digital Key access already granted|\n","enum":["UNSPECIFIED","SECURITY_CHECK_FAILED_INVALID_SIGNATURE","SECURITY_CHECK_FAILED_INVALID_SERIAL_NUMBER","SECURITY_CHECK_FAILED_INVALID_MASTER_ID","SECURITY_CHECK_FAILED_INVALID_BLUETOOTH_ADDRESS","SECURITY_CHECK_FAILED_INVALID_TIME_PERIOD","SECURITY_CHECK_FAILED_INVALID_REPLY_PROTECTOR","ALREADY_UNLOCKED","ALREADY_UNLOCKED_FOR_OTHER","UNIT_CONFIGURATION_INVALID","PIN_INVALID","ALREADY_UNLOCKED_BY_PIN","ALREADY_UNLOCKED_BY_DIGITAL_KEY"]},"keyId":{"type":"string","format":"uuid","description":"The id of the key."},"operation":{"type":"string","description":"The performed operation.\n\n|Type|Description|\n|-|-|\n|**UNLOCK**|The operator tried to unlock the device.|\n|**LOCK**|The operator tried to lock the device.|\n","enum":["UNLOCK","LOCK"]},"operatorId":{"type":"string","format":"uuid","description":"This is the id of the operator that generates the key usage event."},"success":{"type":"boolean","description":"Is true if key was used successfully."},"timestamp":{"type":"string","format":"date-time","description":"Timestamp defining when the operations was performed."}}},"PaginatedKeyDeploymentStatusRepresentation":{"type":"object","properties":{"content":{"type":"array","description":"The page content as a list.","items":{"$ref":"#/components/schemas/KeyDeploymentStatusRepresentation"}},"number":{"type":"integer","format":"int32","description":"The number of the current page."},"numberOfElements":{"type":"integer","format":"int32","description":"The number of elements currently on this page."},"size":{"type":"integer","format":"int32","description":"The size of the page."},"totalElements":{"type":"integer","format":"int64","description":"The total number of elements."},"totalPages":{"type":"integer","format":"int32","description":"The number of total pages."}}},"PaginatedKeyRepresentation":{"type":"object","properties":{"content":{"type":"array","description":"The page content as a list.","items":{"$ref":"#/components/schemas/KeyRepresentation"}},"number":{"type":"integer","format":"int32","description":"The number of the current page."},"numberOfElements":{"type":"integer","format":"int32","description":"The number of elements currently on this page."},"size":{"type":"integer","format":"int32","description":"The size of the page."},"totalElements":{"type":"integer","format":"int64","description":"The total number of elements."},"totalPages":{"type":"integer","format":"int32","description":"The number of total pages."}}},"RollingPinCodeSetupRequestRepresentation":{"type":"object","properties":{"operatorPinIdLength":{"type":"integer","format":"int32","description":"Number of digits reserved for identifying an operator. Eg. if the value here is 2, there can be maximum of 100 operators being able to unlock this asset with a rolling pin (having rolling PIN generated).","minimum":0},"pinLength":{"type":"integer","format":"int32","description":"Total length of generated pin code to be entered on a keypad.","maximum":16,"minimum":3},"sharedSecretBase64":{"type":"string","description":"The shared secret. The value is Base64 encoded."}}},"SaveBatchKeyRepresentation":{"type":"object","discriminator":{"mapping":{"ASSET":"#/components/schemas/BatchAssetKeyRepresentation","FLEET":"#/components/schemas/BatchFleetKeyRepresentation","GROUP":"#/components/schemas/BatchGroupKeyRepresentation","SITE":"#/components/schemas/BatchSiteKeyRepresentation"},"propertyName":"keyType"},"properties":{"accessType":{"type":"string","description":"The access type of the key.\n\n|Type|Description|\n|-|-|\n|**DIGITAL_KEY**|Asset can be accessed using the mobile phone.|\n|**ROLLING_PIN**|Asset can be accessed by typing the rolling (periodically changing) pin on the attached keypad.|\n|**STATIC_PIN**|Asset can be accessed by typing the static pin on the attached keypad.|\n|**KEY_CARD**|Asset can be accessed by using the key-card.|\n","enum":["STATIC_PIN","DIGITAL_KEY","ROLLING_PIN","KEY_CARD"]},"code":{"type":"string","description":"If the key has an access type of KEY_CARD or STATIC_PIN, this is the key's static code. The code for a KEY_CARD has to be 16 characters long.","maximum":16,"pattern":"^[0-9a-fA-F]+$"},"companyName":{"type":"string","description":"The company name associated with the key.","maxLength":255,"minLength":0},"customerId":{"type":"string","format":"uuid"},"description":{"type":"string","description":"The description of the key.","maxLength":65535,"minLength":0},"keyType":{"type":"string","description":"The key type.","enum":["ASSET","GROUP","SITE","FLEET"]},"operatorIds":{"type":"array","description":"The list of operators that should gain access.","items":{"type":"string","format":"uuid"}},"timePeriodEnd":{"type":"string","format":"date-time","description":"Timestamp describing when the key expires. If not provided the key is valid indefinitely."},"timePeriodStart":{"type":"string","format":"date-time","description":"Timestamp defining when the key becomes valid. If not provided the key is valid immediately."}},"required":["accessType"]},"SaveBatchKeyResponseRepresentation":{"type":"object","properties":{"keys":{"type":"array","description":"The list of created keys.","items":{"$ref":"#/components/schemas/KeyRepresentation"}}}},"SaveKeyRepresentation":{"type":"object","properties":{"accessType":{"type":"string","default":"DIGITAL_KEY","description":"The access type of the key.\n\n|Type|Description|\n|-|-|\n|**DIGITAL_KEY**|Asset can be accessed using the mobile phone.|\n|**ROLLING_PIN**|Asset can be accessed by typing the rolling (periodically changing) pin on the attached keypad.|\n|**STATIC_PIN**|Asset can be accessed by typing the static pin on the attached keypad.|\n|**KEY_CARD**|Asset can be accessed by using the key-card.|\n","enum":["STATIC_PIN","DIGITAL_KEY","ROLLING_PIN","KEY_CARD"]},"code":{"type":"string","description":"If the key has an access type of KEY_CARD or STATIC_PIN, this is the key's static code. The code for a KEY_CARD has to be 16 characters long.","maximum":16,"pattern":"^[0-9a-fA-F]+$"},"companyName":{"type":"string","description":"The company name associated with the key.","maxLength":255,"minLength":0},"customerId":{"type":"string","format":"uuid"},"description":{"type":"string","description":"The description of the key.","maxLength":65535,"minLength":0},"operatorId":{"type":"string","format":"uuid","description":"This is the id of the operator that has access to the key."},"timePeriodEnd":{"type":"string","format":"date-time","description":"Timestamp describing when the key expires. If not provided the key is valid indefinitely."},"timePeriodStart":{"type":"string","format":"date-time","description":"Timestamp defining when the key becomes valid. If not provided the key is valid immediately."}}},"Site":{"allOf":[{"$ref":"#/components/schemas/SaveKeyRepresentation"},{"type":"object","properties":{"siteId":{"type":"string","format":"uuid","description":"If the key should be created for a site, this is the id of the site."}}}],"description":"A key that is created for a site.","required":["siteId"]},"UpdateKeyRepresentation":{"type":"object","description":"Defined fields will be updated. Undefined fields will be ignored. Validation applies only to defined fields.","properties":{"companyName":{"type":"string","description":"The company name associated with the key.","maxLength":255,"minLength":0},"description":{"type":"string","description":"The description of the key.","maxLength":65535,"minLength":0},"timePeriodEnd":{"type":"string","format":"date-time","description":"Timestamp describing when the key expires. If not set the key is valid indefinitely."},"timePeriodStart":{"type":"string","format":"date-time","description":"Timestamp defining when the key becomes valid."}}},"Violation":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}},"securitySchemes":{"authorizationBearer":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}}}