Skip to content
KnockDevelopers
Magic links

Create a magic link

Chat with a Developer
POST
/v1/magic-links

Creates a chat or a scheduling link and returns it, with zero traffic. type decides which fields the body takes. A chat link is assigned by your default chat routing rule unless you send chatRoutingId. A scheduling link books through your default meeting routing rule unless you send meetingRoutingId, is titled after its name unless you send meetingTitle, and lasts 30 minutes unless you send durationMinutes.

Only chat and scheduling links can be created and changed here. A field of the other type fails validation and names the field, and so does an opening message the messaging app cannot show: welcomeMessage needs slack or telegram, and prefilledMessage whatsapp or linkedin.

A link made with an API key is recorded in Knock as created by that API key; one made through a connected AI assistant is made as the signed-in member. Send Content-Type: application/json. Unknown fields are ignored.

A create is not idempotent: retrying one makes a second link, so read your links before you retry.

Authorization

ApiKeyAuth
headerx-api-key<token>

Your Knock API key. Ask your Knock account team for one: a key with the Enrichment API role to enrich and route leads and find warm intros, the Viewer role to read chats, meetings, routing rules, FAQs, analytics, magic links, meeting routing rules, marketing cards and members, the Admin, Editor or AI Manager role to change FAQs, the Admin, Editor or Partner Contributor role to create marketing cards and wrap chat links, or the Admin role to set the working hours of your members.

Request Body

application/json
  1. body

A chat link to create.

name*string

Name of the link in Knock. Names need not be unique, but Meeting flow - no slots found is reserved by Knock. Leading and trailing whitespace is removed.

Length1 <= length <= 200
channel*enum<string>

Where the link is shared. qr_code, marketing_card and the *_ads channels cannot be set here:

  • website: Your website.
  • offline_event: An in-person event, such as a conference, trade show or meetup.
  • virtual_event: An online event, such as a webinar or virtual summit.
  • email: An email, such as a newsletter, a campaign or a signature.
  • linkedin: LinkedIn.
  • facebook: Facebook.
  • google_ads: Google ads.
  • tiktok: TikTok.
  • instagram: Instagram.
  • twitter: X (Twitter).
  • threads: Threads.
  • reddit: Reddit.
  • youtube: YouTube.
  • vimeo: Vimeo.
  • medium: Medium.
  • docs: Your product documentation.
  • product: Inside your product.
  • discord: Discord.
  • slack: Slack.
  • slack_community: A Slack community.
  • whatsapp: WhatsApp.
  • telegram: Telegram.
  • g2: G2.
  • capterra: Capterra.
  • trustpilot: Trustpilot.
  • product_hunt: Product Hunt.
  • crunchbase: Crunchbase.
  • merchandise: Printed material or merchandise.
  • aws_marketplace: AWS Marketplace.
  • azure_marketplace: Azure Marketplace.
  • google_cloud_marketplace: Google Cloud Marketplace.
  • atlassian_marketplace: Atlassian Marketplace.
  • salesforce_appexchange: Salesforce AppExchange.
  • hubspot_marketplace: HubSpot Marketplace.
  • slack_app_directory: Slack App Directory.
  • microsoft_appsource: Microsoft AppSource.
  • github_marketplace: GitHub Marketplace.
  • gitlab_marketplace: GitLab Marketplace.
  • snowflake_marketplace: Snowflake Marketplace.
  • hashicorp_marketplace: HashiCorp Marketplace.
  • webflow_marketplace: Webflow Marketplace.
  • other_marketplace: Another marketplace.
  • other: Anywhere else, including channels Knock no longer offers.
Show 43 valuesHide values
websiteoffline_eventvirtual_eventemaillinkedinfacebookgoogle_adstiktokinstagramtwitterthreadsreddityoutubevimeomediumdocsproductdiscordslackslack_communitywhatsapptelegramg2capterratrustpilotproduct_huntcrunchbasemerchandiseaws_marketplaceazure_marketplacegoogle_cloud_marketplaceatlassian_marketplacesalesforce_appexchangehubspot_marketplaceslack_app_directorymicrosoft_appsourcegithub_marketplacegitlab_marketplacesnowflake_marketplacehashicorp_marketplacewebflow_marketplaceother_marketplaceother
messagingApp*enum<string>

Only on a chat link. The messaging app the chat opens in. It cannot be changed later:

  • slack: Slack.
  • whatsapp: WhatsApp.
  • linkedin: LinkedIn.
  • telegram: Telegram.
Show 4 valuesHide values
slackwhatsapplinkedintelegram
chatRoutingId?string

Only on a chat link. The chat routing rule that assigns its chats, from GET /v1/chat-routing-rules. Without it, your default rule.

Formatuuid
prefilledMessage?string

Only on a chat link. The contact's first message, prefilled in the app. Only when messagingApp is whatsapp or linkedin.

Length2 <= length <= 1000
welcomeMessage?string

Only on a chat link. The first message the contact gets. Only when messagingApp is slack or telegram.

Length2 <= length <= 1000
type*"chat"

A chat link.

Value in"chat"

Response Body

The magic link you created.

application/json
  1. response

A link your team shares, with its traffic and settings.

magicLinkId*string

ID of the link: 6 letters or digits, case-sensitive.

Match^[0-9A-Za-z]{6}$
name*string

Name of the link in Knock.

type*enum<string>

