Skip to main content

Create a Consultation Link


Step 1: Endpoint

POST https://api-staging.tenang.ai/chat-link


Step 2: Request Headers

HeaderTypeDescription
x-signaturestringHMAC signature to verify the request integrity
x-api-keystringTenant API key for authentication

Step 3: Request Body

Send a JSON object with the following fields:

{
"tenantId": "tenant-123",
"username": "johndoe",
"externalId": "28819921",
"userKey": "user-456",
"email": "john.doe@example.com",
"phoneNumber": "+123456789",
"employersName": "ABC Corp",
"insurersName": "XYZ Insurance",
"policyNumber": "POL123456",
"ip": "IP0",
"type": "CHAT"
}

Step 4: Response

Example of a successful response:

{
"statusCode": 201,
"message": "Success create ChatLink",
"data": {
"id": "22a61931-5990-498c-bb56-a6342ba02ed4",
"username": "tenant Test 2",
"phoneNumber": "string",
"externalId": "28819921",
"employersName": "string",
"insurersName": "string",
"policyNumber": "string",
"ip": "IP0",
"type": "CHAT",
"uniqueId": "7267ab28-c262-4e8b-a350-cb09b7727eeb",
"chatLinkUrl": "https://consultation-staging.tenang.ai/chat/7267ab28-c262-4e8b-a350-cb09b7727eeb?tk=..."
}
}

Step 5: Error Responses

Status CodeMessageDescription
400Invalid request dataRequest body is missing fields or malformed
401UnauthorizedAPI key or signature is missing or invalid
403ForbiddenNo permission to create consultation link
500Internal Server ErrorUnexpected error on the server

🔐 Security Considerations

  • x-signature: HMAC signature generated using tenant's secret key
  • x-api-key: Used to authenticate and authorize tenant

For more assistance, contact the TenangAI API support team.