0

Update maintenance run

by
Published Oct 17, 2025

Update the maintenance run with the provided ID. Updates from this endpoint are asynchronous. To check your update's status, use the [Retrieve maintenance run](https://api-docs.render.com/reference/retrieve-maintenance) endpoint.

Script render Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Render = {
3
	apiKey: string
4
}
5
/**
6
 * Update maintenance run
7
 * Update the maintenance run with the provided ID.
8

9
Updates from this endpoint are asynchronous. To check your update's status, use the [Retrieve maintenance run](https://api-docs.render.com/reference/retrieve-maintenance) endpoint.
10

11
 */
12
export async function main(
13
	auth: Render,
14
	maintenanceRunParam: string,
15
	body: { scheduledAt?: string }
16
) {
17
	const url = new URL(`https://api.render.com/v1/maintenance/${maintenanceRunParam}`)
18

19
	const response = await fetch(url, {
20
		method: 'PATCH',
21
		headers: {
22
			'Content-Type': 'application/json',
23
			Authorization: 'Bearer ' + auth.apiKey
24
		},
25
		body: JSON.stringify(body)
26
	})
27
	if (!response.ok) {
28
		const text = await response.text()
29
		throw new Error(`${response.status} ${text}`)
30
	}
31
	return await response.text()
32
}
33