import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const wireguardPeer = await client.wireguardPeers.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "wireguard_peer",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
"last_seen": "2018-02-02T22:25:27.521Z",
"wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
}Delete the WireGuard peer.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const wireguardPeer = await client.wireguardPeers.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "wireguard_peer",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
"last_seen": "2018-02-02T22:25:27.521Z",
"wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies the resource.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Successful response
Show child attributes
Identifies the resource.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Identifies the type of the resource. Identifies the type of the resource.
"wireguard_peer"
ISO 8601 formatted date-time indicating when the resource was created.
"2018-02-02T22:25:27.521Z"
ISO 8601 formatted date-time indicating when the resource was updated.
"2018-02-02T22:25:27.521Z"
The WireGuard PublicKey.<br /><br />If you do not provide a Public Key, a new Public and Private key pair will be generated for you.
"qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
ISO 8601 formatted date-time indicating when peer sent traffic last time.
"2018-02-02T22:25:27.521Z"
The id of the wireguard interface associated with the peer.
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Your WireGuard Interface.PrivateKey.<br /><br />This attribute is only ever utlised if, on POST, you do NOT provide your own public_key. In which case, a new Public and Private key pair will be generated for you. When your private_key is returned, you must save this immediately as we do not save it within Telnyx. If you lose your Private Key, it can not be recovered.
"qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
Was this page helpful?