//native
type Clerk = {
apiKey: string;
};
/**
* Update a sign-up
* Update the sign-up with the given ID
*/
export async function main(
auth: Clerk,
id: string,
body: { external_id?: string },
) {
const url = new URL(`https://api.clerk.com/v1/sign_ups/${id}`);
const response = await fetch(url, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.apiKey,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago