0

Create an entity transfer

by
Published Oct 17, 2025

__Deprecated__ Please run [Request a service transfer](https://techdocs.akamai.com/linode-api/reference/post-service-transfer). > --- - __OAuth scopes__. ``` account:read_write ``` [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * Create an entity transfer
7
 * __Deprecated__ Please run [Request a service transfer](https://techdocs.akamai.com/linode-api/reference/post-service-transfer).
8

9

10
>
11

12
---
13

14

15
- __OAuth scopes__.
16

17
    ```
18
    account:read_write
19
    ```
20

21
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
22
 */
23
export async function main(
24
  auth: Linode,
25
  apiVersion: "v4" | "v4beta",
26
  body: { entities: { linodes?: number[] } },
27
) {
28
  const url = new URL(
29
    `https://api.linode.com/${apiVersion}/account/entity-transfers`,
30
  );
31

32
  const response = await fetch(url, {
33
    method: "POST",
34
    headers: {
35
      "Content-Type": "application/json",
36
      Authorization: "Bearer " + auth.token,
37
    },
38
    body: JSON.stringify(body),
39
  });
40
  if (!response.ok) {
41
    const text = await response.text();
42
    throw new Error(`${response.status} ${text}`);
43
  }
44
  return await response.json();
45
}
46