Create account
Creates a provider account. Supported provider names include telegram, whatsapp, twitter, line, and zalo. Use the auth_mode that matches the account connection flow. When the chosen provider plus auth_mode pairs require a phone number (for example WhatsApp with auth_mode=code), the number must be supplied here through provider_data.phone — it is persisted on the account and automatically replayed for subsequent authentication actions.
https://api.unifyport.ai/v1/accountsHeaders
X-Api-KeyWorkspace API key. The workspace is resolved from this header.
Content-TypeUse application/json when sending a JSON request body.
Path parameters
This endpoint has no path parameters.
Request body
nameHuman-readable account name.
providerProvider identifier such as telegram, whatsapp, line, or zalo.
regionProvider region used for allocation. Pick a region reported as allocatable: true by List provider regions.
auth_modeAuthentication flow: code, qrcode, or session.
provider_dataProvider-specific configuration. Keep secret values out of logs.
metadataPlatform-side metadata for environment labels.
Response body
idUnique account identifier (acc_...). Use it in account-scoped routes.
nameHuman-readable account name.
providerProvider identifier such as telegram, whatsapp, line, twitter, or zalo.
regionProvider region the account is allocated to.
statusAccount lifecycle state, such as active.
runtime_statusNormalized runtime state: one of unknown, starting, running, stopping, stopped, reconnecting, disconnected, or error.
auth_modeAuthentication flow used by the account: code, qrcode, or session.
capabilitiesCapabilities enabled for the account, such as send_message and receive_message.
provider_account_refProvider-side identifier you can attach to correlate the account with your own system.
Responses
201Request succeeded. See the example response body.
400The request body, path, or parameters are invalid.
401The X-Api-Key header is missing or invalid.
409The requested operation conflicts with an existing provider account or resource.
500The service encountered an unexpected error.
Request
curl -X POST https://api.unifyport.ai/v1/accounts \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Telegram Production",
"provider": "telegram",
"region": "global",
"status": "active",
"auth_mode": "qrcode",
"capabilities": ["send_message", "receive_message"],
"provider_data": {},
"metadata": {
"env": "production"
},
"provider_account_ref": "provider-side-identifier"
}'Response
{
"data": {
"id": "acc_example",
"name": "Telegram Production",
"provider": "telegram",
"region": "global",
"status": "active",
"runtime_status": "stopped",
"auth_mode": "qrcode",
"capabilities": ["send_message", "receive_message"],
"provider_account_ref": "provider-side-identifier"
}
}