0

Create a project status

by
Published Oct 17, 2025

Creates a new project status. Permissions and other requirements SubscriptionProjects Basic Project Tracking and General Ledger (enable the Projects dimension) User typeBusiness, Project Manager PermissionsAdd Project Status

Script sage_intacct Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type SageIntacct = {
3
	token: string
4
}
5
/**
6
 * Create a project status
7
 * Creates a new project status.
8

9

10
Permissions and other requirements
11

12
SubscriptionProjects Basic Project Tracking and General Ledger (enable the Projects dimension)
13
User typeBusiness, Project Manager
14
PermissionsAdd Project Status
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		description?: string
26
		disableTimesheetEntry?: false | true
27
		disableExpenseEntry?: false | true
28
		disablePurchasingAPEntry?: false | true
29
		disableGenerateInvoice?: false | true
30
		status?: 'active' | 'inactive'
31
		entity?: { key?: string; id?: string; name?: string; href?: string }
32
		audit?: {
33
			createdDateTime?: string
34
			modifiedDateTime?: string
35
			createdBy?: string
36
			modifiedBy?: string
37
		}
38
		href?: string
39
	} & {}
40
) {
41
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/projects/project-status`)
42

43
	const response = await fetch(url, {
44
		method: 'POST',
45
		headers: {
46
			'Content-Type': 'application/json',
47
			Authorization: 'Bearer ' + auth.token
48
		},
49
		body: JSON.stringify(body)
50
	})
51
	if (!response.ok) {
52
		const text = await response.text()
53
		throw new Error(`${response.status} ${text}`)
54
	}
55
	return await response.json()
56
}
57