What the link opens:

  • chat: Opens a chat with your team on one messaging app.
  • scheduling: Opens a booking window for a meeting with your team.
  • modal: Opens a window that lets the contact choose how to reach your team. Read-only here.
  • marketing_card: The link of a marketing card. Read-only here: change it through its card.
  • personal: A team member's personal link. Read-only here.
Show 5 valuesHide values
chatschedulingmodalmarketing_cardpersonal
channel*enum<string>

Where the link is shared:

  • website: Your website.
  • offline_event: An in-person event, such as a conference, trade show or meetup.
  • virtual_event: An online event, such as a webinar or virtual summit.
  • email: An email, such as a newsletter, a campaign or a signature.
  • linkedin: LinkedIn.
  • linkedin_ads: LinkedIn ads.
  • facebook: Facebook.
  • facebook_ads: Facebook ads.
  • google_ads: Google ads.
  • tiktok: TikTok.
  • tiktok_ads: TikTok ads.
  • instagram: Instagram.
  • twitter: X (Twitter).
  • threads: Threads.
  • reddit: Reddit.
  • youtube: YouTube.
  • vimeo: Vimeo.
  • medium: Medium.
  • docs: Your product documentation.
  • product: Inside your product.
  • discord: Discord.
  • slack: Slack.
  • slack_community: A Slack community.
  • whatsapp: WhatsApp.
  • telegram: Telegram.
  • g2: G2.
  • capterra: Capterra.
  • trustpilot: Trustpilot.
  • product_hunt: Product Hunt.
  • crunchbase: Crunchbase.
  • merchandise: Printed material or merchandise.
  • qr_code: A QR code.
  • aws_marketplace: AWS Marketplace.
  • azure_marketplace: Azure Marketplace.
  • google_cloud_marketplace: Google Cloud Marketplace.
  • atlassian_marketplace: Atlassian Marketplace.
  • salesforce_appexchange: Salesforce AppExchange.
  • hubspot_marketplace: HubSpot Marketplace.
  • slack_app_directory: Slack App Directory.
  • microsoft_appsource: Microsoft AppSource.
  • github_marketplace: GitHub Marketplace.
  • gitlab_marketplace: GitLab Marketplace.
  • snowflake_marketplace: Snowflake Marketplace.
  • hashicorp_marketplace: HashiCorp Marketplace.
  • webflow_marketplace: Webflow Marketplace.
  • other_marketplace: Another marketplace.
  • marketing_card: The link of a marketing card. Read-only: it is never accepted on a write.
  • other: Anywhere else, including channels Knock no longer offers.
Show 48 valuesHide values
websiteoffline_eventvirtual_eventemaillinkedinlinkedin_adsfacebookfacebook_adsgoogle_adstiktoktiktok_adsinstagramtwitterthreadsreddityoutubevimeomediumdocsproductdiscordslackslack_communitywhatsapptelegramg2capterratrustpilotproduct_huntcrunchbasemerchandiseqr_codeaws_marketplaceazure_marketplacegoogle_cloud_marketplaceatlassian_marketplacesalesforce_appexchangehubspot_marketplaceslack_app_directorymicrosoft_appsourcegithub_marketplacegitlab_marketplacesnowflake_marketplacehashicorp_marketplacewebflow_marketplaceother_marketplacemarketing_cardother
messagingApps*array<>

Messaging apps the link opens. Empty for a scheduling link:

  • slack: Slack.
  • whatsapp: WhatsApp.
  • linkedin: LinkedIn.
  • telegram: Telegram.
Show 4 valuesHide values
slackwhatsapplinkedintelegram
chatRoutingId*|

ID of the chat routing rule that assigns its chats, from GET /v1/chat-routing-rules. Null unless the link is a chat or modal link.

Formatuuid
url*|

The link to share. Null for a marketing_card or personal link, and for a modal link that has no window set up.

traffic*

Traffic of the link.

hasTraffic*boolean

Whether any of clicks, chats or opportunities is above zero. A link with traffic cannot be deleted.

createdAt*string

When the link was created.

Formatdate-time
chatSettings*|null

Settings of a chat link. Null for every other type.

schedulingSettings*|null

Settings of a scheduling link. Null for every other type.

Example Request
curl -X POST 'https://app.knock-ai.com/v1/magic-links' \  -H 'x-api-key: <YOUR_API_KEY>' \  -H 'Content-Type: application/json' \  -d '{  "name": "Webinar",  "channel": "website",  "messagingApp": "slack",  "type": "chat"}'
Example Response
{  "magicLinkId": "aB3dE9",  "name": "Webinar",  "type": "chat",  "channel": "website",  "messagingApps": [    "slack"  ],  "chatRoutingId": "3c5e7a9b-1d2f-4a6b-8c0d-2e4f6a8b0c1d",  "url": "https://start-chat.com/slack/yourcompany/aB3dE9",  "traffic": {    "clicks": 120,    "chats": 14,    "opportunities": 3  },  "hasTraffic": true,  "createdAt": "2026-11-02T12:00:00.000Z",  "chatSettings": {    "prefilledMessage": "Hi, I would like to see a demo.",    "welcomeMessage": "Thanks for reaching out! How can we help?"  },  "schedulingSettings": {    "meetingRoutingId": "7d9f1b3c-5e7a-4b6c-9d0e-1f2a3b4c5d6e",    "meetingTitle": "Product demo",    "meetingType": "demo",    "durationMinutes": 30,    "title": "Book a demo",    "subtitle": "Pick a time that works for you."  }}