//native
type Telnyx = {
apiKey: string
}
/**
* Update the amount of allocatable global outbound channels allocated to a specific managed account.
* Update the amount of allocatable global outbound channels allocated to a specific managed account.
*/
export async function main(auth: Telnyx, id: string, body: { channel_limit?: number }) {
const url = new URL(
`https://api.telnyx.com/v2/managed_accounts/${id}/update_global_channel_limit`
)
const response = await fetch(url, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago