tenants

Import tenants from CSV file

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

Query parameters

sourcestring nullable

Headers

X-Kater-CLI-IDstring nullable

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

Changed in 2 of the 11 revisions of this API.318

  • bef1f3e205dd34See the full diff
    • response property errors list-of-types was widened by adding types array to media type application/json of response 400

      response-property-list-of-types-widened

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

      response-property-list-of-types-widened

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

      response-property-list-of-types-widened

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

      new-optional-request-parameter

    • added the new optional query request parameter source

      new-optional-request-parameter

    • added the new optional request property attribute_columns

      new-optional-request-property

    • added the optional property attribute_errors to the response with the 200 status

      response-optional-property-added

    This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 5f4f08ff655614See the full diff
    • removed the optional property detail from the response with the 422 status

      response-optional-property-removed

    • added the optional property errors to the response with the 422 status

      response-optional-property-added

    • added the required property code to the response with the 422 status

      response-required-property-added

    • added the required property message to the response with the 422 status

      response-required-property-added

    • added the required property status to the response with the 422 status

      response-required-property-added

    This revision also has 7 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog