---
title: "Create a Connection with QuickLink"
description: "Send one hosted link that connects a WhatsApp connection to your project."
canonical: "https://docs.polymorfa.com/connections/quicklink"
---
# Create a Connection with QuickLink

> Send one hosted link that connects a WhatsApp connection to your project.

A QuickLink is a hosted Polymorfa page behind a persistent URL. The person who
opens it confirms their phone number, chooses an allowed connection method, and
either pairs WhatsApp as a linked device or completes Meta signup. When they
confirm, the Connection appears in your project.

A link stays active until it connects a Connection or you cancel it. The URL is
the only credential the recipient needs, and it grants no messaging access.

## Before you begin

- **Real connections need Pay-As-You-Go.** A Free team can create QuickLinks for
  test connections only. Creating one for a real connection returns `409`
  `payg_required`; see [Free team limits](#free-team-limits).
- **Pairing needs credit.** Creating a link does not fund a Connection. Pairing
  reserves credit for the Connection's first 24-hour window; see
  [Fund linked-device pairing](#fund-linked-device-pairing).
- **Meta Cloud API needs access.** Meta Cloud API onboarding requires access
  for your team and an active project. See
  [Set up Meta Cloud API connections](https://docs.polymorfa.com/connections/cloud-api-setup).
- Frozen teams and inactive projects cannot start onboarding.

## Create a QuickLink

**Console:**

1. Open a project and go to **Connections**.
2. Select **New connection**, then **Send a QuickLink**.
3. Review the connection method, pairing methods, phone handling and history
   sync for this link.
4. Generate the link, then copy it, share it or show it as a QR code.

Console shows the link moving from **Opened** to **Linked** to **Connected**,
and adds the Connection to the list when the recipient confirms.

To pair a phone that is with you, choose **Link a real connection now** instead.
That pairing runs inside the Console dialog and cannot be shared. See
[Create a Connection in the Console](https://docs.polymorfa.com/connections/connect-in-console).

**API:**

Call [Create a QuickLink](https://docs.polymorfa.com/api/quicklinks/create-quick-link) from
your backend with a team key or project token that has `quicklink:manage`. A
project token already names its project and can send an empty JSON object. A
team key must send `projectId` when the team has more than one project.
`externalId` is your own reference; it appears on the new Connection and in its
webhook events.

```bash cURL
curl -X POST https://api.polymorfa.com/messaging/quicklinks \
  -H "Authorization: Bearer $POLYMORFA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "00000000-0000-4000-8000-000000000001",
    "externalId": "crm-account-42",
    "configuration": { "methods": ["qr", "pairing"] }
  }'
```

```typescript TypeScript
const created = await messaging.quickLinks.create({
  projectId: "00000000-0000-4000-8000-000000000001",
  externalId: "crm-account-42",
  configuration: { methods: ["qr", "pairing"] },
});

// Your application sends the URL to the person holding the phone over its own private channel; this is not an SDK method. Do not log it.
await sendToPhoneHolder(created.data.data.url);
console.log(created.data.data.connection);
```

```json
{
  "success": true,
  "data": {
    "id": "ql_0c1d8f2a3b4c5d6e7f80",
    "url": "https://www.polymorfa.com/connect/…",
    "connection": "739182640518203",
    "expiresAt": null
  }
}
```

Send `url` to the person holding the phone. Do not log it. `connection` is the
Connection ID you use in Messaging API paths once the link connects.

To assign the connected Connection to one of your customers, create a
[Customer pairing link](https://docs.polymorfa.com/customers/pairing-links) instead. It is durable, can
be locked to an expected phone number and issues a fresh QuickLink each time
it is opened.

## Choose the link's settings

Each link copies your saved [QuickLink settings](#saved-settings) when you
create it. You can override the connection and pairing choices for one link
under `configuration`. Page text, appearance, support, privacy, terms and
callback URLs always come from saved settings.

| To | Add |
| --- | --- |
| Offer only QR scanning or only phone pairing | `configuration.methods: ["qr"]` or `["pairing"]` |
| Choose which Linked Devices method opens first | `configuration.defaultMethod: "qr"` or `"pairing"`; `null` chooses by device |
| Pre-fill the recipient's phone number | `configuration.prefillPhone: "+15550001111"` |
| Let the recipient replace a pre-filled phone number | `configuration.allowPhoneChange: true` |
| Prefer or require a connection method | `configuration.connectionPreference` and `configuration.connectionEnforcement` |
| Change history consent for this link | `configuration.historySync.consent`: `ask`, `force_on` or `force_off` |
| Track the resulting Connection | `externalId`, copied to the Connection and its `connection.*` events |
| Assign the Connection to a Customer | `customerId`, with Customers enabled for the project |
| Set an initial spending limit and priority | `billingControls.limitCredits` and `billingControls.priority` |

Omitted fields inherit saved defaults. Unknown fields are rejected. For
example, offer phone pairing with history turned off:

```json
{
  "projectId": "00000000-0000-4000-8000-000000000001",
  "configuration": {
    "prefillPhone": "+15550001111",
    "connectionPreference": "linked",
    "connectionEnforcement": "prefer",
    "methods": ["pairing"],
    "historySync": { "consent": "force_off" }
  }
}
```

See [Create a QuickLink](https://docs.polymorfa.com/api/quicklinks/create-quick-link#create-quick-link-body)
for every field and limit.

### Connection preference

`connectionPreference` and `connectionEnforcement` decide which connection
cards the recipient sees. They are separate from the Linked Devices `methods`.
The default is `cloud` with `prefer`.

| Preference | Enforcement | Recipient sees |
| --- | --- | --- |
| `cloud` | `prefer` | Meta Cloud API first, Linked Devices second |
| `linked` | `prefer` | Linked Devices first, Meta Cloud API second |
| `both` | `prefer` | Both options with equal weight |
| `cloud` | `force` | Meta signup directly |
| `linked` | `force` | Linked-device pairing directly |

`both` cannot be forced, and it lets the recipient choose one connection; it
does not connect both. When Meta Cloud API onboarding is unavailable to your
team, the Meta Cloud API option is hidden and a forced `cloud` link cannot be
created.

### Pre-filled phone numbers

With `prefillPhone`, Polymorfa checks whether the phone number is registered on
WhatsApp before it creates the link. A phone number confirmed as unregistered returns
`400` `phone_not_registered`. When no connected Connection in your project can
answer the check, the link is created and the registration state stays unknown.
The same check runs when the recipient enters or changes a phone number on the page.

The connected Connection must match a pre-filled connection, including when the
recipient scans a QR code. A mismatch fails confirmation with `phone_mismatch`.
When `allowPhoneChange` is off, **Not you?** is hidden.

Brazilian mobile connections are checked with and without the ninth digit. When
both forms are registered, the recipient selects their account.

A connection confirmed as not registered on WhatsApp can still use Meta Cloud API
setup when the link allows that connection.

## What the recipient sees

The hosted page shows your business name, logo and accent color, then the
enabled methods:

- **Scan QR code** on a laptop or second device. The code refreshes until
  WhatsApp links.
- **Enter a code** on the phone itself. The recipient types their phone number,
  receives a one-time code, and enters it under **Link with phone number
  instead** in WhatsApp. Mobile browsers offer **Open WhatsApp**; the code is
  never part of that link.

Phones open on the pairing code when it is offered. Laptops follow
`defaultMethod` when set, otherwise they open on the QR code. A pre-filled
connection appears in an account card for confirmation. For a fixed connection,
opening phone pairing requests the code automatically. Before pairing starts, the page explains the history
setting and records the recipient's choice. After WhatsApp links, the page asks
the recipient to confirm. Cancelling before confirmation unlinks the device.
The confirmation step links to your privacy notice and terms when you add
them, and always to the
[QuickLink Terms](https://www.polymorfa.com/quicklink-terms) that the recipient
accepts by linking.

For Meta Cloud API, the page shows setup progress while Polymorfa runs
[readiness checks](https://docs.polymorfa.com/connections/cloud-api-setup#readiness-checks), then asks for
confirmation.

Recipients can switch between light and dark themes, and between English and
Brazilian Portuguese. The page starts in the browser's language when it is one
of those two.

## Track the connection

Use callback URLs, status polling, or both. Confirm the final state from the
Connection itself before you send.

### Callback URLs

Set success and failure URLs in the project's QuickLink settings. Each link
copies them when it is created; a creation request cannot change them.

- Confirmation opens the success URL.
- Cancellation opens the failure URL with `status=cancelled` and
  `reason=cancelled`.
- A failed connection opens the failure URL with `status=failed` and a reason
  such as `phone_mismatch` or `connection_failed`.

```text
https://app.acme.example/whatsapp/connected?quicklinkId=ql_example&connection=739182640518203&status=connected&historySync=true
https://app.acme.example/whatsapp/failed?quicklinkId=ql_example&reason=cancelled&connection=739182640518203&status=cancelled
```

The callback includes `externalId` when you supplied one. It can repeat across
links. Treat the query string as a hint: confirm the Connection with
[Get connection](https://docs.polymorfa.com/api/connections/get-connection) or its `connection.*` events.

### Status polling

**API:**

[Get a QuickLink](https://docs.polymorfa.com/api/quicklinks/get-quick-link) returns the link's
status to the credential that created it.

```bash cURL
curl "https://api.polymorfa.com/messaging/quicklinks/$QUICKLINK_ID" \
  -H "Authorization: Bearer $POLYMORFA_KEY"
```

```typescript TypeScript
const link = await messaging.quickLinks.retrieve("<quicklink-id>");
console.log(link.data.data.status, link.data.data.phone);
```

| Status | Meaning |
| --- | --- |
| `pending` | The link exists and has not been opened. |
| `opened` | The recipient opened the page. Phone confirmation can still be pending. |
| `linked` | Linked Devices: WhatsApp linked the device and the recipient has not confirmed. Meta Cloud API: the connection is connected to Meta and readiness checks are running. |
| `connected` | The recipient confirmed. `phone` holds the connected phone number in E.164. |
| `failed` | The connection could not finish. `errorCode` explains why. |
| `cancelled` | The recipient or the creator cancelled the link. |

An expired link returns `404`. If confirmation returns a temporary error, retry
confirmation while the link is valid; a retry does not repeat completed
onboarding.

After a temporary setup failure, retry the same active QuickLink. The retry keeps
its reserved Connection and setup identity and does not extend their deadlines. An
expired or stopped attempt stays unavailable; it is not replaced automatically.
Resume an unfinished test connection invitation through its original link instead of
creating a new one after an uncertain result.

## Fund linked-device pairing

Your team needs enough prepaid credit for the Connection's first 24-hour window.
Credit is reserved before pairing material is issued and consumed when WhatsApp
confirms the connection. Without funding, the page asks the recipient to
contact the sender, the pairing-code request returns `402`
`billing_credit_required`, and the link reports `failed` with that code. Add
credit or review the project's billing priority, then send a new link. See
[Billing](https://docs.polymorfa.com/billing).

## Free team limits

Free teams cannot create QuickLinks for real connections: creation returns `409`
`payg_required`. Linking a real connection beyond the team's allowance returns the
same code. QuickLinks for test connections and **Link a real connection now** in the
Console stay available within the allowance. See
[Free and Pay-As-You-Go teams](https://docs.polymorfa.com/teams#free-and-pay-as-you-go-teams).

## Cancel a QuickLink

**Console:**

While the **New connection** dialog shows the link, select **Cancel QuickLink**.
Closing the dialog does not cancel a link you sent. Only the member who created a Console link can inspect or cancel it. Console
does not generate a replacement while the current link is active.

**API:**

Call [Cancel a QuickLink](https://docs.polymorfa.com/api/quicklinks/cancel-quick-link). For an
initial real-connection link, `202` means Connection cleanup was requested; the Connection
stays in your project until cleanup finishes. Check its status before creating
a replacement.

```bash cURL
curl -X DELETE "https://api.polymorfa.com/messaging/quicklinks/$QUICKLINK_ID" \
  -H "Authorization: Bearer $POLYMORFA_KEY"
```

```typescript TypeScript
await messaging.quickLinks.cancel("<quicklink-id>");
```

Cancelling a link that adds a connection to an existing Connection leaves that
Connection in place. A connected link cannot be cancelled; manage the Connection
instead.

## Saved settings

Saved settings are the defaults every new link copies. Project settings
override team settings. Links that are still pending show the project's
current privacy notice link, so adding, changing or removing it also updates
them. Other saved defaults do not change links you already sent.

**Console:**

Open team or project **Settings → QuickLink**. You can:

- turn QuickLinks on or off for that scope;
- let recipients replace a pre-filled phone number, or keep it locked;
- choose the offered methods and which one opens first;
- write the headline, description and success message;
- add a support link, and privacy and terms links for the confirmation step;
- upload a logo or reuse the team logo or project icon, and set the accent,
  theme, corner shape and footer;
- set project success and failure callback URLs and the chat-history
  behavior.

The preview shows the hosted page as the recipient sees it. Empty fields keep
the standard wording.

**API:**

Use [Get QuickLink settings](https://docs.polymorfa.com/api/quicklinks/get-quick-link-settings)
and [Update QuickLink settings](https://docs.polymorfa.com/api/quicklinks/update-quick-link-settings).

*TypeScript:*

Read and change the team's settings with `platform.quickLinkSettings`, and a
project's with `project.quickLinkSettings`.

With an active Branded QuickLink add-on, you can hide **Powered by Polymorfa**
and use your own Meta app. Saving `hideWatermark: true` without the add-on
returns `402` `addon_required`. After the add-on ends, links show the
attribution again and your saved preference is kept. See
[When Branded QuickLink ends](https://docs.polymorfa.com/connections/cloud-api-setup#when-branded-quicklink-ends).

## Test connections

To create a test connection, add `configuration.testing` to the request. It sets
the simulated country, profile, account type, reply behavior and failure
scenario, and lists up to three fields the recipient may change with
`editable`. An empty list keeps every setting fixed. The page tells the
recipient the connection is simulated. To give the test connection simulated
history, [upload a history fixture](https://docs.polymorfa.com/testing/test-connections#add-simulated-history)
and pass its `fixtureId` as `configuration.testing.configuration.historyFixtureId`.

```json
{
  "projectId": "00000000-0000-4000-8000-000000000001",
  "configuration": {
    "testing": {
      "country": "BR",
      "configuration": {
        "profile": { "name": "Demo support" },
        "accountType": "business",
        "replyBehavior": "echo",
        "failureScenario": "none"
      },
      "editable": ["profile.name", "replyBehavior"]
    }
  }
}
```

Test connection limits and access are separate from real-connection onboarding. See
[Testing](https://docs.polymorfa.com/testing) and [Test connections](https://docs.polymorfa.com/testing/test-connections).

## See also

- [Start, stop and restart Connections](https://docs.polymorfa.com/connections/manage)
- [Set up Meta Cloud API connections](https://docs.polymorfa.com/connections/cloud-api-setup)
- [Customer pairing links](https://docs.polymorfa.com/customers/pairing-links)
- [Webhooks](https://docs.polymorfa.com/development/webhooks)
- [QuickLinks API reference](https://docs.polymorfa.com/api/quicklinks/create-quick-link)
