0

List of tasks

by
Published Oct 17, 2025

Retrieve a list of tasks associated with a specific contract. Each task contains details such as its ID, amount, submission date, status, and description. This endpoint is useful for tracking the progress and status of tasks related to contracts. **Token scopes**: `contracts:read`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * List of tasks
4
 * Retrieve a list of tasks associated with a specific contract. Each task contains details such as its ID, amount, submission date, status, and description. This endpoint is useful for tracking the progress and status of tasks related to contracts.
5
 **Token scopes**: `contracts:read`
6
 */
7
export async function main(auth: RT.Deel, contract_id: string) {
8
	const url = new URL(`https://api.letsdeel.com/rest/v2/contracts/${contract_id}/tasks`)
9

10
	const response = await fetch(url, {
11
		method: 'GET',
12
		headers: {
13
			Authorization: 'Bearer ' + auth.apiKey
14
		},
15
		body: undefined
16
	})
17
	if (!response.ok) {
18
		const text = await response.text()
19
		throw new Error(`${response.status} ${text}`)
20
	}
21
	return await response.json()
22
}
23