tenants

Import tenants from warehouse table

Changed on

Import tenants from a warehouse table using upsert semantics.

Creates new tenants and updates existing ones with new name/groups. Groups are added additively (not replaced).

Streams data from the warehouse in batches to handle large datasets without loading everything into memory.

For tenants with groups, groups are aggregated per tenant key and auto-created if they don't exist.

RLS: Filtered to current client (ClientRLSDB).

Raises: ConnectionNotFoundError: If the connection doesn't exist (404) TenantCreationNotAllowedError: If tenancy type is NONE (400)

post/api/v1/tenants/import/warehouse

Request

  • Base URL
    https://api.kater.ai
  • Auth
    • HTTP bearer
    • or API key in header X-API-Key

Query parameters

sourcestring nullable

Headers

X-Kater-CLI-IDstring nullable

Request body

attribute_columnsobject nullable

Mapping of attribute names to warehouse column names for attribute import

connection_idstring uuid required

Warehouse connection ID to query

databasestring required

Database name containing the tenant table

schemastring required

Schema name containing the tenant table

tablestring required

Table name containing tenant data

tenant_group_columnstring nullable

Column name for tenant group (optional)

tenant_key_columnstring required

Column name for tenant key

tenant_name_columnstring nullable

Column name for tenant display name (optional)

Response

Successful Response

groups_createdstring[]

Groups that were auto-created

total_foundinteger required

Unique tenant keys found in source

total_importedinteger required

New tenants created

total_updatedinteger required

Existing tenants updated

Changes

    • breaking

      response property errors list-of-types was widened by adding types array to media type application/json of response 400

    • breaking

      response property errors list-of-types was widened by adding types array to media type application/json of response 401

    • breaking

      response property errors list-of-types was widened by adding types array to media type application/json of response 404

    • breaking

      response property errors list-of-types was widened by adding types array to media type application/json of response 422

    • info

      added the new optional header request parameter X-Kater-CLI-ID

    • info

      added the new optional query request parameter source

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status