Skip to Content

Create a WhatsApp setup link

Creates a single-use link your customer opens to connect their WhatsApp number into the namespace, without a Samva account.

POST
/v1/whatsapp/setup-links

Creates a single-use link your customer opens to connect their WhatsApp number into the namespace, without a Samva account. The response carries the link's URL once; Samva keeps only a digest of its token. The link expires at expiresAt, at most 30 days ahead and 7 days when omitted.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
namespaceId*NamespaceId
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$
redirectUrl?|null
metadata?|null
expiresAt?string|null

Response Body

CreatedWhatsAppSetupLink

application/json
  1. response
id*WhatsAppSetupLinkId
Match^wasl_[0-9a-hjkmnp-tv-z]{16,24}$
organizationId*OrganizationId
Match^org_[0-9a-hjkmnp-tv-z]{16,24}$
namespaceId*NamespaceId
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$
status*WhatsAppSetupLinkStatus
Value in"pending""completed""revoked""expired"
redirectUrl*string|null
metadata*
expiresAt*string
businessAccountId*|null
completedAt*string|null
revokedAt*string|null
createdAt*string
updatedAt*string
url*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.whatsappSetupLinks.create({
  "namespaceId": "example"
});
Example Response
{
  "id": "string",
  "organizationId": "string",
  "namespaceId": "string",
  "status": "pending",
  "redirectUrl": "string",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "expiresAt": "string",
  "businessAccountId": "string",
  "completedAt": "string",
  "revokedAt": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "url": "string"
}

Related documentation