Access Control

Access Control API client and functional wrappers for pykada.

The AccessControlClient covers door management, access users and groups, credentials (cards, BLE, licence plates, PIN, MFA), access levels, access events, and door exceptions through Verkada’s Access Control API.

Module-level functional wrappers share a single lazily-initialized AccessControlClient instance.

Client

class pykada.access_control.AccessControlClient(api_key=None, token_manager=None, request_manager=None)[source]

Bases: BaseClient

Client for interacting with Verkada’s Access Control API.

Initializes the AccessControlClient.

Parameters:
delete_access_card(card_id, user_id=None, external_id=None)[source]

Delete an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If card_id is an empty string.

add_card_to_user(user_id=None, external_id=None, active=False, card_number=None, card_number_hex=None, card_number_base36=None, facility_code='', card_type='')[source]

Add a card to a user.

Creates and adds an access card for a specified user (by user_id or external_id) and organization. The card object is passed in the request body as JSON. This request requires a facility code and exactly one of the following: card_number, card_number_hex, or card_number_base36. The ‘active’ field defaults to False.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • active (Optional[bool]) – Boolean flag indicating if the credential should be active. Defaults to False.

  • card_number (Optional[str]) – The card number used to grant or deny access.

  • card_number_hex (Optional[str]) – The card number in hexadecimal format.

  • card_number_base36 (Optional[str]) – The card number in base36 format.

  • facility_code (str) – The facility code used to grant or deny access.

  • card_type (str) – The type of card (e.g., Standard 26-bit Wiegand, HID 37-bit, etc.).

Return type:

Dict[str, Any]

Returns:

JSON response containing the created credential information.

Raises:

ValueError – If not exactly one of card_number, card_number_hex, or card_number_base36 is provided.

activate_access_card(card_id, user_id=None, external_id=None)[source]

Activate an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the activation.

Raises:

ValueError – If card_id is an empty string.

deactivate_access_card(card_id, user_id=None, external_id=None)[source]

Deactivate an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the deactivation.

Raises:

ValueError – If card_id is an empty string.

delete_license_plate_from_user(license_plate_number, user_id=None, external_id=None)[source]

Delete a license plate from a user.

Parameters:
  • license_plate_number (str) – The license plate number to be deleted.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If license_plate_number is an empty string.

add_license_plate_to_user(license_plate_number, active=False, name=None, user_id=None, external_id=None)[source]

Add a license plate to a user.

Parameters:
  • license_plate_number (str) – The license plate number to be added.

  • active (Optional[bool]) – Boolean flag indicating if the license plate should be active. Defaults to False.

  • name (Optional[str]) – Optional name associated with the license plate.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the added license plate details.

Raises:

ValueError – If license_plate_number is an empty string.

activate_license_plate(license_plate_number, user_id=None, external_id=None)[source]

Activate a license plate for a user.

Parameters:
  • license_plate_number (str) – The license plate number to be activated.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the activation.

Raises:

ValueError – If license_plate_number is an empty string.

deactivate_license_plate(license_plate_number, user_id=None, external_id=None)[source]

Deactivate a license plate for a user.

Parameters:
  • license_plate_number (str) – The license plate number to be deactivated.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the deactivation.

Raises:

ValueError – If license_plate_number is an empty string.

delete_mfa_code_from_user(code, user_id=None, external_id=None)[source]

Delete an MFA code from a user.

Parameters:
  • code (str) – The MFA code to be deleted.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If code is an empty string.

add_mfa_code_to_user(code, user_id=None, external_id=None)[source]

Add an MFA code to a user.

Parameters:
  • code (str) – The MFA code to be added.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the added MFA code details.

Raises:

ValueError – If code is an empty string.

get_all_door_exception_calendars(last_updated_at=None)[source]

Retrieve all available door exception calendars.

Parameters:

last_updated_at (Optional[int]) – Optional timestamp (Unix seconds) to filter calendars updated after this time.

Return type:

Dict[str, Any]

Returns:

JSON response containing all available door exception calendars.

get_door_exception_calendar(calendar_id)[source]

Retrieve a specific door exception calendar.

Parameters:

calendar_id (str) – The unique identifier for the door exception calendar.

Return type:

Dict[str, Any]

Returns:

JSON response containing the door exception calendar details.

Raises:

ValueError – If calendar_id is an empty string.

create_door_exception_calendar(doors, exceptions, name)[source]

Create a new door exception calendar.

Parameters:
  • doors (List[str]) – A non-empty list of door IDs.

  • exceptions (List[Dict[str, Any]]) – A non-empty list of door exception objects.

  • name (str) – Name of the door exception calendar.

Return type:

Dict[str, Any]

Returns:

JSON response containing the created door exception calendar information.

