fastify-xwhatconverts
accounts.delete
Delete a WhatConverts account and all its profiles, leads, and numbers. Requires Agency Key.
accounts.delete
Delete an account and all associated data (profiles, leads, numbers, settings). This is irreversible. Requires an Agency (Master) API Key.
Also accessible as accounts.remove.
Signature
fastify.xwhatconverts.accounts.delete(accountId: string): Promise<object>
// alias
fastify.xwhatconverts.accounts.remove(accountId: string): Promise<object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | ID of the account to delete. |
Returns
A result object containing the deleted account_id.
Throws
[xWhatConverts] accounts.delete: accountId is required— called withoutaccountId.[xWhatConverts] Network error: <message>— network-level failure.[xWhatConverts] API error: <status>— non-2xx response;404if account not found.
Examples
Basic — delete an account
const result = await fastify.xwhatconverts.accounts.delete("555");
console.log(result.account_id); // deleted ID
Realistic — offboard a client account
fastify.delete("/clients/:accountId", async (request, reply) => {
const { accountId } = request.params;
try {
await fastify.xwhatconverts.accounts.delete(accountId);
return reply.status(204).send();
} catch (err) {
if (err.statusCode === 404) {
return reply.status(404).send({ error: "Account not found" });
}
throw err;
}
});
See Also
- accounts.get — verify the account before deleting
- accounts.list — list accounts to find IDs
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.accounts.delete(accountId)
use-when: Permanently delete a WhatConverts account — requires Agency (Master) API key
params: accountId (string, required)
returns: deletion confirmation object
