> ## 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.

# Quickstart

> Create a key and retrieve recent qualified sessions in five minutes.

<Steps>
  <Step title="Create a scoped API key">
    In Hobbes, open **Settings → Organization → API keys**. Create a key with
    the **Sessions** scope. Only organization admins can create or revoke keys.

    Copy the token when it appears. Hobbes shows the plaintext token once and
    stores only its hash.
  </Step>

  <Step title="Store the token">
    Keep the token in a secret manager or environment variable. Never commit it
    to source control or expose it in browser code.

    ```bash theme={null}
    export HOBBES_API_KEY="hb_live_..."
    ```
  </Step>

  <Step title="Retrieve qualified sessions">
    Request the ten most recent sessions whose latest qualification result is
    `qualified`.

    <CodeGroup>
      ```bash cURL theme={null}
      curl --fail-with-body \
        --get "https://api-us.hihobbes.com/api/v1/sessions" \
        --data-urlencode "qualification_status=qualified" \
        --data-urlencode "limit=10" \
        --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={"qualification_status": "qualified", "limit": 10},
          timeout=30,
      )
      response.raise_for_status()

      payload = response.json()
      for session in payload["sessions"]:
          print(session["id"], session["email"], session["buyingIntent"])
      ```

      ```typescript TypeScript theme={null}
      const url = new URL("https://api-us.hihobbes.com/api/v1/sessions");
      url.searchParams.set("qualification_status", "qualified");
      url.searchParams.set("limit", "10");

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

      const payload = await response.json();
      for (const session of payload.sessions) {
        console.log(session.id, session.email, session.buyingIntent);
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Follow pagination">
    List responses include the current `limit`, `offset`, and total matching
    records. Request the next page while `offset + limit < total`.

    ```json theme={null}
    {
      "pagination": {
        "total": 248,
        "limit": 10,
        "offset": 0
      }
    }
    ```
  </Step>
</Steps>

<Tip>
  Save the `X-Request-ID` response header in integration logs. It identifies the
  exact request if you need help diagnosing a failure.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication and scopes" icon="key" href="/guides/authentication">
    Create narrowly scoped keys and rotate them safely.
  </Card>

  <Card title="Pagination and filtering" icon="filter" href="/guides/pagination-filtering">
    Build complete and restartable data synchronization jobs.
  </Card>
</CardGroup>