Raises:

ValueError – If any required field is missing or invalid.

update_door_exception_calendar(doors, exceptions, name, calendar_id)[source]

Update an existing door exception calendar.

Parameters:
  • doors (List[str]) – A non-empty list of door IDs.

  • exceptions (List[Dict[str, Any]]) – A non-empty list of door exception objects.

  • name (str) – Updated name of the door exception calendar.

  • calendar_id (str) – The unique identifier of the calendar to update.

Return type:

Dict[str, Any]

Returns:

JSON response containing the updated door exception calendar information.

Raises:

ValueError – If any required field is missing or invalid.

delete_door_exception_calendar(calendar_id)[source]

Delete a door exception calendar.

Parameters:

calendar_id (str) – The unique identifier for the door exception calendar to delete.

Return type:

Dict[str, Any]

Returns:

JSON response confirming deletion.

Raises:

ValueError – If calendar_id is an empty string.

get_exception_on_door_exception_calendar(calendar_id, exception_id)[source]

Retrieve a specific exception from a door exception calendar.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception.

Return type:

Dict[str, Any]

Returns:

JSON response containing the exception details.

Raises:

ValueError – If calendar_id or exception_id is an empty string.

add_exception_to_door_exception_calendar(calendar_id, exception)[source]

Add an Exception to a Door Exception Calendar.

Adds a new Exception to the Door Exception Calendar identified by calendar_id using the details provided in the exception object. The exception object must follow the expected schema and will be validated using the validate_door_exception function.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception (Dict[str, Any]) – A dictionary representing the new exception details.

Return type:

Dict[str, Any]

Returns:

JSON response containing the created exception information.

Raises:

ValueError – If calendar_id is an empty string or if the exception object fails validation.

update_exception_on_door_exception_calendar(calendar_id, exception_id, exception)[source]

Update an Exception on a Door Exception Calendar.

Updates the Exception identified by exception_id on the Door Exception Calendar identified by calendar_id using the new exception details provided as a single object.

The provided exception object must follow the expected schema, which is validated using the validate_door_exception function. For example, the object must include:

  • date (in YYYY-MM-DD format)

  • door_status (one of the allowed values)

  • For non-all-day exceptions, valid start_time and end_time (in HH:MM format)

  • If all_day_default is True, door_status must be "access_controlled", and start_time/end_time should be omitted or defaulted to "00:00" and "23:59", respectively.

  • Optional fields such as first_person_in, double_badge, and their corresponding group IDs, as well as an optional recurrence_rule object.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception to update.

  • exception (Dict[str, Any]) – A dictionary representing the new exception details.

Return type:

Dict[str, Any]

Returns:

JSON response containing the updated exception information.

Raises:

ValueError – If any required parameter is missing or if the exception object fails validation.

delete_exception_on_door_exception_calendar(calendar_id, exception_id)[source]

Delete an exception from a door exception calendar.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception to delete.

Return type:

Dict[str, Any]

Returns:

JSON response confirming deletion of the exception.

Raises:

ValueError – If calendar_id or exception_id is an empty string.

unlock_door_as_admin(door_id)[source]

Unlock a door as an administrator.

This function sends a request to unlock the specified door without requiring user identification.

Parameters:

door_id (str) – The unique identifier for the door.

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the unlock operation.

Raises:

ValueError – If door_id is an empty string.

unlock_door_as_user(door_id, user_id=None, external_id=None)[source]

Unlock a door as a user.

This function sends a request to unlock the specified door, using either the internal user_id or the external_id.

Parameters:
  • door_id (str) – The unique identifier for the door.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Return type:

Dict[str, Any]

Returns:

JSON response containing the result of the unlock operation.

Raises:

ValueError – If door_id is an empty string.

get_doors(door_id_list=None, site_id_list=None)[source]

Retrieve door information.

This function sends a GET request to retrieve details for doors based on provided door IDs and/or site IDs.

Parameters:
  • door_id_list (Optional[List[Any]]) – A list of door IDs. If provided, these will be joined into a comma-separated string.

  • site_id_list (Optional[List[Any]]) – A list of site IDs. If provided, these will be joined into a comma-separated string.

Return type:

Dict[str, Any]

Returns:

JSON response containing door information.

get_access_events(start_time=None, end_time=None, page_token=None, page_size=100, event_type=None, site_id=None, device_id=None, user_id=None)[source]

Retrieve access events based on various filters.

