0

Request to delete your user data from Greip

by
Published Apr 8, 2025

In some cases, such as data protection regulations, businesses that process personal data are required to delete it upon request. Using this method, you’ll be able to delete all data related to your user in a single request.

Script greip Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Greip = {
3
  apiKey: string;
4
};
5
/**
6
 * Request to delete your user data from Greip
7
 * In some cases, such as data protection regulations, businesses that process personal data are required to delete it upon request.
8

9
Using this method, you’ll be able to delete all data related to your user in a single request.
10
 */
11
export async function main(auth: Greip, body: { value?: string }) {
12
  const url = new URL(`https://greipapi.com/account/users/delete`);
13

14
  const response = await fetch(url, {
15
    method: "DELETE",
16
    headers: {
17
      "Content-Type": "application/json",
18
      Authorization: "Bearer " + auth.apiKey,
19
    },
20
    body: JSON.stringify(body),
21
  });
22
  if (!response.ok) {
23
    const text = await response.text();
24
    throw new Error(`${response.status} ${text}`);
25
  }
26
  return await response.text();
27
}
28