0

Add Records

by
Published Oct 17, 2025

This API adds one or more records to a form in your Zoho Creator application. Subject to validations, each JSON object in the input file will be added as a record. A maximum of 200 records can be created per request.

Script zoho Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Zoho = {
3
  token: string;
4
  baseUrl: string;
5
};
6
/**
7
 * Add Records
8
 * This API adds one or more records to a form in your Zoho Creator application. Subject to validations, each JSON object in the input file will be added as a record. A maximum of 200 records can be created per request.
9
 */
10
export async function main(
11
  auth: Zoho,
12
  account_owner_name: string,
13
  app_link_name: string,
14
  form_link_name: string,
15
  body: {
16
    result?: {
17
      fields?: string[];
18
      message?: false | true;
19
      tasks?: false | true;
20
    };
21
    data?: {}[];
22
  },
23
) {
24
  const url = new URL(
25
    `${auth.baseUrl}/creator/v2.1/data/${account_owner_name}/${app_link_name}/form/${form_link_name}`,
26
  );
27

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