//native
type Basistheory = {
apiKey: string;
};
/**
* Tenant Members Update Member
* Tenant Members Update Member
*/
export async function main(
auth: Basistheory,
memberId: string,
body: { role?: string },
) {
const url = new URL(
`https://api.basistheory.com/tenants/self/members/${memberId}`,
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
"BT-API-KEY": 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 235 days ago