Parameters:
  • start_time (Optional[int]) – The start of the time range for requested events, as a Unix timestamp in seconds. Defaults to one hour ago from the current time if not provided.

  • end_time (Optional[int]) – The end of the time range for requested events, as a Unix timestamp in seconds. Defaults to the current time if not provided.

  • page_token (Optional[str]) – The pagination token used to fetch the next page of results.

  • page_size (Optional[int]) – The number of items returned in a single response (0 to 200). Defaults to 100.

  • event_type (Optional[List[str]]) – One or multiple comma-separated event type values.

  • site_id (Optional[str]) – One or multiple comma-separated site identifiers.

  • device_id (Optional[str]) – One or multiple comma-separated device identifiers.

  • user_id (Optional[str]) – One or multiple comma-separated user identifiers.

Return type:

Dict[str, Any]

Returns:

JSON response containing access events matching the provided filters.

Raises:

ValueError – If page_size is not between 0 and 200.

get_access_groups()[source]

Retrieve all access groups.

Returns:

JSON response containing a list of access groups.

Return type:

dict

delete_access_group(group_id)[source]

Delete an access group.

Parameters:

group_id (str) – The unique identifier for the access group.

Returns:

JSON response after deleting the access group.

Return type:

dict

Raises:

ValueError – If group_id is an empty string.

get_access_group(group_id)[source]

Retrieve a specific access group by its ID.

Parameters:

group_id (str) – The unique identifier for the access group.

Returns:

JSON response containing the access group details.

Return type:

dict

Raises:

ValueError – If group_id is an empty string.

create_access_group(name)[source]

Create a new access group with the specified name.

Parameters:

name (str) – The name for the new access group.

Returns:

JSON response containing details of the created access group.

Return type:

dict

Raises:

ValueError – If name is an empty string.

add_user_to_access_group(group_id, external_id=None, user_id=None)[source]

Add a user to an access group. Exactly one of user_id or external_id must be provided.

Parameters:
  • group_id (str) – The unique identifier for the access group.

  • external_id (Optional[str]) – The external identifier for the user.

  • user_id (Optional[str]) – The internal user identifier.

Returns:

JSON response after adding the user to the access group.

Return type:

dict

Raises:

ValueError – If group_id is empty, or if not exactly one of user_id or external_id is provided.

remove_user_from_access_group(group_id, external_id=None, user_id=None)[source]

Remove a user from an access group. Exactly one of user_id or external_id must be provided.

Parameters:
  • group_id (str) – The unique identifier for the access group.

  • external_id (Optional[str]) – The external identifier for the user.

  • user_id (Optional[str]) – The internal user identifier.

Return type:

dict

Returns:

JSON response after removing the user from the access group.

Raises:

ValueError – If group_id is empty, or if not exactly one of user_id or external_id is provided.

get_all_access_levels()[source]

Retrieve all available access levels.

Return type:

Dict[str, Any]

Returns:

JSON response containing all available access levels.

get_access_level(access_level_id)[source]

Retrieve details for a specific access level.

Parameters:

access_level_id (str) – The unique identifier for the access level.

Return type:

Dict[str, Any]

Returns:

JSON response containing the access level details.

Raises:

ValueError – If access_level_id is an empty string.

create_access_level(name, access_groups=None, access_schedule_events=None, doors=None, sites=None)[source]

Create a new Access Level.

To use this API, you need an API Key having permission “Door Access Management” for all sites listed in ‘sites’ for the Access Level, and “Manage via API” must also be enabled for all doors listed in ‘doors’.

Body Parameters:
  • access_groups (List[str], required): IDs of Access Groups granted door access via this Access Level.

  • access_schedule_events (List[Dict[str, Any]], required): List of Access Schedule Events associated with this Access Level.
    Each event object should include:
    • access_schedule_event_id (str): Unique identifier for the Access Schedule Event.

    • door_status (str): Door status for Access Schedule Events (defaults to “access_granted”).

    • start_time (str): Start time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

    • end_time (str): End time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

    • weekday (str): Enum for days of the week (e.g., “SU”).

  • doors (List[str], required): IDs of Doors accessible under this Access Level.

  • name (str, required): Name of the Access Level.

  • sites (List[str], required): IDs of Sites containing the Doors this Access Level applies to.

Parameters:
Return type:

Dict[str, Any]

Returns:

JSON response containing the created Access Level information.

Raises:

ValueError – If name is an empty string.

update_access_level(access_level_id, access_groups, access_schedule_events, doors, name, sites)[source]

Update an existing Access Level.

To use this API, you need an API Key having permission “Door Access Management” for all sites listed in ‘sites’ for the Access Level, and “Manage via API” must also be enabled for all doors listed in ‘doors’.

Parameters:
  • access_level_id (str) – The ID of the Access Level to be updated.

  • access_groups (List[str]) – List of Access Group IDs.

  • access_schedule_events (List[Dict[str, Any]]) – List of Access Schedule Event objects.

  • doors (List[str]) – List of Door IDs.

  • name (str) – Name for the Access Level.

  • sites (List[str]) – List of Site IDs.

