fastify-xwhatconverts
profiles.update
Update a WhatConverts profile's name or URL.
profiles.update
Update an existing profile's name or URL.
Signature
fastify.xwhatconverts.profiles.update(
profileId: string,
params: {
profileName?: string;
profileUrl?: string;
}
): Promise<object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | ID of the profile to update. |
params.profileName | string | No | New display name for the profile. |
params.profileUrl | string | No | New website URL for the profile. |
Returns
The updated WhatConverts profile object.
Throws
[xWhatConverts] profiles.update: profileId is required— called withoutprofileId.[xWhatConverts] profiles.update: params object is required— called without a params object.[xWhatConverts] Network error: <message>— network-level failure.[xWhatConverts] API error: <status>— non-2xx response from WhatConverts.
Examples
Basic — rename a profile
const profile = await fastify.xwhatconverts.profiles.update("98765", {
profileName: "Main Website (Updated)",
});
console.log(profile.profile_name);
Realistic — update profile URL on site migration
fastify.patch("/profiles/:profileId/url", async (request, reply) => {
const { profileId } = request.params;
const { newUrl } = request.body;
const profile = await fastify.xwhatconverts.profiles.update(profileId, {
profileUrl: newUrl,
});
return { profileId: profile.profile_id, url: profile.profile_url };
});
See Also
- profiles.get — fetch the current state
- profiles.delete — delete a profile
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.profiles.update(profileId, params)
use-when: Update a WhatConverts profile's name or settings
params: profileId (string, required), profileName (string, required)
returns: updated WhatConverts profile object
