X Enterprises
fastify-xwhatconverts

profiles.create

Create a new WhatConverts profile under an account.

profiles.create

Create a new profile within an account. Profiles are what leads are tracked against and what holds the tracking numbers and settings.

Signature

fastify.xwhatconverts.profiles.create(params: {
  accountId: string;
  profileName: string;
  profileUrl?: string;
}): Promise<object>

Params

NameTypeRequiredDescription
accountIdstringYesID of the account to create the profile under.
profileNamestringYesDisplay name for the profile.
profileUrlstringNoWebsite URL for the profile.

Returns

The created WhatConverts profile object.

Throws

  • [xWhatConverts] profiles.create: params object is required — called without a params object.
  • [xWhatConverts] profiles.create: accountId is required — missing accountId.
  • [xWhatConverts] profiles.create: profileName is required — missing profileName.
  • [xWhatConverts] Network error: <message> — network-level failure.
  • [xWhatConverts] API error: <status> — non-2xx response from WhatConverts.

Examples

Basic — create a profile

const profile = await fastify.xwhatconverts.profiles.create({
  accountId: "555",
  profileName: "Main Website",
  profileUrl: "https://example.com",
});
console.log(profile.profile_id);

Realistic — create a profile during client onboarding

fastify.post("/onboard", async (request, reply) => {
  const { clientName, siteUrl } = request.body;

  const account = await fastify.xwhatconverts.accounts.create({
    accountName: clientName,
  });

  const profile = await fastify.xwhatconverts.profiles.create({
    accountId: account.account_id,
    profileName: `${clientName} — Primary`,
    profileUrl: siteUrl,
  });

  return reply.status(201).send({
    accountId: account.account_id,
    profileId: profile.profile_id,
  });
});

See Also

AI Context

package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.profiles.create(params)
use-when: Create a new WhatConverts profile (tracking container) under an account
params: accountId (string, required), profileName (string, required)
returns: created WhatConverts profile object
Copyright © 2026