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

# Onboarding (/v1/onboarding/{brand_id}/connect)

> Credentials stored (encrypted) and connectors re-pointed.

### Path parameters

<ParamField path="brand_id" type="string (uuid)" required />

### Request body

`object`

<ParamField body="gorgias" type="object" />

<ParamField body="shopify" type="object" />

<ParamField body="recharge" type="object" />

<ParamField body="activate" type="boolean">
  Also activate the brand once connectors are stored (connect only)
</ParamField>

### Response

`object`

<ResponseField name="ok" type="boolean" required />

<ResponseField name="connected" type="string[]" required>
  Connector types whose credentials were stored
</ResponseField>

<ResponseField name="activated" type="boolean" required />

<ResponseField name="readiness" type="object" required>
  Null unless `activate` was requested; then the activation result (`brand` + `validation`) or `&#123; 'blocked': '&lt;error>' &#125;` when activation failed.

  <Expandable title="readiness">
    <ResponseField name="brand" type="object" required>
      Brand record

      <Expandable title="brand">
        <ResponseField name="id" type="string (uuid)" required />

        <ResponseField name="tenant_id" type="string (uuid)" required />

        <ResponseField name="slug" type="string" required />

        <ResponseField name="display_name" type="string" required />

        <ResponseField name="status" type="string" required />

        <ResponseField name="routing_mode" type="string" required />

        <ResponseField name="canary_percent" type="integer" required />

        <ResponseField name="region" type="string" required />

        <ResponseField name="default_locale" type="string" required />

        <ResponseField name="policy_set_key" type="string" />

        <ResponseField name="quotas" type="object" required />

        <ResponseField name="metadata" type="object" required />

        <ResponseField name="config_version" type="integer" required />

        <ResponseField name="config_fingerprint" type="string" required />

        <ResponseField name="activated_at" type="string (date-time)" />

        <ResponseField name="created_at" type="string (date-time)" required />

        <ResponseField name="updated_at" type="string (date-time)" required />

        <ResponseField name="workflow_bindings" type="object[]" required />
      </Expandable>
    </ResponseField>

    <ResponseField name="validation" type="object" required>
      Validation report

      <Expandable title="validation">
        <ResponseField name="valid" type="boolean" required />

        <ResponseField name="errors" type="string[]" required />

        <ResponseField name="warnings" type="string[]" required />

        <ResponseField name="checks" type="object[]" required />

        <ResponseField name="readiness" type="object" />
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning                                                   |
| ----- | --------------------------------------------------------- |
| `200` | Credentials stored (encrypted) and connectors re-pointed. |
| `400` | Validation error                                          |
| `401` | Unauthorized                                              |
| `404` | Not found                                                 |
| `429` | Rate limited                                              |
| `500` | Internal error                                            |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.workstream.stateset.com/v1/onboarding/{brand_id}/connect' \
    --header "x-api-key: $STATESET_TEMPORAL_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
    "gorgias": {
      "subdomain": "string",
      "email": "ada.lovelace@example.com",
      "api_key": "YOUR_API_KEY",
      "webhook_secret": "YOUR_API_KEY"
    },
    "shopify": {
      "domain": "string",
      "access_token": "YOUR_API_KEY",
      "webhook_secret": "YOUR_API_KEY"
    },
    "recharge": {
      "api_token": "YOUR_API_KEY",
      "webhook_secret": "YOUR_API_KEY"
    },
    "activate": true
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "ok": true,
    "connected": [
      "string"
    ],
    "activated": true,
    "readiness": {
      "brand": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "tenant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "slug": "acme-outdoors",
        "display_name": "Ada Lovelace",
        "status": "pending",
        "routing_mode": "string",
        "canary_percent": 8,
        "region": "CA",
        "default_locale": "string",
        "policy_set_key": "string",
        "quotas": {},
        "metadata": {},
        "config_version": 1,
        "config_fingerprint": "string",
        "activated_at": "2026-08-31T14:22:05Z",
        "created_at": "2026-08-31T14:22:05Z",
        "updated_at": "2026-08-31T14:22:05Z",
        "workflow_bindings": []
      },
      "validation": {
        "valid": true,
        "errors": [],
        "warnings": [],
        "checks": [],
        "readiness": {
          "activation_ready": null,
          "self_service_ready": null,
          "summary": null,
          "steps": null
        }
      }
    }
  }
  ```
</ResponseExample>
