# Generate a lockbox code Generate a one-time code for a lockbox. The code can be generated by providing either a lockbox_id, serial_number, or unit_id. The code will be valid for the specified date. Endpoint: POST /lockboxes/generate_code Version: 1.1.1 Security: BearerAuth ## Request fields (application/json): - `lockbox_id` (string) ID of the lockbox. Either this, serial_number, or unit_id must be provided. Example: "123e4567-e89b-12d3-a456-426614174000" - `serial_number` (string) Serial number of the lockbox. Either this, lockbox_id, or unit_id must be provided. Example: "1234567" - `unit_id` (number) ID of the unit where the lockbox is installed. Either this, lockbox_id, or serial_number must be provided. Example: 12345 - `date` (string, required) Date for which the code should be valid (YYYY-MM-DD format) Example: "2024-03-15" - `created_for` (string) Optional name or identifierof the person the code is being created for Example: "John Doe" - `code_type` (string) Type of code to generate. Only relevant for Sentrilock lockboxes. All other boxes can only generate ACCESS codes. Enum: "ACCESS", "SHACKLE" ## Response 200 fields (application/json): - `code` (string) The generated lockbox code Example: "1234" - `lockboxType` (string) Type of the lockbox Enum: "Sentrilock", "Codebox" - `instructions` (string) Optional instructions for using the code. May or may not be provided, depending on the lockbox. Example: "Enter code followed by #" ## Response 400 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (array) Detailed error information Example: [{"keyword":"required","dataPath":"","schemaPath":"#/required","params":{"missingProperty":"account_id"},"message":"should have required property 'account_id'"}] ## Response 401 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (array) Detailed error information Example: [{"keyword":"required","dataPath":"","schemaPath":"#/required","params":{"missingProperty":"account_id"},"message":"should have required property 'account_id'"}] ## Response 500 fields (application/json): - `error` (string, required) Error message Example: "Invalid request parameters" - `details` (array) Detailed error information Example: [{"keyword":"required","dataPath":"","schemaPath":"#/required","params":{"missingProperty":"account_id"},"message":"should have required property 'account_id'"}]