tenants

Import tenants from CSV file

Changed on

Import tenants from a CSV file using upsert semantics.

Expected CSV format:

  • tenant_key (required): Unique tenant identifier
  • tenant_name (optional): Human-readable name
  • group_names (optional): Comma-separated list of group names
  • Additional columns can be mapped to attributes via attribute_columns

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

Optionally processes attribute columns: values are validated against attributes.yaml, stored additively, and validation errors are non-fatal.

RLS: Filtered to current client (ClientRLSDB).

Raises: ValidationError: If CSV format is invalid (400) TenantCreationNotAllowedError: If tenancy type is NONE (400)

post/api/v1/tenants/import/csv

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 multipart/form-data

attribute_columnsstring nullable

JSON mapping: attribute_name -> csv_column_name

filestring binary required

CSV file with tenant data

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 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