//native
/**
* Delete an Org Structure from the Organization
* Delete an Org Structure from the Organization
**Token scopes**: `organizations:write`
*/
export async function main(auth: RT.Deel, hrisOrgStr_id: string) {
const url = new URL(
`https://api.letsdeel.com/rest/v2/hris/organization_structures/${hrisOrgStr_id}`
)
const response = await fetch(url, {
method: 'DELETE',
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