Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions codegen/data/resource-sample-definitions/all-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,10 @@
supports_offline_access_codes: false
warnings: []
workspace_id: 5d7f2e1a-9c8b-4f3e-8d2c-1a0b9e8f7c6d
- title: Magic Link
description: A magic link resource.
resource_type: magic_link
- title: Customer Portal
description: A customer portal resource.
resource_type: customer_portal
properties:
building_block_type: connect_accounts
created_at: '2025-06-16T16:54:17.946594Z'
customer_key: My Company
expires_at: '2025-06-17T16:54:17.946594Z'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Create property listings with a `region` field in `custom_metadata`, then filter
{% tabs %}
{% tab title="JavaScript" %}
```javascript
const { magic_link } = await seam.customers.createPortal({
const { customer_portal } = await seam.customers.createPortal({
customer_data: {
customer_key: "customer_123",
property_listings: [
Expand All @@ -71,7 +71,7 @@ const { magic_link } = await seam.customers.createPortal({
});

// The portal will only show "Lisbon Apartment"
console.log(magic_link.url);
console.log(customer_portal.url);
```
{% endtab %}

Expand Down Expand Up @@ -112,7 +112,7 @@ When you provide multiple filters, a resource must match all of them. Here, only
{% tabs %}
{% tab title="JavaScript" %}
```javascript
const { magic_link } = await seam.customers.createPortal({
const { customer_portal } = await seam.customers.createPortal({
customer_data: {
customer_key: "customer_123",
property_listings: [
Expand Down Expand Up @@ -140,7 +140,7 @@ const { magic_link } = await seam.customers.createPortal({
});

// Only "Premium Villa" is visible in the portal
console.log(magic_link.url);
console.log(customer_portal.url);
```
{% endtab %}

Expand Down Expand Up @@ -187,7 +187,7 @@ Filter by a boolean `custom_metadata` value, such as showing only premium listin
{% tabs %}
{% tab title="JavaScript" %}
```javascript
const { magic_link } = await seam.customers.createPortal({
const { customer_portal } = await seam.customers.createPortal({
customer_data: {
customer_key: "customer_123",
property_listings: [
Expand All @@ -209,7 +209,7 @@ const { magic_link } = await seam.customers.createPortal({
});

// Only "Premium Villa" is visible
console.log(magic_link.url);
console.log(customer_portal.url);
```
{% endtab %}

Expand Down Expand Up @@ -250,7 +250,7 @@ Filters also apply to reservations. Here, only reservations that are both premiu
{% tabs %}
{% tab title="JavaScript" %}
```javascript
const { magic_link } = await seam.customers.createPortal({
const { customer_portal } = await seam.customers.createPortal({
customer_data: {
customer_key: "customer_123",
property_listings: [
Expand Down Expand Up @@ -287,7 +287,7 @@ const { magic_link } = await seam.customers.createPortal({
});

// Only "Premium EU Reservation" is visible in the portal
console.log(magic_link.url);
console.log(customer_portal.url);
```
{% endtab %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The Seam Customer Portal is a hosted, pre-authenticated interface for managing d

### How it works

When you create a customer portal via the API, Seam returns a `magic_link` URL. This URL can be loaded in a standard HTML `<iframe>`. The portal is fully authenticated through a token embedded in the URL — no additional login is required from the end-user.
When you create a customer portal via the API, Seam returns a `customer_portal` URL. This URL can be loaded in a standard HTML `<iframe>`. The portal is fully authenticated through a token embedded in the URL — no additional login is required from the end-user.

Portal links expire after **7 days**. Your backend should generate a fresh link when rendering the page, or when the current link is close to expiring.

Expand Down Expand Up @@ -92,11 +92,11 @@ curl -X POST https://connect.getseam.com/customers/create_portal \
}'
```

The response includes a `magic_link` object:
The response includes a `customer_portal` object:

```json
{
"magic_link": {
"customer_portal": {
"url": "https://partner-ui.seam.vc/portals/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee?token=seam_cst_...",
"customer_key": "my-customer-123",
"expires_at": "2026-03-25T12:00:00.000Z",
Expand All @@ -108,7 +108,7 @@ The response includes a `magic_link` object:

### Step 2: Embed the URL in an iFrame

Use the `magic_link.url` as the `src` attribute of an iFrame in your frontend. The portal handles authentication automatically via the token in the URL.
Use the `customer_portal.url` as the `src` attribute of an iFrame in your frontend. The portal handles authentication automatically via the token in the URL.

```html
<iframe
Expand All @@ -121,7 +121,7 @@ Use the `magic_link.url` as the `src` attribute of an iFrame in your frontend. T
></iframe>
```

In practice, your backend generates the `magic_link.url` and passes it to your frontend, which sets it as the iFrame `src`. Don't hardcode the URL — it contains a session token that expires.
In practice, your backend generates the `customer_portal.url` and passes it to your frontend, which sets it as the iFrame `src`. Don't hardcode the URL — it contains a session token that expires.

### Step 3: Refresh the link before it expires

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@metalsmith/metadata": "^0.3.0",
"@prettier/plugin-php": "^0.24.0",
"@prettier/plugin-ruby": "^4.0.4",
"@seamapi/blueprint": "^0.53.2",
"@seamapi/blueprint": "^0.55.0",
"@seamapi/smith": "^0.5.2",
"@seamapi/types": "1.803.0",
"@seamapi/types": "1.805.0",
"@types/command-exists": "^1.2.3",
"change-case": "^5.4.4",
"command-exists": "^1.2.9",
Expand Down
Loading