lockally

Lockally - the Ruby gem for the lockally control plane

The lockally control plane lets integrators and direct customers manage everything except actual mail data flow (which uses standard JMAP / IMAP / SMTP-submission against the data plane endpoints).

Authentication. All /v1/* endpoints require a Bearer API key in the Authorization header. Keys are formatted lk_live_<8-char-prefix>_<32-char-secret>. Generate the first key for a tenant via cmd/seed; subsequent keys via POST /v1/api-keys.

Errors. Failures return RFC 9457 application/problem+json documents.

Scopes. Each endpoint requires a specific scope on the presented key. Insufficient scope returns 403 with the required scope name in detail.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.0
  • Package version: 0.1.0
  • Generator version: 7.23.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build lockally.gemspec

Then either install the gem locally:

gem install ./lockally-0.1.0.gem

(for development, run gem install --dev ./lockally-0.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'lockally', '~> 0.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'lockally', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'lockally'

# Setup authorization
Lockally.configure do |config|
  # Configure Bearer authorization (lk_live_<prefix>_<secret>): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = Lockally::AddOnsApi.new
name = 'name_example' # String | Add-on key

begin
  #Activate an add-on
  result = api_instance.activate_add_on(name)
  p result
rescue Lockally::ApiError => e
  puts "Exception when calling AddOnsApi->activate_add_on: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.lockally.com

Class Method HTTP request Description
Lockally::AddOnsApi activate_add_on POST /v1/add-ons/name/activate Activate an add-on
Lockally::AddOnsApi cancel_add_on POST /v1/add-ons/name/cancel Cancel an add-on
Lockally::AddOnsApi get_add_on_status GET /v1/add-ons/name Get add-on status
Lockally::AddOnsApi list_add_ons GET /v1/add-ons List add-ons
Lockally::AdminApi v1_admin_login_post POST /v1/admin/login Tenant-admin email+password login
Lockally::AdminApi v1_admin_logout_post POST /v1/admin/logout Invalidate the current admin session
Lockally::AdminApi v1_admin_me_get GET /v1/admin/me Get the current admin + tenant
Lockally::AdminsApi v1_admins_get GET /v1/admins List tenant admins
Lockally::AdminsApi v1_admins_id_delete DELETE /v1/admins/id Delete an admin
Lockally::AdminsApi v1_admins_id_patch PATCH /v1/admins/id Update an admin
Lockally::AdminsApi v1_admins_post POST /v1/admins Invite a new admin
Lockally::AgentsApi v1_api_keys_key_id_mailboxes_get GET /v1/api-keys/keyID/mailboxes List a key's mailbox grants
Lockally::AgentsApi v1_api_keys_key_id_mailboxes_mailbox_id_delete DELETE /v1/api-keys/keyID/mailboxes/mailboxID Revoke a mailbox grant
Lockally::AgentsApi v1_api_keys_key_id_mailboxes_post POST /v1/api-keys/keyID/mailboxes Grant a mailbox to a key
Lockally::AgentsApi v1_auth_whoami_get GET /v1/auth/whoami Introspect the calling credentials
Lockally::AgentsApi v1_contacts_lookup_get GET /v1/contacts/lookup Who is this sender?
Lockally::AgentsApi v1_inboxes_get GET /v1/inboxes List granted inboxes
Lockally::AgentsApi v1_inboxes_mailbox_messages_post POST /v1/inboxes/mailbox/messages Start a new conversation (agent stream)
Lockally::AgentsApi v1_inboxes_mailbox_threads_get GET /v1/inboxes/mailbox/threads List conversation threads
Lockally::AgentsApi v1_threads_thread_id_get GET /v1/threads/threadID Get a whole conversation
Lockally::AgentsApi v1_threads_thread_id_messages_message_id_attachments_idx_get GET /v1/threads/threadID/messages/messageID/attachments/idx Download an attachment
Lockally::AgentsApi v1_threads_thread_id_messages_message_id_get GET /v1/threads/threadID/messages/messageID Get one message with body
Lockally::AgentsApi v1_threads_thread_id_messages_message_id_read_post POST /v1/threads/threadID/messages/messageID/read Mark read/unread
Lockally::AgentsApi v1_threads_thread_id_reply_post POST /v1/threads/threadID/reply Reply in-thread (agent stream)
Lockally::AiApi v1_ai_config_get GET /v1/ai-config Read the tenant's AI configuration
Lockally::AiApi v1_ai_config_put PUT /v1/ai-config Configure the AI tier
Lockally::AiApi v1_billing_ai_units_checkout_post POST /v1/billing/ai-units/checkout Buy prepaid AI units
Lockally::AiApi v1_threads_thread_id_classify_post POST /v1/threads/threadID/classify LLM-classify a thread
Lockally::AliasesApi v1_aliases_address_delete DELETE /v1/aliases/address Delete an alias
Lockally::AliasesApi v1_aliases_get GET /v1/aliases List aliases
Lockally::AliasesApi v1_aliases_post POST /v1/aliases Create an alias
Lockally::ApiKeysApi v1_api_keys_get GET /v1/api-keys List API keys
Lockally::ApiKeysApi v1_api_keys_id_delete DELETE /v1/api-keys/id Revoke an API key
Lockally::ApiKeysApi v1_api_keys_post POST /v1/api-keys Create an API key
Lockally::BillingApi create_billing_checkout POST /v1/billing/checkout Create a plan checkout session
Lockally::BillingApi create_units_checkout POST /v1/billing/units/checkout Create a send-units checkout session
Lockally::BillingApi get_billing GET /v1/billing Get billing status
Lockally::CalendarsApi add_calendar_member POST /v1/calendars/id/members Add a member to a calendar
Lockally::CalendarsApi create_calendar POST /v1/calendars Create a calendar
Lockally::CalendarsApi create_calendar_event POST /v1/calendars/id/events Create an event in a calendar
Lockally::CalendarsApi create_calendar_integration POST /v1/calendar-integrations Create a calendar integration
Lockally::CalendarsApi delete_calendar DELETE /v1/calendars/id Delete a calendar
Lockally::CalendarsApi delete_calendar_event DELETE /v1/calendars/id/events/eventId Delete a calendar event
Lockally::CalendarsApi delete_calendar_integration DELETE /v1/calendar-integrations/id Delete a calendar integration
Lockally::CalendarsApi get_calendar GET /v1/calendars/id Get a calendar
Lockally::CalendarsApi get_calendar_policies GET /v1/calendar-policies Get calendar policies
Lockally::CalendarsApi get_calendar_security GET /v1/calendar-security Get calendar security overview
Lockally::CalendarsApi list_calendar_events GET /v1/calendars/id/events List events in a calendar
Lockally::CalendarsApi list_calendar_integrations GET /v1/calendar-integrations List calendar integrations
Lockally::CalendarsApi list_calendar_members GET /v1/calendars/id/members List calendar members
Lockally::CalendarsApi list_calendars GET /v1/calendars List calendars
Lockally::CalendarsApi remove_calendar_member DELETE /v1/calendars/id/members/memberId Remove a member from a calendar
Lockally::CalendarsApi sync_calendar_integration POST /v1/calendar-integrations/id/sync Trigger sync for a calendar integration
Lockally::CalendarsApi update_calendar PATCH /v1/calendars/id Update a calendar
Lockally::CalendarsApi update_calendar_event PATCH /v1/calendars/id/events/eventId Update a calendar event
Lockally::CalendarsApi update_calendar_integration PATCH /v1/calendar-integrations/id Update a calendar integration
Lockally::CalendarsApi update_calendar_member PATCH /v1/calendars/id/members/memberId Update a calendar member's role
Lockally::CalendarsApi update_calendar_policies PATCH /v1/calendar-policies Update calendar policies
Lockally::ContactListsApi add_contact_list_member POST /v1/contact-lists/id/members Add a member to a contact list
Lockally::ContactListsApi create_contact_list POST /v1/contact-lists Create a contact list
Lockally::ContactListsApi delete_contact_list DELETE /v1/contact-lists/id Delete a contact list
Lockally::ContactListsApi get_contact_list GET /v1/contact-lists/id Get a contact list with members
Lockally::ContactListsApi list_contact_lists GET /v1/contact-lists List contact lists
Lockally::ContactListsApi remove_contact_list_member DELETE /v1/contact-lists/id/members/contactId Remove a member from a contact list
Lockally::ContactListsApi update_contact_list PATCH /v1/contact-lists/id Update a contact list
Lockally::ContactsApi create_contact POST /v1/contacts Create a contact
Lockally::ContactsApi delete_contact DELETE /v1/contacts/id Delete a contact
Lockally::ContactsApi get_contact GET /v1/contacts/id Get a contact
Lockally::ContactsApi get_contact_lists GET /v1/contacts/id/lists Get lists a contact belongs to
Lockally::ContactsApi list_contacts GET /v1/contacts List contacts
Lockally::ContactsApi update_contact PATCH /v1/contacts/id Update a contact
Lockally::DashboardApi get_audit_summary GET /v1/audit-summary Audit summary for the dashboard
Lockally::DashboardApi get_domains_status GET /v1/domains/status Domain health status for the dashboard
Lockally::DashboardApi get_integrations_summary GET /v1/integrations-summary Integrations summary for the dashboard
Lockally::DashboardApi get_security GET /v1/security Security overview for the dashboard
Lockally::DashboardApi get_storage GET /v1/storage Storage usage for the dashboard
Lockally::DashboardApi get_tenant_health GET /v1/health Full tenant health report
Lockally::DashboardApi get_user_insights GET /v1/user-insights User insights for the dashboard
Lockally::DirectoryApi get_directory_activity GET /v1/directory-activity Get recent directory activity
Lockally::DirectoryApi get_directory_permissions GET /v1/directory-permissions Get directory permission settings
Lockally::DirectoryApi get_directory_stats GET /v1/directory-stats Get directory statistics
Lockally::DirectoryApi get_gal_settings GET /v1/gal-settings Get Global Address List settings
Lockally::DirectoryApi rebuild_gal_index POST /v1/gal-settings/rebuild-index Rebuild the GAL search index
Lockally::DirectoryApi sync_gal POST /v1/gal-settings/sync Sync GAL with external directory sources
Lockally::DirectoryApi update_directory_permissions PATCH /v1/directory-permissions Update directory permission settings
Lockally::DirectoryApi update_gal_settings PATCH /v1/gal-settings Update GAL settings
Lockally::DistributionListsApi create_distribution_list POST /v1/distribution-lists Create a distribution list
Lockally::DistributionListsApi delete_distribution_list DELETE /v1/distribution-lists/address Delete a distribution list
Lockally::DistributionListsApi get_distribution_list GET /v1/distribution-lists/address Get a distribution list
Lockally::DistributionListsApi list_distribution_lists GET /v1/distribution-lists List distribution lists
Lockally::DistributionListsApi replace_distribution_list_members PUT /v1/distribution-lists/address/members Replace distribution list members
Lockally::DomainsApi v1_domains_domain_delete DELETE /v1/domains/domain Delete a domain
Lockally::DomainsApi v1_domains_domain_get GET /v1/domains/domain Get a domain
Lockally::DomainsApi v1_domains_domain_verify_post POST /v1/domains/domain/verify Force-poll DNS verification
Lockally::DomainsApi v1_domains_get GET /v1/domains List domains
Lockally::DomainsApi v1_domains_post POST /v1/domains Register a domain
Lockally::DraftsApi v1_drafts_draft_id_approve_post POST /v1/drafts/draftID/approve Approve a pending draft (human)
Lockally::DraftsApi v1_drafts_draft_id_cancel_post POST /v1/drafts/draftID/cancel Withdraw a pending draft
Lockally::DraftsApi v1_drafts_draft_id_get GET /v1/drafts/draftID Get a draft
Lockally::DraftsApi v1_drafts_draft_id_reject_post POST /v1/drafts/draftID/reject Reject a pending draft (human)
Lockally::DraftsApi v1_drafts_get GET /v1/drafts List drafts
Lockally::DraftsApi v1_inboxes_mailbox_drafts_post POST /v1/inboxes/mailbox/drafts Propose a new conversation as a draft
Lockally::DraftsApi v1_threads_thread_id_drafts_post POST /v1/threads/threadID/drafts Propose a reply as a draft
Lockally::EncryptionApi batch_lookup_public_keys GET /v1/encryption/keys/lookup Batch-lookup public keys by email
Lockally::EncryptionApi create_encryption_key POST /v1/encryption/keys Upload an encryption key pair
Lockally::EncryptionApi create_encryption_recovery POST /v1/encryption/recovery Store an encryption recovery blob
Lockally::EncryptionApi get_encryption_key GET /v1/encryption/keys/email Get encryption key for a mailbox
Lockally::EncryptionApi rotate_encryption_key POST /v1/encryption/keys/rotate Rotate an encryption key
Lockally::HealthApi healthz_get GET /healthz Liveness check
Lockally::IpPoolsApi create_dedicated_ip_request POST /v1/dedicated-ip-requests Request a dedicated IP
Lockally::IpPoolsApi get_ip_assignment GET /v1/ip-assignment Get current IP assignment
Lockally::IpPoolsApi list_dedicated_ip_requests GET /v1/dedicated-ip-requests List dedicated IP requests
Lockally::MailboxesApi add_shared_member POST /v1/mailboxes/email/members Add a shared mailbox member
Lockally::MailboxesApi list_shared_members GET /v1/mailboxes/email/members List shared mailbox members
Lockally::MailboxesApi remove_shared_member DELETE /v1/mailboxes/email/members/memberEmail Remove a shared mailbox member
Lockally::MailboxesApi v1_mailboxes_email_delete DELETE /v1/mailboxes/email Soft-delete a mailbox
Lockally::MailboxesApi v1_mailboxes_email_export_download_get GET /v1/mailboxes/email/export/download Download a previously-issued mailbox export
Lockally::MailboxesApi v1_mailboxes_email_export_post POST /v1/mailboxes/email/export Request a mailbox export
Lockally::MailboxesApi v1_mailboxes_email_get GET /v1/mailboxes/email Get a mailbox
Lockally::MailboxesApi v1_mailboxes_email_patch PATCH /v1/mailboxes/email Update a mailbox
Lockally::MailboxesApi v1_mailboxes_email_vacation_delete DELETE /v1/mailboxes/email/vacation Remove the vacation responder
Lockally::MailboxesApi v1_mailboxes_email_vacation_get GET /v1/mailboxes/email/vacation Get the vacation responder
Lockally::MailboxesApi v1_mailboxes_email_vacation_put PUT /v1/mailboxes/email/vacation Set the vacation responder
Lockally::MailboxesApi v1_mailboxes_get GET /v1/mailboxes List mailboxes
Lockally::MailboxesApi v1_mailboxes_post POST /v1/mailboxes Create a mailbox
Lockally::MailboxesApi v1_vacation_get GET /v1/vacation List all vacation responders
Lockally::MigrationsApi cancel_migration POST /v1/migrations/id/cancel Cancel a running migration
Lockally::MigrationsApi check_migration_dns GET /v1/migrations/id/dns-check Check DNS readiness for cutover
Lockally::MigrationsApi create_migration POST /v1/migrations Create a migration
Lockally::MigrationsApi create_migration_credential POST /v1/migrations/credentials Store a migration credential
Lockally::MigrationsApi delete_migration DELETE /v1/migrations/id Delete a migration
Lockally::MigrationsApi delete_migration_credential DELETE /v1/migrations/credentials/id Delete a migration credential
Lockally::MigrationsApi delta_sync_migration POST /v1/migrations/id/delta-sync Run a delta sync
Lockally::MigrationsApi discover_migration POST /v1/migrations/id/discover Discover source mailboxes
Lockally::MigrationsApi final_sync_migration POST /v1/migrations/id/final-sync Run the final sync before cutover
Lockally::MigrationsApi get_migration GET /v1/migrations/id Get a migration
Lockally::MigrationsApi get_migration_progress GET /v1/migrations/id/progress Get migration progress
Lockally::MigrationsApi list_migration_credentials GET /v1/migrations/credentials List migration credentials
Lockally::MigrationsApi list_migration_events GET /v1/migrations/id/events List migration events
Lockally::MigrationsApi list_migration_mailboxes GET /v1/migrations/id/mailboxes List migration mailboxes
Lockally::MigrationsApi list_migrations GET /v1/migrations List migrations
Lockally::MigrationsApi map_migration POST /v1/migrations/id/map Map source to destination mailboxes
Lockally::MigrationsApi retry_migration POST /v1/migrations/id/retry Retry a failed or cancelled migration
Lockally::MigrationsApi start_migration POST /v1/migrations/id/start Start the migration
Lockally::MigrationsApi update_migration PATCH /v1/migrations/id Update a migration
Lockally::MigrationsApi update_migration_mailbox PATCH /v1/migrations/id/mailboxes/mbxId Update a migration mailbox
Lockally::MigrationsApi validate_migration POST /v1/migrations/id/validate Validate migrated data
Lockally::ResourcesApi create_resource POST /v1/resources Create a resource
Lockally::ResourcesApi delete_resource DELETE /v1/resources/id Delete a resource
Lockally::ResourcesApi get_resource GET /v1/resources/id Get a resource
Lockally::ResourcesApi list_resources GET /v1/resources List resources
Lockally::ResourcesApi update_resource PATCH /v1/resources/id Update a resource
Lockally::SendApi v1_messages_get GET /v1/messages List outbound messages
Lockally::SendApi v1_messages_id_delete DELETE /v1/messages/id Cancel a scheduled send
Lockally::SendApi v1_messages_id_get GET /v1/messages/id Get message status
Lockally::SendApi v1_messages_stats_get GET /v1/messages/stats Aggregate delivery stats
Lockally::SendApi v1_send_batch_post POST /v1/send/batch Send a batch of emails
Lockally::SendApi v1_send_post POST /v1/send Send an email
Lockally::SignupApi signup POST /v1/signup Sign up a new tenant
Lockally::SuppressionsApi v1_suppressions_email_delete DELETE /v1/suppressions/email Remove a suppression
Lockally::SuppressionsApi v1_suppressions_email_get GET /v1/suppressions/email Check whether an address is suppressed
Lockally::SuppressionsApi v1_suppressions_get GET /v1/suppressions List suppressed recipients
Lockally::SuppressionsApi v1_suppressions_post POST /v1/suppressions Add a suppression
Lockally::TemplatesApi v1_templates_get GET /v1/templates List templates
Lockally::TemplatesApi v1_templates_id_delete DELETE /v1/templates/id Delete a template
Lockally::TemplatesApi v1_templates_id_get GET /v1/templates/id Get a template
Lockally::TemplatesApi v1_templates_id_put PUT /v1/templates/id Update a template
Lockally::TemplatesApi v1_templates_post POST /v1/templates Create a template
Lockally::TenantApi v1_tenant_get GET /v1/tenant Get the calling tenant
Lockally::TenantApi v1_usage_get GET /v1/usage Usage snapshot
Lockally::TestApi v1_test_inbound_post POST /v1/test/inbound Simulate an inbound email (test keys only)
Lockally::UsersApi create_user POST /v1/users Create a user
Lockally::UsersApi delete_user DELETE /v1/users/id Delete a user
Lockally::UsersApi get_user GET /v1/users/id Get a user
Lockally::UsersApi list_users GET /v1/users List users
Lockally::UsersApi update_user PATCH /v1/users/id Update a user
Lockally::WebhooksApi v1_webhooks_get GET /v1/webhooks List webhooks
Lockally::WebhooksApi v1_webhooks_id_delete DELETE /v1/webhooks/id Delete a webhook
Lockally::WebhooksApi v1_webhooks_id_patch PATCH /v1/webhooks/id Update a webhook
Lockally::WebhooksApi v1_webhooks_post POST /v1/webhooks Create a webhook

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (lk_live__)

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api.lockally.com/oauth/authorize
  • Scopes:
    • inboxes:read: Read agent-accessible mailboxes and threads
    • inboxes:write: Send and act on agent-accessible mailboxes