> For the complete documentation index, see [llms.txt](https://docs.storylane.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storylane.io/integrations-demo-suite/integrations-and-data-flow/external-api.md).

# External API

Use Storylane's External API to connect your workspace with internal tools, applications, and automated workflows.

{% hint style="info" %}
The API is available to users on all paid plans. If you need help, contact us at <support@storylane.io>.
{% endhint %}

With the API, you can:

* List and publish demos, and retrieve their content and engagement stats
* List workspace hubs
* Create and manage demo and hub links, including passcodes, expiration dates, and other access controls
* Create email tokens for demo and hub links
* Retrieve demo sessions and demo hub sessions, along with aggregate stats for both
* List and retrieve lead accounts and leads

### Getting started

You can generate and manage API keys directly from your Storylane workspace.

#### Step 1: Generate an API key

<figure><img src="https://2431356420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN8hWd9k2Pbb6YSWO4pUQ%2Fuploads%2FwDSPj0tagKgPfl3xo9yC%2FScreenshot%202026-08-27%20at%2014.35.34.png?alt=media&amp;token=a79b6f86-cb2e-4119-92a4-497153179b38" alt=""><figcaption></figcaption></figure>

1. Sign in to your Storylane workspace.
2. Go to **Settings → Integrations**.
3. Find **API keys** and click **View key**.
4. Copy the **Workspace ID** displayed in the modal.
5. Click **Generate new key** to create an API key.
6. Give the key a descriptive name, such as `Production automation`, `Analytics sync`, or `Staging`.
7. Copy the generated API key and store it securely.

{% hint style="warning" %}
&#x20;We are not able to access `access_token` again if you lose it. We don’t store it on our side and have no access to it after we send it to you. Therefore, please store it securely.&#x20;
{% endhint %}

We recommend creating a separate API key for each integration or environment. This makes it easier to rotate or revoke access without affecting your other integrations.

#### Step 2: Configure the Postman collection

Open the [Storylane Public Postman Collection](https://www.postman.com/team-storylane/storylane-public/collection/2zkg7jc/storylane-connect?action=share\&creator=17698894).

In the collection variables, replace:

* **`ACCESS_TOKEN`** with the API key you generated in Storylane. It will be used as the Bearer authentication token.
* **`WORKSPACE_ID`** with your Storylane workspace ID, if required by the endpoint.

Then save the updated variables.

#### Step 3: Test the connection

Run the API endpoints in Postman and verify that you are successfully retrieving your company’s demo data.

<figure><img src="https://2431356420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN8hWd9k2Pbb6YSWO4pUQ%2Fuploads%2FUZHkcRqMjFF5q1wmgHMD%2Fimage.png?alt=media&amp;token=b1e7f1e8-e1dd-4c94-979e-b615ba8aa463" alt="" width="375"><figcaption></figcaption></figure>

Here is an interactive demo demonstrating how to set up using Postman 👇

{% @storylane/embed subdomain="app" linkValue="jkzyb2hwbamc" url="<https://app.storylane.io/share/jkzyb2hwbamc>" %}

A successful response will return data from your Storylane workspace. If the request fails, verify that:

* The API key was copied correctly
* The key is active
* The request uses Bearer authentication
* The workspace ID is correct, where required
* Your workspace has access to the External API

### Managing API keys

You can return to **Settings → Integrations → API keys** at any time to view active keys or revoke keys that are no longer needed.

To rotate a key safely:

1. Generate a new API key.
2. Update your integration to use the new key.
3. Confirm that the integration is working.
4. Revoke the old key.

If you believe a key has been exposed, generate a replacement and revoke the affected key immediately.

### **API Responses**

#### 1. All Workspace Demos

`GET /api/connect/v1/workspaces/:workspace_id/demos` Use the endpoint to list all demos in your workspace. A sample response:

```json
{
  "demos": [
    {
      "id": "96528ce0-a85d-46be-a878-5cd0242534c3",
      "archived_at": null,
      "convert_cta": { "text": "optio", "url": "http://rempel-gerlach.test/rex.oberbrunner", "enabled": true },
      "created_at": "2026-09-10T05:15:39.812-07:00",
      "edited_at": "2026-09-10T04:15:39.811-07:00",
      "folder": null,
      "kind": "html",
      "links_count": 0,
      "name": "Bogan, Bauch and Becker",
      "published_at": null,
      "status": "published",
      "tags": [],
      "team_id": "527cf57d-68cd-4e36-90c8-d041571e5302",
      "user": {
        "id": "3ebfa7a1-5e86-4609-88a7-c19ea9d5e712",
        "email": "carlene_hagenes@schinner.test",
        "first_name": "Gilma",
        "last_name": "Kozey"
      }
    }
  ]
}
```

#### 2. Get Details on a Single Demo

`GET /api/connect/v1/workspaces/:workspace_id/demos/:id` Use the endpoint to fetch detailed information about a specific demo. A sample response:

```json
{
  "demo": {
    "id": "5d641afb-e83c-449a-b31d-81e5686ba1d2",
    "archived_at": null,
    "chapter_menu": {
      "id": "159dae1e-d425-47bf-94a6-da3ac3d736b2",
      "button_text": "Chapters",
      "description": "Pick what you are interested about below",
      "items": [
        { "id": "e39bf4b7-5630-4e56-b7b5-c16b25e59d9b", "description": "Recusandae porro voluptas reiciendis.", "name": "accusantium", "target_kind": "default", "target_value": null }
      ],
      "title": "Experience Chapters"
    },
    "chapters": [
      {
        "id": "bb46b495-5575-4312-94d6-c59950eb7d4d",
        "name": "natus",
        "steps": [
          {
            "id": "be16ddbd-6b60-4514-8ec4-d7fa556cef47",
            "audio_url": "https://storylane-dev-uploads.s3.us-east-2.amazonaws.com/.../id.mov",
            "content": "<div class=\"ut\">Quisquam accusantium reiciendis voluptas.</div>",
            "cta": "<div>Continue</div>",
            "kind": "modal",
            "secondary": null,
            "transcription": "Est non qui qui."
          }
        ]
      }
    ],
    "convert_cta": { "text": "Click here to learn more", "url": "", "enabled": true },
    "created_at": "2026-09-10T05:15:39.548-07:00",
    "edited_at": "2026-09-10T04:15:39.548-07:00",
    "folder": "Iowa monkeys",
    "kind": "html",
    "links_count": 0,
    "name": "Von, Cronin and Quitzon",
    "published_at": null,
    "status": "draft",
    "tags": [],
    "team": { "id": "ddacb917-0849-46c9-bdb5-9ae4d6c2eab5", "name": "Rhode Island people 575" },
    "user": {
      "id": "1da47Sde-6d51-4513-b388-aa7ab5cde161",
      "email": "jamaal_kerluke@pagac-watsica.test",
      "first_name": "Raul",
      "last_name": "Kuvalis"
    }
  }
}
```

#### 3. Publish a Demo

`POST /api/connect/v1/workspaces/:workspace_id/demos/:id/publish` Use the endpoint to publish a demo. A sample response:

```json
{
  "demo": {
    "id": "daa67ec3-8e05-4360-a9ef-1ffedd4688ab",
    "archived_at": null,
    "chapter_menu": null,
    "chapters": [],
    "convert_cta": { "text": "Book a Demo", "url": "", "enabled": false },
    "created_at": "2026-09-10T05:15:38.976-07:00",
    "edited_at": "2026-09-10T05:15:39.067-07:00",
    "folder": null,
    "kind": "html",
    "links_count": 0,
    "name": "Ritchie, Kub and Johnson",
    "published_at": "2026-09-10T05:15:39.067-07:00",
    "status": "published",
    "tags": [],
    "team": { "id": "5d7ac791-8a8f-40d0-bb28-900aa8b7607f", "name": "Illinois lions 569" },
    "user": {
      "id": "2d40bae1-15f3-44f3-b0d4-890b89029a6d",
      "email": "kermit_moen@haag-kuhn.example",
      "first_name": "Tameka",
      "last_name": "Wilkinson"
    }
  },
  "link": {
    "id": "96fb719a-e16d-46aa-8884-ca606a5a466f",
    "created_at": "2026-09-10T05:15:39.046-07:00",
    "default_link": true,
    "email_confirmation_required": false,
    "email_required": false,
    "expires_at": null,
    "name": "Default",
    "passcode": null,
    "recipient_email": null,
    "tokens": [],
    "updated_at": "2026-09-10T05:15:39.046-07:00",
    "url": "https://staging.storylane.us/share/6dzry3zezs70",
    "user": {
      "id": "2d40bae1-15f3-44f3-b0d4-890b89029a6d",
      "email": "kermit_moen@haag-kuhn.example",
      "first_name": "Tameka",
      "last_name": "Wilkinson"
    },
    "whitelist_email_domains": []
  }
}
```

#### 4. Paginated Stats for All Workspace Demos

`GET /api/connect/v1/workspaces/:workspace_id/demos/stats` Use the endpoint to fetch paginated engagement stats across all workspace demos. A sample response:

```json
{
  "demos": [
    {
      "id": "dd319440-5642-467d-a2db-cb38b1a4f2ea",
      "name": "Larkin-Kiehn",
      "intent_level": "unknown",
      "archived_at": null,
      "current": {
        "total_sessions": 0,
        "unique_sessions": 0,
        "engaged_sessions": 0,
        "cta_opened_sessions": 0,
        "leads_count": 0,
        "time_spent": 0,
        "total_steps_count": 0,
        "viewed_steps_count": 0,
        "avg_time_spent": 0
      }
    }
  ],
  "page": 1,
  "per_page": 20,
  "next_page": null
}
```

#### 5. All Demo Sessions

`GET /api/connect/v1/workspaces/:workspace_id/demo_sessions` Use the endpoint to list demo sessions across the workspace. A sample response:

```json
{
  "page": 1,
  "per_page": 40,
  "next_page": null,
  "demo_sessions": [
    {
      "id": "b22e61c2-a0d0-489e-a109-7eac2630fc36",
      "browser": null,
      "clearbit_company": {
        "id": "c7297878-73cb-44a0-884e-9c787321bd16",
        "annual_revenue": "$1M-$16M",
        "domain_name": "mcdermott-klocko.example",
        "employees": "51-250",
        "industry": "Information Technology",
        "logo_url": "http://buckridge.example/stephan.kunde",
        "name": "Bartoletti, Champlin and Spinka"
      },
      "clearbit_confidence_score": null,
      "cookie_id": "316c2802-a63a-4adc-8e26-ed9a8862a463",
      "cta_opened": false,
      "cta_opened_options": null,
      "engaged": false,
      "first_accessed_at": "2026-09-10T05:16:02.885-07:00",
      "host_url": "",
      "intent_level": "unknown",
      "internal": false,
      "ipdata_location": { "city": "New Erin", "country": "Luxembourg", "state": null },
      "last_accessed_at": "2026-09-10T05:08:19.963-07:00",
      "lead": {
        "id": "edcf442f-a04a-4826-a786-553cb2e98789",
        "client_source": "none",
        "client_tracking_id": null,
        "company_name": "Rohan, Kassulke and Rau",
        "created_at": "2026-09-10T05:16:02.876-07:00",
        "email": "jammie@bechtelar.test",
        "external_entities": {},
        "external_user_id": null,
        "first_name": "Raeann",
        "last_name": "Champlin",
        "phone": "(301) 517-3612",
        "sync_error": null
      },
      "lead_company_id": null,
      "link": {
        "id": "16123265-525e-488f-b224-c18cade3881e",
        "alias_value": "",
        "base_link": false,
        "name": "modi reprehenderit",
        "original_value": "bvrmgixl66iu",
        "value": "bvrmgixl66iu"
      },
      "mobile": false,
      "platform": null,
      "project": {
        "id": "3fbb2541-4476-4367-a752-cf6df6f2f2ed",
        "archived_at": null,
        "flows_count": 0,
        "kind": "html",
        "name": "Schmidt-Tillman",
        "presenter_mode": false,
        "widgets_count": 0
      },
      "referer": "https://staging.storylane.us/demo/bvrmgixl66iu",
      "remote_ip": "104.112.51.1",
      "tagged_email": null,
      "time_spent": -462,
      "token_data": {},
      "total_steps_count": 0,
      "utm_params": {},
      "view_options": { "embed": false, "hide_forms": false, "hide_steps": false },
      "viewed_steps_count": 0,
      "viewed_steps_percent": 0
    }
  ]
}
```

#### 6. Demo Sessions Stats

`GET /api/connect/v1/workspaces/:workspace_id/demo_sessions/stats` Use the endpoint to fetch aggregate demo session stats. A sample response:

```json
{
  "stats": {
    "total_sessions": 2,
    "engaged_sessions": 0,
    "cta_opened_sessions": 0,
    "high_intent_level": 0,
    "leads_count": 0,
    "time_spent": 0
  }
}
```

#### 7. Get Detailed Demo Session

`GET /api/connect/v1/workspaces/:workspace_id/demo_sessions/:id` Use the endpoint to fetch detailed information about a specific demo session. A sample response:

```json
{
  "demo_session": {
    "id": "75d7780b-e17e-43d9-ae53-e72ac7c7f2a5",
    "browser": null,
    "clearbit_company": null,
    "clearbit_confidence_score": null,
    "cookie_id": "3567c24e-1304-46f1-82ea-56f8ea659e70",
    "cta_opened": false,
    "cta_opened_options": null,
    "demo_events": [
      { "id": "f12db591-94e4-489e-b17a-53557fd4e86f", "kind": "opened", "occurred_at": "2026-09-10T05:13:02.727-07:00", "options": {}, "target_id": null, "target_type": null },
      { "id": "1be08427-aa6f-42e7-a1ca-546acafa88f0", "kind": "widget_viewed", "occurred_at": "2026-09-10T05:14:02.762-07:00", "options": {}, "target_id": "0236b65e-7377-4651-a9e0-5681c0e6106c", "target_type": "Widget" }
    ],
    "engaged": false,
    "first_accessed_at": "2026-09-10T04:42:50.453-07:00",
    "host_url": "",
    "intent_level": "unknown",
    "internal": false,
    "ipdata_location": null,
    "last_accessed_at": "2026-09-10T05:08:37.080-07:00",
    "lead": null,
    "lead_company_id": null,
    "link": {
      "id": "2fc95a99-d3ca-4de7-9ce7-96a1a64a55a2",
      "alias_value": "",
      "base_link": false,
      "name": "consequatur voluptas",
      "original_value": "uhpqtckng8i0",
      "value": "uhpqtckng8i0"
    },
    "mobile": false,
    "platform": null,
    "project": {
      "id": "30f20a07-68e7-4c22-b092-a8bddcb96ca7",
      "archived_at": null,
      "flows_count": 1,
      "kind": "html",
      "name": "Hudson, Corwin and Schmidt",
      "presenter_mode": false,
      "widgets_count": 1
    },
    "project_body": {},
    "referer": "https://staging.storylane.us/demo/uhpqtckng8i0",
    "remote_ip": "103.44.102.221",
    "tagged_email": null,
    "time_spent": 1546,
    "token_data": {},
    "total_steps_count": 0,
    "utm_params": {},
    "view_options": { "embed": false, "hide_forms": false, "hide_steps": false },
    "viewed_steps_count": 0,
    "viewed_steps_percent": 0
  }
}
```

#### 8. List Demo Links

`GET /api/connect/v1/workspaces/:workspace_id/demos/:demo_id/links` Use the endpoint to list all links for a given demo. A sample response:

```json
{
  "links": [
    {
      "id": "7578653e-e35d-45aa-b449-8f1aac070247",
      "created_at": "2026-09-10T05:15:49.328-07:00",
      "default_link": false,
      "email_confirmation_required": false,
      "email_required": false,
      "expires_at": null,
      "name": "illum voluptas",
      "passcode": null,
      "recipient_email": "edmundo@frami.test",
      "tokens": [],
      "updated_at": "2026-09-10T05:15:49.328-07:00",
      "url": "https://staging.storylane.us/share/7vr8fkijmv3d",
      "user": {
        "id": "cd065129-5137-4f9a-8c46-26660bfe4587",
        "email": "felipa_vonrueden@muller.example",
        "first_name": "Arlie",
        "last_name": "Runolfsdottir"
      },
      "whitelist_email_domains": []
    }
  ]
}
```

#### 9. Create a New Demo Link

`POST /api/connect/v1/workspaces/:workspace_id/demos/:demo_id/links` Use the endpoint to create a new link for a demo. A sample response:

```json
{
  "link": {
    "id": "01d9daec-ebbe-4105-9880-addbbe060d6d",
    "created_at": "2026-09-10T05:15:48.326-07:00",
    "default_link": false,
    "email_confirmation_required": false,
    "email_required": false,
    "expires_at": null,
    "name": "enim",
    "passcode": null,
    "recipient_email": null,
    "tokens": [],
    "updated_at": "2026-09-10T05:15:48.326-07:00",
    "url": "https://staging.storylane.us/share/lh49uvcwtlaq",
    "user": {
      "id": "742ab3e1-7b57-4fed-bca8-6d2c95fb954c",
      "email": "rodrick@yost-harris.example",
      "first_name": "Travis",
      "last_name": "Roberts"
    },
    "whitelist_email_domains": []
  }
}
```

#### 10. Update an Existing Demo Link

`PATCH /api/connect/v1/workspaces/:workspace_id/demos/:demo_id/links/:id` Use the endpoint to update an existing demo link. A sample response:

```json
{
  "link": {
    "id": "3185e384-528d-4846-8d08-3c090aea186d",
    "created_at": "2026-09-10T05:15:48.667-07:00",
    "default_link": false,
    "email_confirmation_required": false,
    "email_required": false,
    "expires_at": null,
    "name": "iste",
    "passcode": null,
    "recipient_email": null,
    "tokens": [],
    "updated_at": "2026-09-10T05:15:48.702-07:00",
    "url": "https://staging.storylane.us/share/vckynuinuvkw",
    "user": {
      "id": "d38b7ad3-7d8c-44f2-b0bd-69430f113936",
      "email": "king@nader-legros.test",
      "first_name": "Renea",
      "last_name": "Yost"
    },
    "whitelist_email_domains": []
  }
}
```

#### 11. Deactivate a Demo Link

`DELETE /api/connect/v1/workspaces/:workspace_id/demos/:demo_id/links/:id` Use the endpoint to deactivate an existing demo link. Returns a `204 No Content` response with no body on success.

#### 12. Create a New Email Token for a Demo Link

`POST /api/connect/v1/workspaces/:workspace_id/demos/:demo_id/links/:link_id/tokens` Use the endpoint to create a new email token for a demo link. A sample response:

```json
{
  "token": {
    "id": "5685c781-0954-4651-926b-5b535afc2227",
    "email": "hunter_schumm@kihn-vonrueden.test",
    "link_url": "https://staging.storylane.us/share/vxs1bfygmdgo?sl_token=5685c781-0954-4651-926b-5b535afc2227"
  }
}
```

#### 13. All Workspace Hubs

`GET /api/connect/v1/workspaces/:workspace_id/hubs` Use the endpoint to list all hubs in your workspace. A sample response:

```json
{
  "hubs": [
    {
      "id": "24f85e4b-f0b4-4d1e-85a7-54263eac599a",
      "created_at": "2026-09-10T05:15:08.738-07:00",
      "edited_at": "2026-09-10T05:15:08.739-07:00",
      "kind": "custom",
      "links_count": 0,
      "name": "vel",
      "published_at": null,
      "status": "published",
      "team_id": "5966d10b-06b1-451d-bc08-6f0cc09caf16",
      "user": {
        "id": "5975ee7d-3ebb-491b-8a33-e0014bbeb1b3",
        "email": "lorene_kub@heathcote.example",
        "first_name": "Genoveva",
        "last_name": "Hauck"
      }
    }
  ]
}
```

#### 14. List Hub Links

`GET /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/links` Use the endpoint to list all links for a given hub. A sample response:

```json
{
  "links": [
    {
      "id": "489ef3b3-d7f5-41b7-83ae-f3a99d761562",
      "created_at": "2026-09-10T05:14:57.459-07:00",
      "default_link": false,
      "email_confirmation_required": false,
      "email_required": false,
      "expires_at": null,
      "name": "ullam ut",
      "passcode": null,
      "recipient_email": "leslie@kovacek.example",
      "tokens": [],
      "updated_at": "2026-09-10T05:14:57.459-07:00",
      "url": "https://staging.storylane.us/hub/34bgfagakmm",
      "user": {
        "id": "1414c14b-c2d0-4cf3-a734-9ba0286d7624",
        "email": "elisabeth.mann@herzog.test",
        "first_name": "Kala",
        "last_name": "Ledner"
      },
      "whitelist_email_domains": []
    }
  ]
}
```

#### 15. Create a New Hub Link

`POST /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/links` Use the endpoint to create a new link for a hub. A sample response:

```json
{
  "link": {
    "id": "08af4207-622a-40cd-9ec8-b32187c1b9c9",
    "created_at": "2026-09-10T05:14:57.195-07:00",
    "default_link": false,
    "email_confirmation_required": false,
    "email_required": false,
    "expires_at": null,
    "name": "molestiae",
    "passcode": null,
    "recipient_email": null,
    "tokens": [],
    "updated_at": "2026-09-10T05:14:57.195-07:00",
    "url": "https://staging.storylane.us/hub/50w35txwn7za",
    "user": {
      "id": "cd43b888-2c21-4c1d-9099-b17c24b0a6ae",
      "email": "mauricio.gislason@wilkinson.example",
      "first_name": "Mereldeth",
      "last_name": "Nitzsche"
    },
    "whitelist_email_domains": []
  }
}
```

#### 16. Update an Existing Hub Link

`PATCH /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/links/:id` Use the endpoint to update an existing hub link. A sample response:

```json
{
  "link": {
    "id": "fa8a44e5-9b8a-4a29-91b0-299dee1dae45",
    "created_at": "2026-09-10T05:14:57.632-07:00",
    "default_link": false,
    "email_confirmation_required": false,
    "email_required": false,
    "expires_at": null,
    "name": "rerum",
    "passcode": null,
    "recipient_email": null,
    "tokens": [],
    "updated_at": "2026-09-10T05:14:57.666-07:00",
    "url": "https://staging.storylane.us/hub/m3aftfogwtrf",
    "user": {
      "id": "07ab9cdf-3c14-4ebd-b14a-1e89c588e568",
      "email": "rae@quitzon.example",
      "first_name": "Bette",
      "last_name": "Hahn"
    },
    "whitelist_email_domains": []
  }
}
```

#### 17. Deactivate a Hub Link

`DELETE /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/links/:id` Use the endpoint to deactivate an existing hub link. Returns a `204 No Content` response with no body on success.

#### 18. Create a New Email Token for a Hub Link

`POST /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/links/:link_id/tokens` Use the endpoint to create a new email token for a hub link. A sample response:

```json
{
  "token": {
    "id": "8be506ac-109e-4b6a-97f3-d6c14490b4a0",
    "email": "shandra.gusikowski@borer.example",
    "link_url": "https://staging.storylane.us/hub/g63kfrn9gnsi?sl_token=8be506ac-109e-4b6a-97f3-d6c14490b4a0"
  }
}
```

#### 19. Get All Demo Sessions for a Hub

`GET /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/demo_sessions` Use the endpoint to list all demo sessions for a given hub. A sample response:

```json
{
  "page": 1,
  "per_page": 40,
  "next_page": null,
  "demo_sessions": [
    {
      "id": "4b4c82ac-f1c2-4ae7-8e2d-9ac72c1beecc",
      "attachments_count": 0,
      "browser": null,
      "clearbit_company": {
        "id": "05d79e75-9f30-4fd1-9fa9-298e46199fba",
        "annual_revenue": "$3M-$18M",
        "domain_name": "stokes-champlin.example",
        "employees": "51-250",
        "industry": "Information Technology",
        "logo_url": "http://howe.example/ricky_bernier",
        "name": "Bauch-Luettgen"
      },
      "clearbit_confidence_score": null,
      "content_titles": {},
      "cta_opened": false,
      "cta_opened_options": null,
      "engaged": false,
      "first_accessed_at": "2026-09-10T05:16:08.368-07:00",
      "intent_level": "unknown",
      "internal": false,
      "ipdata_location": { "city": "Port Sydneyview", "country": "Sudan", "state": null },
      "last_accessed_at": "2026-09-10T05:11:03.926-07:00",
      "lead": {
        "id": "15ab9d7e-92de-4458-8d05-da2ab103121a",
        "client_source": "none",
        "client_tracking_id": null,
        "company_name": "Nienow and Sons",
        "created_at": "2026-09-10T05:16:08.362-07:00",
        "email": "marianela@quitzon.test",
        "external_entities": {},
        "external_user_id": null,
        "first_name": "Iliana",
        "last_name": "Rogahn",
        "phone": "(795) 430-0728",
        "sync_error": null
      },
      "lead_company_id": null,
      "link": {
        "id": "fdb56853-cd30-4c02-9f2f-1d6434d502d5",
        "alias_value": "",
        "base_link": false,
        "name": "eveniet ab",
        "original_value": "em5qu4kmawck",
        "value": "em5qu4kmawck"
      },
      "mobile": false,
      "platform": null,
      "referer": "https://staging.storylane.us/demo/em5qu4kmawck",
      "remote_ip": "5.93.188.88",
      "section_interests": [],
      "section_titles": null,
      "time_spent": 304,
      "utm_params": {},
      "viewed_attachments_count": 0,
      "viewed_attachments_percent": 0
    }
  ]
}
```

#### 20. Get Detailed Demo Session for a Hub

`GET /api/connect/v1/workspaces/:workspace_id/hubs/:hub_id/demo_sessions/:id` Use the endpoint to fetch detailed information about a specific hub demo session. A sample response:

```json
{
  "demo_session": {
    "id": "75ea82c5-b0bc-48b7-ae07-db588247c801",
    "attachments_count": 0,
    "browser": null,
    "clearbit_company": null,
    "clearbit_confidence_score": null,
    "content_titles": {},
    "cta_opened": false,
    "cta_opened_options": null,
    "demo_events": [
      { "id": "e48ab5a8-cc4a-4cb3-9923-1cfbcef00bdf", "kind": "opened", "occurred_at": "2026-09-10T05:13:08.267-07:00", "options": {}, "target_id": null, "target_type": null },
      { "id": "fbf57868-0bb4-4303-87c6-2e4c2fd4cdcd", "kind": "lead_captured", "occurred_at": "2026-09-10T05:14:08.270-07:00", "options": {}, "target_id": "6517d462-4386-4281-9c89-b0bc26d7b750", "target_type": "Lead" }
    ],
    "engaged": false,
    "first_accessed_at": "2026-09-10T04:40:43.708-07:00",
    "hub_body": {},
    "intent_level": "unknown",
    "internal": false,
    "ipdata_location": null,
    "last_accessed_at": "2026-09-10T05:11:13.160-07:00",
    "lead": null,
    "lead_company_id": null,
    "link": {
      "id": "7ec15c2f-6bd1-4b74-bb01-d5ca18751e5c",
      "alias_value": "",
      "base_link": false,
      "name": "est facere",
      "original_value": "z74xd76mc1fi",
      "value": "z74xd76mc1fi"
    },
    "mobile": false,
    "platform": null,
    "referer": "https://staging.storylane.us/demo/z74xd76mc1fi",
    "remote_ip": "119.129.8.74",
    "section_interests": [],
    "section_titles": null,
    "time_spent": 1829,
    "utm_params": {},
    "viewed_attachments_count": 0,
    "viewed_attachments_percent": 0
  }
}
```

#### 21. All Workspace Lead Accounts

`GET /api/connect/v1/workspaces/:workspace_id/accounts` Use the endpoint to list all lead accounts in your workspace. A sample response:

```json
{
  "page": 1,
  "per_page": 40,
  "next_page": null,
  "accounts": [
    {
      "id": "82f32f31-bceb-4364-a3bd-ac2abc6ee4d5",
      "clearbit_company": null,
      "demo_sessions_count": 0,
      "domain_name": "towne-roob.kling.test",
      "external_entities": {},
      "intent_level": "unknown",
      "intent_level_reset_at": null,
      "last_demo_accessed_at": "2026-09-10T05:05:41.086-07:00",
      "last_demo_session": {
        "id": "25f02c1e-900f-4f96-95d6-14fc61ba0e43",
        "browser": null,
        "engaged": false,
        "first_accessed_at": "2026-09-10T05:05:41.086-07:00",
        "intent_level": "unknown",
        "internal": false,
        "last_accessed_at": "2026-09-10T05:06:04.914-07:00",
        "link": {
          "id": "d5e7bf0d-6a6d-41a8-8835-ac9b4957210f",
          "name": "eveniet aut",
          "value": "n18umtvh0mr"
        },
        "project": {
          "id": "a98d7f2b-c402-4999-8a7c-5829c8701220",
          "kind": "html",
          "name": "Bruen-Crooks"
        },
        "time_spent": 23,
        "viewed_steps_count": 0,
        "viewed_steps_percent": 0
      },
      "leads_count": 0,
      "logo_url": null,
      "name": "Moore, Pfeffer and Jakubowski"
    }
  ]
}
```

#### 22. Get a Single Lead Account

`GET /api/connect/v1/workspaces/:workspace_id/accounts/:id` Use the endpoint to fetch a single lead account. A sample response:

```json
{
  "account": {
    "id": "d19eaa13-7d39-48f0-b722-b056469d091a",
    "clearbit_company": null,
    "demo_sessions_count": 0,
    "domain_name": "marks.kuhic.test",
    "external_entities": {},
    "intent_level": "unknown",
    "intent_level_reset_at": null,
    "last_demo_accessed_at": "2026-09-10T04:31:58.631-07:00",
    "last_demo_session": {
      "id": "812dd9c6-ffb5-4e6c-bea0-feb77f8939ca",
      "browser": null,
      "engaged": false,
      "first_accessed_at": "2026-09-10T04:31:58.631-07:00",
      "intent_level": "unknown",
      "internal": false,
      "last_accessed_at": "2026-09-10T05:08:52.618-07:00",
      "link": {
        "id": "9dc53f20-5c01-4251-885f-c3e9cc91efc4",
        "name": "qui eligendi",
        "value": "129ooesosx0j"
      },
      "project": {
        "id": "942f811f-37b5-45cc-b496-c4af11609021",
        "kind": "html",
        "name": "Nolan, Herman and Pollich"
      },
      "time_spent": 2213,
      "viewed_steps_count": 0,
      "viewed_steps_percent": 0
    },
    "leads_count": 0,
    "logo_url": null,
    "name": "Mayer and Sons"
  }
}
```

#### 23. All Workspace Leads

`GET /api/connect/v1/workspaces/:workspace_id/leads` Use the endpoint to list all leads in your workspace. A sample response:

```json
{
  "page": 1,
  "per_page": 40,
  "next_page": null,
  "leads": [
    {
      "id": "b2c7a854-b325-4bb5-8c24-8ec937d279f4",
      "additional_data": {},
      "client_source": "none",
      "client_tracking_id": null,
      "company_name": "Bins, Hudson and Spencer",
      "created_at": "2026-09-10T05:15:32.161-07:00",
      "demo_session": null,
      "email": "judson@hand-robel.test",
      "external_entities": {},
      "external_user_id": null,
      "first_name": "Meghan",
      "intent_level": "unknown",
      "intent_level_reset_at": null,
      "last_name": "Emmerich",
      "lead_company": null,
      "link": {
        "id": "b99d7c01-8598-42ad-8a48-3a76e671a737",
        "alias_value": "",
        "base_link": false,
        "name": "reiciendis atque",
        "original_value": "4ieu9t3a4xxy",
        "value": "4ieu9t3a4xxy"
      },
      "link_id": "b99d7c01-8598-42ad-8a48-3a76e671a737",
      "phone": "642.818.2325",
      "record_archived_at": null,
      "record_id": "0a902876-119b-4cef-888a-6915408dd3fa",
      "record_name": "Cruickshank-Kassulke",
      "record_type": "Project",
      "source": null,
      "sync_error": null
    }
  ]
}
```

### Additional Notes

* Ensure API tokens are stored securely and not shared publicly.
* All list endpoints follow the same pagination shape where applicable: `page`, `per_page`, `next_page`.

For further assistance, please contact <support@storylane.io>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.storylane.io/integrations-demo-suite/integrations-and-data-flow/external-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
