0

Update Record by ID

by
Published Oct 17, 2025

This API updates a specific record displayed in a report of a Zoho Creator application. The record is identified by its ID value. The update operation is subject to data validations configured for the corresponding form.

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
 * Update Record by ID
8
 * This API updates a specific record displayed in a report of a Zoho Creator application. The record is identified by its ID value. The update operation is subject to data validations configured for the corresponding form.
9
 */
10
export async function main(
11
  auth: Zoho,
12
  account_owner_name: string,
13
  app_link_name: string,
14
  report_link_name: string,
15
  record_ID: string,
16
  body: {
17
    result?: {
18
      fields?: string[];
19
      message?: false | true;
20
      tasks?: false | true;
21
    };
22
    data?: {};
23
    skip_workflow?: {}[];
24
  },
25
) {
26
  const url = new URL(
27
    `${auth.baseUrl}/creator/v2.1/data/${account_owner_name}/${app_link_name}/report/${report_link_name}/${record_ID}`,
28
  );
29

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