> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tarvah.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Client Onboard

> Onboard a new client from an exported onboarding JSON package — creates semantic model, VDM(s), dashboards, and client registry entry

Full client onboarding from a self-contained JSON package. Creates all resources (semantic model, VDMs, dashboards with experiments and facades) and registers the client as `ACTIVE`.

<Note>
  This endpoint supports both **API key authentication** (`Authorization: Bearer trvh_sdk_...`) and **browser session authentication** (`POST /v1/sdk/client/onboard/{userId}` with CSRF token).
</Note>

## Request Body

The request body is an onboarding JSON package — the same format produced by the **Download** button in the Client Onboarding UI.

<ParamField body="clientId" type="string" required>
  Unique client identifier (e.g., `"DEF"`). Will be uppercased automatically.
</ParamField>

<ParamField body="clientName" type="string" required>
  Display name for the client (e.g., `"Client DEF Corp"`).
</ParamField>

<ParamField body="connectionId" type="string" required>
  DataBridge connection ID for the client's data source (e.g., `"D2026A00042"`).
</ParamField>

<ParamField body="coreModelId" type="string" required>
  The `modelId` of the core semantic model to inherit from. Must exist on the target platform.
</ParamField>

<ParamField body="externalIdKey" type="string">
  Key name used for row-level security user mapping (e.g., `"CRD_ALPHA_CORE"`).
</ParamField>

<ParamField body="vdm" type="array" required>
  Array of VDM configurations. At least one is required.

  <Expandable title="VDM object">
    <ParamField body="name" type="string">VDM display name.</ParamField>
    <ParamField body="description" type="string">Optional description.</ParamField>
    <ParamField body="vendor" type="string" default="SNOWFLAKE">Database vendor.</ParamField>
    <ParamField body="sourceType" type="string" default="bi_semantic_model">Source type.</ParamField>
    <ParamField body="selectedColumns" type="array">Column selection configuration.</ParamField>
    <ParamField body="joinConfiguration" type="array">Table join definitions.</ParamField>
    <ParamField body="measureConfiguration" type="array">Measure definitions.</ParamField>
    <ParamField body="expressionConfiguration" type="array">Calculated expression definitions.</ParamField>
    <ParamField body="timeSeriesConfiguration" type="array">Time series configuration.</ParamField>
    <ParamField body="rankingConfiguration" type="array">Ranking configuration.</ParamField>
    <ParamField body="filterConfiguration" type="array">Filter configuration.</ParamField>
    <ParamField body="arithmeticConfiguration" type="array">Arithmetic configuration.</ParamField>
    <ParamField body="transformationConfiguration" type="array">Transformation configuration.</ParamField>
    <ParamField body="securityEnabled" type="boolean" default={false}>Enable row-level security on this VDM.</ParamField>
    <ParamField body="securityBindings" type="object">Security binding definitions.</ParamField>
    <ParamField body="userScopeTable" type="object">User-to-scope mapping table configuration.</ParamField>
    <ParamField body="scopeDefnTable" type="object">Scope definition table configuration.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="dashboards" type="array">
  Array of dashboard definitions. Each dashboard creates experiments and a facade.

  <Expandable title="dashboard object">
    <ParamField body="name" type="string">Dashboard display name.</ParamField>
    <ParamField body="description" type="string">Optional description.</ParamField>
    <ParamField body="templateType" type="string">Layout template type (e.g., `"realEstate"`).</ParamField>
    <ParamField body="layoutTemplateName" type="string">Exact layout template name. Takes priority over `templateType`.</ParamField>
    <ParamField body="category" type="array">Dashboard categories (e.g., `["BI"]`).</ParamField>
    <ParamField body="tags" type="array">Dashboard tags.</ParamField>

    <ParamField body="sections" type="array">
      Array of dashboard sections (same format as [Import Dashboard](/api-reference/import-dashboard) sections).

      <Expandable title="section object">
        <ParamField body="name" type="string">Section name (appears as category tab label).</ParamField>
        <ParamField body="topSection" type="boolean" default={false}>Render in the always-visible top section.</ParamField>
        <ParamField body="category" type="boolean" default={false}>Appear as a navigable category tab.</ParamField>

        <ParamField body="charts" type="array" required>
          Array of chart definitions (same format as [Import Dashboard](/api-reference/import-dashboard) charts).
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="security" type="object">
  Global security settings.

  <Expandable title="security properties">
    <ParamField body="enabled" type="boolean" default={true}>
      Enable row-level security for the client model.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request completed.
