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

# Sync qualified sessions to a CRM

> Pull recent qualified demos and produce idempotent CRM records.

Use the session UUID as the external id in your CRM. Query a short overlapping
time window on each run, then upsert rather than insert. The overlap protects
against delayed analysis and interrupted jobs.

## Request recent qualified sessions

<CodeGroup>
  ```bash cURL theme={null}
  curl --fail-with-body --get \
    "https://api-us.hihobbes.com/api/v1/sessions" \
    --data-urlencode "date_from=2026-07-09T00:00:00Z" \
    --data-urlencode "qualification_status=qualified" \
    --data-urlencode "buying_intent=high,medium" \
    --data-urlencode "limit=200" \
    --header "Authorization: Bearer $HOBBES_API_KEY"
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.get(
      "https://api-us.hihobbes.com/api/v1/sessions",
      headers={"Authorization": f"Bearer {os.environ['HOBBES_API_KEY']}"},
      params={
          "date_from": "2026-07-09T00:00:00Z",
          "qualification_status": "qualified",
          "buying_intent": "high,medium",
          "limit": 200,
      },
      timeout=30,
  )
  response.raise_for_status()

  crm_records = [
      {
          "external_id": session["id"],
          "email": session["email"],
          "name": session["name"],
          "company": session["business"],
          "buying_intent": session["buyingIntent"],
          "summary": session["summaryMarkdown"],
          "last_demo_at": session["startTime"],
      }
      for session in response.json()["sessions"]
      if session["email"]
  ]
  print(crm_records)
  ```

  ```typescript TypeScript theme={null}
  const url = new URL("https://api-us.hihobbes.com/api/v1/sessions");
  url.searchParams.set("date_from", "2026-07-09T00:00:00Z");
  url.searchParams.set("qualification_status", "qualified");
  url.searchParams.set("buying_intent", "high,medium");
  url.searchParams.set("limit", "200");

  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.HOBBES_API_KEY}` },
  });
  if (!response.ok) throw new Error(await response.text());

  const { sessions } = await response.json();
  const crmRecords = sessions.filter((session) => session.email).map((session) => ({
    externalId: session.id,
    email: session.email,
    name: session.name,
    company: session.business,
    buyingIntent: session.buyingIntent,
    summary: session.summaryMarkdown,
    lastDemoAt: session.startTime,
  }));
  console.log(crmRecords);
  ```
</CodeGroup>

## Production pattern

1. Store the last successful session timestamp.
2. Subtract at least one hour to create the next `date_from` watermark.
3. Read every page.
4. Upsert by session UUID.
5. Advance the watermark only after every page succeeds.

Retrieve [session detail](/api-reference/get-session) only when the CRM needs
topics, objections, timeline events, or next steps.