Return type:

Dict[str, Any]

Returns:

JSON response containing the updated Access Level information.

Raises:

ValueError – If access_level_id or name is an empty string.

delete_access_level(access_level_id)[source]

Delete an access level.

Parameters:

access_level_id (str) – The unique identifier for the access level to delete.

Return type:

bytes

Returns:

The raw response content confirming deletion.

Raises:

ValueError – If access_level_id is an empty string.

add_access_schedule_event_to_access_level(access_level_id, start_time, end_time, weekday)[source]

Add an access schedule event to a specific access level.

The event details are provided in the payload. The door_status is fixed to “access_granted”.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • start_time (str) – Start time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

  • end_time (str) – End time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

  • weekday (str) – Enum for days of the week (e.g., “SU”).

Return type:

Dict[str, Any]

Returns:

JSON response containing the created event information.

Raises:

ValueError – If access_level_id is empty, if start_time or end_time are not valid, or if weekday is invalid.

update_access_schedule_event_on_access_level(access_level_id, event_id, start_time, end_time, weekday)[source]

Update an access schedule event on a specific access level.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • event_id (str) – The unique identifier for the schedule event.

  • start_time (str) – Updated start time in HH:MM format.

  • end_time (str) – Updated end time in HH:MM format.

  • weekday (str) – Updated weekday enum (e.g., “SU”).

Return type:

Dict[str, Any]

Returns:

JSON response containing the updated event information.

Raises:

ValueError – If any of the required identifiers or times are invalid.

delete_access_schedule_event_on_access_level(access_level_id, event_id)[source]

Delete an access schedule event from a specific access level.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • event_id (str) – The unique identifier for the schedule event.

Return type:

bytes

Returns:

The raw response content confirming deletion.

Raises:

ValueError – If access_level_id or event_id is an empty string.

get_all_access_users()[source]

Retrieve all access user information.

Returns:

JSON response containing access user information.

Return type:

dict

get_access_user(user_id=None, external_id=None)[source]

Retrieve access user by either user_id or external_id. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response containing access user details.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

activate_ble_for_access_user(user_id=None, external_id=None)[source]

Activate BLE for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after activating BLE for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

deactivate_ble_for_access_user(user_id=None, external_id=None)[source]

Deactivate BLE for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deactivating BLE for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

set_end_date_for_user(end_date, user_id=None, external_id=None)[source]

Set the end date for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • end_date (str) – The end date in string format.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after setting the end date for the access user.

Return type:

dict

Raises:

ValueError – If end_date is an empty string or if not exactly one of user_id or external_id is provided.

remove_entry_code_for_user(user_id=None, external_id=None)[source]

Remove the entry code for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after removing the entry code for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

set_entry_code_for_user(entry_code, user_id=None, external_id=None, override=False)[source]

Set the entry code for an access user.

Parameters:
  • entry_code (str) – The entry code to set.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • override (Optional[bool]) – Whether to override an existing entry code.

Returns:

JSON response after setting the entry code.

Return type:

dict

send_pass_app_invite_for_user(user_id=None, external_id=None)[source]

Send a Pass App invite for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after sending the invite.

Return type:

dict

delete_profile_photo(user_id=None, external_id=None)[source]

Delete the profile photo for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deleting the profile photo.

Return type:

dict

get_profile_photo(user_id=None, external_id=None, original=False)[source]

Retrieve the profile photo for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • original (Optional[bool]) – Whether to retrieve the original image.

Returns:

JSON response containing the profile photo information.

Return type:

bytes

upload_profile_photo(photo_path, user_id=None, external_id=None, overwrite=False)[source]

Upload a profile photo for an access user.

Parameters:
  • photo_path (str) – Path to the image file.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • overwrite (Optional[bool]) – Whether to overwrite an existing profile photo.

Returns:

JSON response after uploading the profile photo.

Return type:

dict

activate_remote_unlock_for_user(user_id=None, external_id=None)[source]

Activate remote unlock for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after activating remote unlock.

Return type:

dict

deactivate_remote_unlock_for_user(user_id=None, external_id=None)[source]

Deactivate remote unlock for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deactivating remote unlock.

Return type:

dict

set_start_date_for_user(start_date, user_id=None, external_id=None)[source]

Set the start date for an access user.

Parameters:
  • start_date (str) – The start date in string format.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after setting the start date.

Return type:

dict

Raises:

ValueError – If start_date is an empty string.

property request_manager: VerkadaRequestManager

Returns the request manager used by this client.

Functional wrappers

Access Control API client and functional wrappers for pykada.