</ResponseField>

<ResponseField name="status" type="string">
  `"COMPLETED"` for new clients, `"ALREADY_EXISTS"` if the client was already onboarded.
</ResponseField>

<ResponseField name="client" type="object">
  The created (or existing) client registry record.

  <Expandable title="client properties">
    <ResponseField name="clientId" type="string">Client ID</ResponseField>
    <ResponseField name="clientName" type="string">Client display name</ResponseField>
    <ResponseField name="connectionId" type="string">DataBridge connection ID</ResponseField>
    <ResponseField name="modelId" type="string">Client semantic model ID</ResponseField>
    <ResponseField name="vdmIds" type="array">Created VDM IDs</ResponseField>
    <ResponseField name="facadeIds" type="array">Created facade IDs</ResponseField>
    <ResponseField name="experimentIds" type="array">Created experiment IDs</ResponseField>
    <ResponseField name="coreModelId" type="string">Parent core model ID</ResponseField>
    <ResponseField name="status" type="string">`ACTIVE` or `FAILED`</ResponseField>
    <ResponseField name="onboardedBy" type="string">User who performed onboarding</ResponseField>
    <ResponseField name="onboardedDate" type="string">ISO timestamp</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash API Key Auth theme={null}
  curl -X POST https://<your-instance>/v1/sdk/client/onboard \
    -H "Authorization: Bearer trvh_sdk_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "clientId": "DEF",
      "clientName": "Client DEF Corp",
      "connectionId": "D2026A00042",
      "externalIdKey": "CRD_ALPHA_CORE",
      "coreModelId": "SM2026A00001",
      "vdm": [
        {
          "name": "Main VDM",
          "vendor": "SNOWFLAKE",
          "selectedColumns": [],
          "joinConfiguration": [],
          "measureConfiguration": []
        }
      ],
      "dashboards": [
        {
          "name": "DEF Dashboard",
          "templateType": "realEstate",
          "category": ["BI"],
          "sections": [
            {
              "name": "KPIs",
              "topSection": true,
              "charts": [
                {
                  "title": "Total AUM",
                  "type": "kpi",
                  "measures": [{"field": "MARKET_VALUE", "aggregation": "sum"}],
                  "dimensions": ["PERIOD"]
                }
              ]
            }
          ]
        }
      ],
      "security": { "enabled": true }
    }'
  ```

  ```bash Browser Session Auth theme={null}
  curl -X POST https://<your-instance>/v1/sdk/client/onboard/<userToken> \
    -H "Content-Type: application/json" \
    -H "CTN: <csrf-token>" \
    --cookie "LASID=<session>;ATN=<access>;RTN=<refresh>" \
    -d '{ ... }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "success": true,
    "status": "COMPLETED",
    "client": {
      "clientId": "DEF",
      "clientName": "Client DEF Corp",
      "connectionId": "D2026A00042",
      "modelId": "SM2026A00004",
      "vdmIds": ["V2026A00109"],
      "facadeIds": ["F2026A00018"],
      "experimentIds": ["E2026A00042"],
      "coreModelId": "SM2026A00001",
      "status": "ACTIVE",
      "onboardedBy": "admin_user_id",
      "onboardedDate": "2026-03-17T10:00:00.000Z"
    }
  }
  ```

  ```json 200 Already Exists theme={null}
  {
    "success": true,
    "status": "ALREADY_EXISTS",
    "client": { "clientId": "DEF", "..." : "..." }
  }
  ```

  ```json 400 Validation Error theme={null}
  {
    "success": false,
    "error": "Validation failed: clientId is required; connectionId is required; At least one VDM config is required in the package"
  }
  ```
</ResponseExample>
