/** * Represents an unmanaged Access Grant. Unmanaged Access Grants do not have client sessions, instant keys, customization profiles, or keys. */ export type UnmanagedAccessGrant = { /** * ID of the Access Grant. */ access_grant_id: string; /** * IDs of the access methods created for the Access Grant. */ access_method_ids: Array; /** * Date and time at which the Access Grant was created. */ created_at: string; /** * Display name of the Access Grant. */ display_name: string; /** * Date and time at which the Access Grant ends. */ ends_at: string | null; /** * Errors associated with the [access grant](https://docs.seam.co/use-cases/granting-access). */ errors: Array< /** * Indicates that Seam could not create one or more of the requested access methods for the access grant. */ { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'cannot_create_requested_access_methods'; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * IDs of the devices that did not receive an access code at grant creation. Use these to identify which specific devices failed when the message reports a partial failure. */ missing_device_ids?: Array | undefined; }>; /** * @deprecated Use `space_ids`. */ location_ids: Array; /** * Name of the Access Grant. If not provided, the display name will be computed. */ name: string | null; /** * List of pending mutations for the access grant. This shows updates that are in progress. */ pending_mutations: Array< /** * Seam is in the process of updating the devices/spaces associated with this access grant. */ { /** * Date and time at which the mutation was created. */ created_at: string; /** * Previous location configuration. */ from: { /** * Previous device IDs where access codes existed. */ device_ids: Array; }; /** * Detailed description of the mutation. */ message: string; /** * Mutation code to indicate that Seam is in the process of updating the spaces (devices) associated with this access grant. */ mutation_code: 'updating_spaces'; /** * New location configuration. */ to: { /** * Common code key to ensure PIN code reuse across devices. */ common_code_key?: string | null | undefined; /** * New device IDs where access codes should be created. */ device_ids: Array; }; } /** * Seam is in the process of updating the access times for this access grant. */ | { /** * IDs of the access methods being updated. */ access_method_ids: Array; /** * Date and time at which the mutation was created. */ created_at: string; /** * Previous access time configuration. */ from: { /** * Previous end time for access. */ ends_at: string | null; /** * Previous start time for access. */ starts_at: string | null; }; /** * Detailed description of the mutation. */ message: string; /** * Mutation code to indicate that Seam is in the process of updating the access times for this access grant. */ mutation_code: 'updating_access_times'; /** * New access time configuration. */ to: { /** * New end time for access. */ ends_at: string | null; /** * New start time for access. */ starts_at: string | null; }; }>; /** * Access methods that the user requested for the Access Grant. */ requested_access_methods: Array<{ /** * Specific PIN code to use for this access method. Only applicable when mode is 'code'. */ code?: string | undefined; /** * IDs of the access methods created for the requested access method. */ created_access_method_ids: Array; /** * Date and time at which the requested access method was added to the Access Grant. */ created_at: string; /** * Display name of the access method. */ display_name: string; /** * Maximum number of times the instant key can be used. Only applicable when mode is 'mobile_key'. Defaults to 1 if not specified. */ instant_key_max_use_count?: number | undefined; /** * Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. */ mode: 'code' | 'card' | 'mobile_key' | 'cloud_key'; }>; /** * Reservation key for the access grant. */ reservation_key?: string | undefined; /** * IDs of the spaces to which the Access Grant gives access. */ space_ids: Array; /** * Date and time at which the Access Grant starts. */ starts_at: string; /** * ID of user identity to which the Access Grant gives access. */ user_identity_id?: string | undefined; /** * Warnings associated with the [access grant](https://docs.seam.co/use-cases/granting-access). */ warnings: Array< /** * Indicates that the [access grant](https://docs.seam.co/use-cases/granting-access) is being deleted. */ { /** * Date and time at which Seam created the warning. */ created_at: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'being_deleted'; } /** * Indicates that the access grant should have access to more locations than it currently does. Access methods are being created for the missing locations. */ | { /** * Date and time at which Seam created the warning. */ created_at: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'underprovisioned_access'; } /** * Indicates that the access grant has access to locations it should not have. Access methods are being removed from the extra locations. */ | { /** * Date and time at which Seam created the warning. */ created_at: string; /** * Devices whose access codes could not be revoked during reconciliation. Present when the provider does not support revoking an offline access code (e.g. Dormakaba oracode with exhausted override budget). */ failed_devices?: Array<{ /** * Device whose access code could not be revoked. */ device_id: string; /** * Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). */ error_code: string; /** * Human-readable description of why revocation failed. */ message: string; }> | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'overprovisioned_access'; } /** * Indicates that the access times for this [access grant](https://docs.seam.co/use-cases/granting-access) are being updated. */ | { /** * IDs of the access methods being updated. */ access_method_ids: Array; /** * Date and time at which Seam created the warning. */ created_at: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'updating_access_times'; } /** * Indicates that the requested PIN code was already in use on a device, so a different code was assigned. */ | { /** * Date and time at which Seam created the warning. */ created_at: string; /** * ID of the device where the requested code was unavailable. */ device_id: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * The new PIN code that was assigned instead. */ new_code: string; /** * The originally requested PIN code that was unavailable. */ original_code: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'requested_code_unavailable'; } /** * Indicates that a device in the access grant does not support access codes and was excluded from code materialization. */ | { /** * Date and time at which Seam created the warning. */ created_at: string; /** * ID of the device that does not support access codes. */ device_id: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'device_does_not_support_access_codes'; } /** * Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints. */ | { /** * Date and time at which Seam created the warning. */ created_at: string; /** * ID of the device whose time constraints the access grant violates. */ device_id: string; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Specific reason why the grant's times are not programmable on the device. */ reason: 'duration_exceeds_max' | 'times_do_not_match_slots' | 'ongoing_not_supported'; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'device_time_constraints_violated'; }>; /** * ID of the Seam workspace associated with the Access Grant. */ workspace_id: string; };