The AccessControlClient covers door management, access users and groups, credentials (cards, BLE, licence plates, PIN, MFA), access levels, access events, and door exceptions through Verkada’s Access Control API.

Module-level functional wrappers share a single lazily-initialized AccessControlClient instance.

pykada.access_control.activate_access_card(card_id, user_id=None, external_id=None)[source]

Activate an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the activation.

Raises:

ValueError – If card_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.activate_ble_for_access_user(user_id=None, external_id=None)[source]

Activate BLE for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after activating BLE for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.activate_license_plate(license_plate_number, user_id=None, external_id=None)[source]

Activate a license plate for a user.

Parameters:
  • license_plate_number (str) – The license plate number to be activated.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the activation.

Raises:

ValueError – If license_plate_number is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.activate_remote_unlock_for_user(user_id=None, external_id=None)[source]

Activate remote unlock for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after activating remote unlock.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_access_schedule_event_to_access_level(access_level_id, start_time, end_time, weekday)[source]

Add an access schedule event to a specific access level.

The event details are provided in the payload. The door_status is fixed to “access_granted”.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • start_time (str) – Start time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

  • end_time (str) – End time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

  • weekday (str) – Enum for days of the week (e.g., “SU”).

Returns:

JSON response containing the created event information.

Raises:

ValueError – If access_level_id is empty, if start_time or end_time are not valid, or if weekday is invalid.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_card_to_user(user_id=None, external_id=None, active=False, card_number=None, card_number_hex=None, card_number_base36=None, facility_code='', card_type='')[source]

Add a card to a user.

Creates and adds an access card for a specified user (by user_id or external_id) and organization. The card object is passed in the request body as JSON. This request requires a facility code and exactly one of the following: card_number, card_number_hex, or card_number_base36. The ‘active’ field defaults to False.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • active (Optional[bool]) – Boolean flag indicating if the credential should be active. Defaults to False.

  • card_number (Optional[str]) – The card number used to grant or deny access.

  • card_number_hex (Optional[str]) – The card number in hexadecimal format.

  • card_number_base36 (Optional[str]) – The card number in base36 format.

  • facility_code (str) – The facility code used to grant or deny access.

  • card_type (str) – The type of card (e.g., Standard 26-bit Wiegand, HID 37-bit, etc.).

Returns:

JSON response containing the created credential information.

Raises:

ValueError – If not exactly one of card_number, card_number_hex, or card_number_base36 is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_exception_to_door_exception_calendar(calendar_id, exception)[source]

Add an Exception to a Door Exception Calendar.

Adds a new Exception to the Door Exception Calendar identified by calendar_id using the details provided in the exception object. The exception object must follow the expected schema and will be validated using the validate_door_exception function.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception (Dict[str, Any]) – A dictionary representing the new exception details.

Returns:

JSON response containing the created exception information.

Raises:

ValueError – If calendar_id is an empty string or if the exception object fails validation.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_license_plate_to_user(license_plate_number, active=False, name=None, user_id=None, external_id=None)[source]

Add a license plate to a user.

Parameters:
  • license_plate_number (str) – The license plate number to be added.

  • active (Optional[bool]) – Boolean flag indicating if the license plate should be active. Defaults to False.

  • name (Optional[str]) – Optional name associated with the license plate.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the added license plate details.

Raises:

ValueError – If license_plate_number is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_mfa_code_to_user(code, user_id=None, external_id=None)[source]

Add an MFA code to a user.

Parameters:
  • code (str) – The MFA code to be added.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the added MFA code details.

Raises:

ValueError – If code is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.add_user_to_access_group(group_id, external_id=None, user_id=None)[source]

Add a user to an access group. Exactly one of user_id or external_id must be provided.

Parameters:
  • group_id (str) – The unique identifier for the access group.

  • external_id (Optional[str]) – The external identifier for the user.

  • user_id (Optional[str]) – The internal user identifier.

Returns:

JSON response after adding the user to the access group.

Return type:

dict

Raises:

ValueError – If group_id is empty, or if not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.create_access_group(name)[source]

Create a new access group with the specified name.

Parameters:

name (str) – The name for the new access group.

Returns:

JSON response containing details of the created access group.

Return type:

dict

Raises:

ValueError – If name is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.create_access_level(name, access_groups=None, access_schedule_events=None, doors=None, sites=None)[source]

Create a new Access Level.

To use this API, you need an API Key having permission “Door Access Management” for all sites listed in ‘sites’ for the Access Level, and “Manage via API” must also be enabled for all doors listed in ‘doors’.

