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
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.
apiKeyheader
x-api-key<token>application/json- body
namespaceId*NamespaceIdMatch
^ns_[0-9a-hjkmnp-tv-z]{16,24}$redirectUrl?|nullmetadata?|nullexpiresAt?string|nullCreatedWhatsAppSetupLink
application/json- response
id*WhatsAppSetupLinkIdMatch
^wasl_[0-9a-hjkmnp-tv-z]{16,24}$organizationId*OrganizationIdMatch
^org_[0-9a-hjkmnp-tv-z]{16,24}$namespaceId*NamespaceIdMatch
^ns_[0-9a-hjkmnp-tv-z]{16,24}$status*WhatsAppSetupLinkStatusValue in
"pending""completed""revoked""expired"redirectUrl*string|nullmetadata*expiresAt*stringbusinessAccountId*|nullcompletedAt*string|nullrevokedAt*string|nullcreatedAt*stringupdatedAt*stringurl*stringimport { 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"
}