# System Overview

## Step 1: Sync businesses via REST API

Your platform syncs businesses and review operations with Cloutly through the REST API.

```mermaid
flowchart LR
  platform[Your Backend] -->|x-api-key| cloutly[Cloutly REST API]
  cloutly --> businesses[Businesses]
  cloutly --> reviews[Reviews]
  cloutly --> invites[Invites and Replies]
```

## Step 2: Provision user and business through JWT

Your backend creates a signed JWT and passes it to the embedded Cloutly iframe.\
On successful validation, Cloutly upserts user and business records automatically.

```mermaid
sequenceDiagram
  participant User as Your User
  participant App as Your App
  participant Api as Your Backend
  participant Embed as Cloutly Embed

  User->>App: Open embedded reputation page
  App->>Api: Request short-lived embed JWT
  Api->>Embed: Signed JWT (externalUserEmail, externalBusinessId, ...)
  Embed->>Embed: Validate token and upsert user/business
  Embed-->>App: Return embedded session in iframe
```

## Step 3: Run embedded Cloutly app inside your UI

The iframe renders the Cloutly app in your system while retaining your platform navigation and permissions.

## Step 4: Pull insights and automation outputs

Use REST endpoints for summaries, review lists, invites, and replies.\
Use widgets when you need lightweight read-only rendering outside the full embed experience.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloutly.com/reviews-sdk-for-marketplace-websites/introduction/system-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