Body Parameters:
  • access_groups (List[str], required): IDs of Access Groups granted door access via this Access Level.

  • access_schedule_events (List[Dict[str, Any]], required): List of Access Schedule Events associated with this Access Level.
    Each event object should include:
    • access_schedule_event_id (str): Unique identifier for the Access Schedule Event.

    • door_status (str): Door status for Access Schedule Events (defaults to “access_granted”).

    • start_time (str): Start time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

    • end_time (str): End time of the event in HH:MM format (00:00 to 23:59, with leading zeros).

    • weekday (str): Enum for days of the week (e.g., “SU”).

  • doors (List[str], required): IDs of Doors accessible under this Access Level.

  • name (str, required): Name of the Access Level.

  • sites (List[str], required): IDs of Sites containing the Doors this Access Level applies to.

Parameters:
Returns:

JSON response containing the created Access Level information.

Raises:

ValueError – If name is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.create_door_exception_calendar(doors, exceptions, name)[source]

Create a new door exception calendar.

Parameters:
  • doors (List[str]) – A non-empty list of door IDs.

  • exceptions (List[Dict[str, Any]]) – A non-empty list of door exception objects.

  • name (str) – Name of the door exception calendar.

Returns:

JSON response containing the created door exception calendar information.

Raises:

ValueError – If any required field is missing or invalid.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.deactivate_access_card(card_id, user_id=None, external_id=None)[source]

Deactivate an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the deactivation.

Raises:

ValueError – If card_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.deactivate_ble_for_access_user(user_id=None, external_id=None)[source]

Deactivate BLE for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deactivating BLE for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.deactivate_license_plate(license_plate_number, user_id=None, external_id=None)[source]

Deactivate a license plate for a user.

Parameters:
  • license_plate_number (str) – The license plate number to be deactivated.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the deactivation.

Raises:

ValueError – If license_plate_number is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.deactivate_remote_unlock_for_user(user_id=None, external_id=None)[source]

Deactivate remote unlock for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deactivating remote unlock.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_access_card(card_id, user_id=None, external_id=None)[source]

Delete an access card for a user.

Parameters:
  • card_id (str) – The unique identifier for the access card.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If card_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_access_group(group_id)[source]

Delete an access group.

Parameters:

group_id (str) – The unique identifier for the access group.

Returns:

JSON response after deleting the access group.

Return type:

dict

Raises:

ValueError – If group_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_access_level(access_level_id)[source]

Delete an access level.

Parameters:

access_level_id (str) – The unique identifier for the access level to delete.

Returns:

The raw response content confirming deletion.

Raises:

ValueError – If access_level_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_access_schedule_event_on_access_level(access_level_id, event_id)[source]

Delete an access schedule event from a specific access level.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • event_id (str) – The unique identifier for the schedule event.

Returns:

The raw response content confirming deletion.

Raises:

ValueError – If access_level_id or event_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_door_exception_calendar(calendar_id)[source]

Delete a door exception calendar.

Parameters:

calendar_id (str) – The unique identifier for the door exception calendar to delete.

Returns:

JSON response confirming deletion.

Raises:

ValueError – If calendar_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_exception_on_door_exception_calendar(calendar_id, exception_id)[source]

Delete an exception from a door exception calendar.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception to delete.

Returns:

JSON response confirming deletion of the exception.

Raises:

ValueError – If calendar_id or exception_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_license_plate_from_user(license_plate_number, user_id=None, external_id=None)[source]

Delete a license plate from a user.

Parameters:
  • license_plate_number (str) – The license plate number to be deleted.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If license_plate_number is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_mfa_code_from_user(code, user_id=None, external_id=None)[source]

Delete an MFA code from a user.

Parameters:
  • code (str) – The MFA code to be deleted.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the deletion.

Raises:

ValueError – If code is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.delete_profile_photo(user_id=None, external_id=None)[source]

Delete the profile photo for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after deleting the profile photo.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_access_events(start_time=None, end_time=None, page_token=None, page_size=100, event_type=None, site_id=None, device_id=None, user_id=None)[source]

Retrieve access events based on various filters.

Parameters:
  • start_time (Optional[int]) – The start of the time range for requested events, as a Unix timestamp in seconds. Defaults to one hour ago from the current time if not provided.

  • end_time (Optional[int]) – The end of the time range for requested events, as a Unix timestamp in seconds. Defaults to the current time if not provided.

  • page_token (Optional[str]) – The pagination token used to fetch the next page of results.

  • page_size (Optional[int]) – The number of items returned in a single response (0 to 200). Defaults to 100.

  • event_type (Optional[List[str]]) – One or multiple comma-separated event type values.

  • site_id (Optional[str]) – One or multiple comma-separated site identifiers.

  • device_id (Optional[str]) – One or multiple comma-separated device identifiers.

  • user_id (Optional[str]) – One or multiple comma-separated user identifiers.

