//native
/**
* Delete worker access token
* Deletes the worker access token
**Token scopes**: `admin:worker`
*/
export async function main(auth: RT.Deel, worker_id: string) {
const url = new URL(`https://api.letsdeel.com/rest/v2/workers/${worker_id}/session`)
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.text()
}
Submitted by hugo697 235 days ago