Steps to create a machine with API and make sure the status is set as VERIFIED when testing the connection
91
Created On 11/10/26 10:58 AM - Last Modified 11/10/26 16:03 PM
Symptom
When creating a machine with API, the current behavior is machine will be created with status UNVERIFIED unless we write the credentials and test the connection in the UI. Using the API, there is a way to do this, with the API but require to follow the steps described here.
Environment
VaaS/TLSPC TLSPC
Resolution
Step 1: Get Public Key
Method: GET
URL: https://api.venafi.cloud/v1/edgeencryptionkeys/<VSatelliteID>
Header: tppl-api-key: Your-API-Key
You get <VSatelliteID> value with: https://developer.venafi.com/tlsprotectcloud/reference/edgeencryptionkeys_getall
Step 2: Encrypt Credentials
Using the public key "Key" from Step 1, we will encrypt the username and password:
- Decode the Public Key to Bytes
- Convert Credentials (username and Password) into bytes
- Encrypt the credentials using the public key
- Base 64 encode the encrypted Username and Password
We have a script that uses SealedBox from Python to do this:
import base64
from nacl.public import PublicKey, SealedBox
# 1. The exact key from your Postman API response
public_key_b64 = ""
# 2. Your plaintext credentials (keep the 'b' prefix!)
plaintext_username = b"INSERTUSERNAME"
plaintext_password = b"INSERTPASSWORD"
# Load the key directly (it is already Curve25519)
public_key_bytes = base64.b64decode(public_key_b64)
sealed_box = SealedBox(PublicKey(public_key_bytes))
# Encrypt the credentials
encrypted_username = sealed_box.encrypt(plaintext_username)
encrypted_password = sealed_box.encrypt(plaintext_password)
# Base64 encode for Postman
final_username = base64.b64encode(encrypted_username).decode('utf-8')
final_password = base64.b64encode(encrypted_password).decode('utf-8')
print("\n--- Copy these into your Postman JSON Body ---")
print(f'"username": "{final_username}"')
print(f'"password": "{final_password}"')
Step 3: Create Machine
Use the regural API to create a machine: https://developer.venafi.com/tlsprotectcloud/reference/machines_create
Make sure username and password are the encrypted values from Step 2. Also, make sure status is set as VERIFIED.
Step 4: wsClient
In PowerShell run: [guid]::NewGuid()
Use that Guid to open a web socket connection wss://api.venafi.cloud/ws/notificationclients/<GUID>
Make sure to include the apikey and Key = Origin and Value = https://api.venafi.cloud
Then connect.
Step 5: Test Connection
POST https://api.venafi.cloud/v1/machines/<machineID>
{
"workflowName":"testConnection",
"workflowInput":{
"wsClientId":"<GUID>"
}
}
The GUID value is the one from Step 4.
You can get the machine ID from: https://developer.venafi.com/tlsprotectcloud/reference/machines_getall
Step 6: Verify on the UI
Log in to CM SaaS and check machine status will see VERIFIED