Returns:

JSON response containing access events matching the provided filters.

Raises:

ValueError – If page_size is not between 0 and 200.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_access_group(group_id)[source]

Retrieve a specific access group by its ID.

Parameters:

group_id (str) – The unique identifier for the access group.

Returns:

JSON response containing the access group details.

Return type:

dict

Raises:

ValueError – If group_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_access_groups()[source]

Retrieve all access groups.

Returns:

JSON response containing a list of access groups.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_access_level(access_level_id)[source]

Retrieve details for a specific access level.

Parameters:

access_level_id (str) – The unique identifier for the access level.

Returns:

JSON response containing the access level details.

Raises:

ValueError – If access_level_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_access_user(user_id=None, external_id=None)[source]

Retrieve access user by either user_id or external_id. Exactly one of user_id or external_id must be provided.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response containing access user details.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_all_access_levels()[source]

Retrieve all available access levels.

Returns:

JSON response containing all available access levels.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_all_access_users()[source]

Retrieve all access user information.

Returns:

JSON response containing access user information.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_all_door_exception_calendars(last_updated_at=None)[source]

Retrieve all available door exception calendars.

Parameters:

last_updated_at (Optional[int]) – Optional timestamp (Unix seconds) to filter calendars updated after this time.

Returns:

JSON response containing all available door exception calendars.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_door_exception_calendar(calendar_id)[source]

Retrieve a specific door exception calendar.

Parameters:

calendar_id (str) – The unique identifier for the door exception calendar.

Returns:

JSON response containing the door exception calendar details.

Raises:

ValueError – If calendar_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_doors(door_id_list=None, site_id_list=None)[source]

Retrieve door information.

This function sends a GET request to retrieve details for doors based on provided door IDs and/or site IDs.

Parameters:
  • door_id_list (Optional[List[Any]]) – A list of door IDs. If provided, these will be joined into a comma-separated string.

  • site_id_list (Optional[List[Any]]) – A list of site IDs. If provided, these will be joined into a comma-separated string.

Returns:

JSON response containing door information.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_exception_on_door_exception_calendar(calendar_id, exception_id)[source]

Retrieve a specific exception from a door exception calendar.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception.

Returns:

JSON response containing the exception details.

Raises:

ValueError – If calendar_id or exception_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.get_profile_photo(user_id=None, external_id=None, original=False)[source]

Retrieve the profile photo for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • original (Optional[bool]) – Whether to retrieve the original image.

Returns:

JSON response containing the profile photo information.

Return type:

bytes

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.remove_entry_code_for_user(user_id=None, external_id=None)[source]

Remove the entry code for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after removing the entry code for the access user.

Return type:

dict

Raises:

ValueError – If not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.remove_user_from_access_group(group_id, external_id=None, user_id=None)[source]

Remove a user from an access group. Exactly one of user_id or external_id must be provided.

Parameters:
  • group_id (str) – The unique identifier for the access group.

  • external_id (Optional[str]) – The external identifier for the user.

  • user_id (Optional[str]) – The internal user identifier.

Returns:

JSON response after removing the user from the access group.

Return type:

dict

Raises:

ValueError – If group_id is empty, or if not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.send_pass_app_invite_for_user(user_id=None, external_id=None)[source]

Send a Pass App invite for an access user.

Parameters:
  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after sending the invite.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.set_end_date_for_user(end_date, user_id=None, external_id=None)[source]

Set the end date for an access user. Exactly one of user_id or external_id must be provided.

Parameters:
  • end_date (str) – The end date in string format.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after setting the end date for the access user.

Return type:

dict

Raises:

ValueError – If end_date is an empty string or if not exactly one of user_id or external_id is provided.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.set_entry_code_for_user(entry_code, user_id=None, external_id=None, override=False)[source]

Set the entry code for an access user.

Parameters:
  • entry_code (str) – The entry code to set.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • override (Optional[bool]) – Whether to override an existing entry code.

Returns:

JSON response after setting the entry code.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.set_start_date_for_user(start_date, user_id=None, external_id=None)[source]

Set the start date for an access user.

Parameters:
  • start_date (str) – The start date in string format.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

Returns:

JSON response after setting the start date.

Return type:

dict

Raises:

ValueError – If start_date is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.unlock_door_as_admin(door_id)[source]

Unlock a door as an administrator.

This function sends a request to unlock the specified door without requiring user identification.

Parameters:

door_id (str) – The unique identifier for the door.

Returns:

JSON response containing the result of the unlock operation.

Raises:

ValueError – If door_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.unlock_door_as_user(door_id, user_id=None, external_id=None)[source]

Unlock a door as a user.

This function sends a request to unlock the specified door, using either the internal user_id or the external_id.

Parameters:
  • door_id (str) – The unique identifier for the door.

  • user_id (Optional[str]) – The internal user identifier (exactly one of user_id or external_id must be provided).

  • external_id (Optional[str]) – The external user identifier (exactly one of user_id or external_id must be provided).

Returns:

JSON response containing the result of the unlock operation.

Raises:

ValueError – If door_id is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.update_access_level(access_level_id, access_groups, access_schedule_events, doors, name, sites)[source]

Update an existing Access Level.

To use this API, you need an API Key having permission “Door Access Management” for all sites listed in ‘sites’ for the Access Level, and “Manage via API” must also be enabled for all doors listed in ‘doors’.

Parameters:
  • access_level_id (str) – The ID of the Access Level to be updated.

  • access_groups (List[str]) – List of Access Group IDs.

  • access_schedule_events (List[Dict[str, Any]]) – List of Access Schedule Event objects.

  • doors (List[str]) – List of Door IDs.

  • name (str) – Name for the Access Level.

  • sites (List[str]) – List of Site IDs.

Returns:

JSON response containing the updated Access Level information.

Raises:

ValueError – If access_level_id or name is an empty string.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.update_access_schedule_event_on_access_level(access_level_id, event_id, start_time, end_time, weekday)[source]

Update an access schedule event on a specific access level.

Parameters:
  • access_level_id (str) – The unique identifier for the access level.

  • event_id (str) – The unique identifier for the schedule event.

  • start_time (str) – Updated start time in HH:MM format.

  • end_time (str) – Updated end time in HH:MM format.

  • weekday (str) – Updated weekday enum (e.g., “SU”).

Returns:

JSON response containing the updated event information.

Raises:

ValueError – If any of the required identifiers or times are invalid.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.update_door_exception_calendar(doors, exceptions, name, calendar_id)[source]

Update an existing door exception calendar.

Parameters:
  • doors (List[str]) – A non-empty list of door IDs.

  • exceptions (List[Dict[str, Any]]) – A non-empty list of door exception objects.

  • name (str) – Updated name of the door exception calendar.

  • calendar_id (str) – The unique identifier of the calendar to update.

Returns:

JSON response containing the updated door exception calendar information.

Raises:

ValueError – If any required field is missing or invalid.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.update_exception_on_door_exception_calendar(calendar_id, exception_id, exception)[source]

Update an Exception on a Door Exception Calendar.

Updates the Exception identified by exception_id on the Door Exception Calendar identified by calendar_id using the new exception details provided as a single object.

The provided exception object must follow the expected schema, which is validated using the validate_door_exception function. For example, the object must include:

  • date (in YYYY-MM-DD format)

  • door_status (one of the allowed values)

  • For non-all-day exceptions, valid start_time and end_time (in HH:MM format)

  • If all_day_default is True, door_status must be "access_controlled", and start_time/end_time should be omitted or defaulted to "00:00" and "23:59", respectively.

  • Optional fields such as first_person_in, double_badge, and their corresponding group IDs, as well as an optional recurrence_rule object.

Parameters:
  • calendar_id (str) – The unique identifier for the door exception calendar.

  • exception_id (str) – The unique identifier for the exception to update.

  • exception (Dict[str, Any]) – A dictionary representing the new exception details.

Returns:

JSON response containing the updated exception information.

Raises:

ValueError – If any required parameter is missing or if the exception object fails validation.

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.upload_profile_photo(photo_path, user_id=None, external_id=None, overwrite=False)[source]

Upload a profile photo for an access user.

Parameters:
  • photo_path (str) – Path to the image file.

  • user_id (Optional[str]) – The internal user identifier.

  • external_id (Optional[str]) – The external user identifier.

  • overwrite (Optional[bool]) – Whether to overwrite an existing profile photo.

Returns:

JSON response after uploading the profile photo.

Return type:

dict

Note: This is a functional wrapper for its equivalent method in the AccessControlClient. It creates a new client instance on every call, making it best for single, convenient operations. For making multiple API calls, instantiate and use an AccessControlClient object directly for better performance.

pykada.access_control.validate_recurrence_rule(rr, idx=None)[source]

Validates a recurrence rule object based on the expected schema.

Parameters:
  • rr (Dict[str, Any]) – The recurrence rule object.

  • idx (Optional[int]) – Optional index for context.

Raises:

ValueError – If any required field is missing or invalid.

Return type:

None

pykada.access_control.validate_door_exception(exc, idx=None)[source]

Validates a door exception object based on the expected schema.

Parameters:
  • exc (Dict[str, Any]) – The door exception object.

  • idx (Optional[int]) – Optional index for context.

Raises:

ValueError – If any required field is missing or invalid.

Return type:

None