X Enterprises
fastify-xwhatconverts

accounts.get

Fetch a single WhatConverts account by ID. Requires Agency Key.

accounts.get

Fetch a single account by its WhatConverts ID. Requires an Agency (Master) API Key.

Signature

fastify.xwhatconverts.accounts.get(accountId: string): Promise<object>

Params

NameTypeRequiredDescription
accountIdstringYesThe WhatConverts account ID.

Returns

A WhatConverts account object.

Throws

  • [xWhatConverts] accounts.get: accountId is required — called without accountId.
  • [xWhatConverts] Network error: <message> — network-level failure.
  • [xWhatConverts] API error: <status> — non-2xx response; 404 if account not found.

Examples

Basic — fetch an account

const account = await fastify.xwhatconverts.accounts.get("555");
console.log(account.account_name);

Realistic — verify account exists before creating a profile

fastify.post("/setup/:accountId/profile", async (request, reply) => {
  const account = await fastify.xwhatconverts.accounts.get(request.params.accountId);

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

  return { profileId: profile.profile_id };
});

See Also

AI Context

package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.accounts.get(accountId)
use-when: Fetch a single WhatConverts account by ID
params: accountId (string, required)
returns: WhatConverts account object
Copyright © 2026