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

# Integration Playbooks

> Scenario-based implementation guides for using the Uppzy M2M API in production applications.

Integration playbooks turn the endpoint-level API documentation into practical application flows.

Use these pages when you already understand the basics and want to design a production integration for a specific workflow.

## What these playbooks cover

* Server-side request patterns
* Session ID strategy
* Document sync strategy
* Sync vs async chat decisions
* Feedback and quality signals
* Operational checks after rollout

## Recommended order

1. Read [API Authentication](/developer/api-authentication)
2. Read [M2M API Overview](/developer/m2m-api)
3. Review [M2M Code Samples](/developer/m2m-code-samples)
4. Choose the playbook that matches your application flow
5. Validate endpoint details in [API Reference](/api-reference/introduction)

## Available playbooks

* [E-commerce Support](/developer/playbook-ecommerce-support): use Uppzy behind product, return, delivery, and policy support flows
* [CRM and Support Handoff](/developer/playbook-crm-handoff): combine assistant responses with support ticket creation
* [Content Sync](/developer/playbook-content-sync): publish approved CMS, policy, FAQ, or knowledge base content
* [Async Worker](/developer/playbook-async-worker): process chat requests through a queue-friendly worker model

## Shared implementation rules

All playbooks assume:

* API keys are stored server-side only
* API keys are never sent to browsers, mobile apps, or third-party clients
* `tenant_id` and `site_id` are runtime configuration, not user input
* Logs do not include API keys, full customer messages, or private account data
* User-facing answers are checked against your own business rules before triggering irreversible actions

## Shared environment variables

```bash theme={null}
export UPPZY_BASE_URL="https://api.uppzy.com/api/v1"
export UPPZY_API_KEY="<YOUR_API_KEY>"
export UPPZY_SITE_ID="<YOUR_SITE_ID>"
```

## Minimal shared JavaScript helper

Use one server-side helper for all playbooks so authentication, error handling, and logging stay consistent.

```js theme={null}
const BASE_URL = process.env.UPPZY_BASE_URL || "https://api.uppzy.com/api/v1";
const API_KEY = process.env.UPPZY_API_KEY;

export async function uppzy(path, { method = "GET", body } = {}) {
  const response = await fetch(`${BASE_URL}${path}`, {
    method,
    headers: {
      "X-API-Key": API_KEY,
      "Content-Type": "application/json",
    },
    body: body ? JSON.stringify(body) : undefined,
  });

  const text = await response.text();
  const data = text ? JSON.parse(text) : null;

  if (!response.ok) {
    const error = new Error(`Uppzy API returned HTTP ${response.status}`);
    error.status = response.status;
    error.details = data;
    throw error;
  }

  return data;
}
```

For file uploads, use the upload examples in [M2M Code Samples](/developer/m2m-code-samples).
