//native
type Telnyx = {
apiKey: string
}
/**
* Update a credential connection registration status
* Updates the registration_status for a credential connection, this endpoint also updates the `registration_status` and `registration_status_updated_at` fields in the credential connection
*/
export async function main(auth: Telnyx, id: string) {
const url = new URL(
`https://api.telnyx.com/v2/credential_connections/${id}/actions/check_registration_status`
)
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 428 days ago