//native
/**
* Clean up plan for a given legal entity
* Clean up plan for a given legal entity
**Token scopes**: `benefits:write`
*/
export async function main(auth: RT.Deel, id: string) {
const url = new URL(
`https://api.letsdeel.com/rest/v2/benefits/legal-entities/${id}/401k/plans/clean-up`
)
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago