fastify-xwhatconverts
profiles.delete
Delete a WhatConverts profile by ID.
profiles.delete
Delete a profile by its WhatConverts ID. Also accessible as profiles.remove.
Signature
fastify.xwhatconverts.profiles.delete(profileId: string): Promise<object>
// alias
fastify.xwhatconverts.profiles.remove(profileId: string): Promise<object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | ID of the profile to delete. |
Returns
A WhatConverts deletion result object.
Throws
[xWhatConverts] profiles.delete: profileId is required— called withoutprofileId.[xWhatConverts] Network error: <message>— network-level failure.[xWhatConverts] API error: <status>— non-2xx response;404if profile not found.
Examples
Basic — delete a profile
await fastify.xwhatconverts.profiles.delete("98765");
Realistic — clean up unused profiles
fastify.delete("/profiles/:profileId", async (request, reply) => {
const { profileId } = request.params;
try {
await fastify.xwhatconverts.profiles.delete(profileId);
return reply.status(204).send();
} catch (err) {
if (err.statusCode === 404) {
return reply.status(404).send({ error: "Profile not found" });
}
throw err;
}
});
See Also
- profiles.get — verify a profile before deleting
- profiles.list — list profiles to find IDs
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.profiles.delete(profileId)
use-when: Permanently delete a WhatConverts profile by ID
params: profileId (string, required)
returns: deletion confirmation object
