Update a Viber bot
const url = 'https://api.siprtc.io/v1/Accounts/example/Integrations/Viber/bots/example';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"account_id":"","auth_token":"","bot_avatar":"https://example.com/avatar.png","bot_id":"","bot_name":"Acme Support","metadata":{"aiAgentId":"","aiEnabled":false,"applicationId":1234,"queueSid":"","workflowSid":"","workspaceSid":""},"webhook_sid":""}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siprtc.io/v1/Accounts/example/Integrations/Viber/bots/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "account_id": "", "auth_token": "", "bot_avatar": "https://example.com/avatar.png", "bot_id": "", "bot_name": "Acme Support", "metadata": { "aiAgentId": "", "aiEnabled": false, "applicationId": 1234, "queueSid": "", "workflowSid": "", "workspaceSid": "" }, "webhook_sid": "" }'Changes a Viber bot’s stored settings. Every field is optional and an empty one keeps the stored value; metadata, when sent, replaces the routing metadata as a whole and must carry applicationId > 0 (and aiAgentId when aiEnabled). bot_id cannot be changed. account_id moves the bot to one of the caller’s direct sub-accounts. webhook_sid moves it to another platform webhook not used by another bot. Viber is not called: a new auth_token is stored as given, without being checked or encrypted, and the bot’s Viber webhook is not set again. To rotate a bot’s token, use PUT …/Integrations/Channels/{connection_id}/Credentials, which checks it with Viber and re-registers the webhook. A rename here does not change the channel connection’s display_name. Authentication: HTTP Basic with the account’s Auth ID and Auth Secret. Access is by the authenticated account, not the path: a bot is visible to the account that handles it (account_id) and to that account’s parent (parent_auth_id); for anyone else it is 404. {auth_id} should be the authenticated account’s Auth ID.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of the authenticated account
Viber bot id (bot_id; for a bot connected through the Channels API, the connection’s provider_sender)
Request Bodyrequired
Section titled “ Request Bodyrequired ”Fields to change
object
AccountID lets a parent account connect a bot for one of its sub-accounts; empty means the account in the path.
Example
AuthToken replaces the stored Viber token as given; empty keeps the current one.
Example
BotAvatar is the new avatar URL; empty keeps the current one.
Example
https://example.com/avatar.pngBotID on update must be empty or equal to the bot id in the path: it cannot be changed.
Example
BotName is the new sender name (up to 28 characters); empty keeps the current one.
Example
Acme SupportMetadata, when sent, replaces the bot’s routing metadata as a whole.
object
AIAgentID is the AI agent to answer first; required when aiEnabled is true.
Example
AIEnabled hands conversations to aiAgentId first.
Example
falseApplicationID is the SIPRTC application that handles the bot’s messages; must be greater than 0 whenever metadata is sent.
Example
1234QueueSID is the contact-centre queue (optional).
Example
WorkflowSID is the contact-centre workflow (optional).
Example
WorkspaceSID is the contact-centre workspace to route conversations to (optional).
Example
WebhookSid moves the bot to another platform webhook (not used by another bot); empty keeps the current one.
Example
Responses
Section titled “ Responses ”OK
object
Data is the bot.
object
AccountID is the Auth ID of the account that handles the bot’s conversations.
AuthToken is the bot’s Viber token, masked in every response (first 6 and last 4 characters of the stored value, or [REDACTED] when short).
BotAvatar is the URL of the bot’s avatar image, if set.
BotID is the bot’s id: Viber’s own id for a bot connected through the Channels API (the connection’s provider_sender).
BotName is the sender name shown in Viber (up to 28 characters).
CreatedAt is when the bot was stored (RFC 3339, UTC).
Metadata routes the bot’s conversations.
object
AIAgentID is the AI agent that answers when aiEnabled is true.
AIEnabled hands conversations to the AI agent aiAgentId first.
ApplicationID is the SIPRTC application that handles the bot’s messages.
QueueSID is the contact-centre queue, if any.
WorkflowSID is the contact-centre workflow, if any.
WorkspaceSID is the contact-centre workspace conversations are routed to, if any.
ParentAuthID is the Auth ID of that account’s parent, which owns the webhook; empty for a top-level account.
UpdatedAt is when the bot last changed (RFC 3339, UTC).
WebhookSid is the platform webhook Viber calls back for this bot (a UUID).
Message is “Viber bot updated successfully” on an update; absent on a read.
Status is “success”.
Example
{ "data": { "account_id": "AC000000000000000000", "auth_token": "enc:v1...AbCd", "bot_avatar": "https://example.com/avatar.png", "bot_id": "pa:5000000000000000001", "bot_name": "Acme Support", "created_at": "2026-11-20T10:15:00Z", "metadata": { "aiAgentId": "", "aiEnabled": false, "applicationId": 1234, "queueSid": "WQ00000000000000000000000000000000", "workflowSid": "WW00000000000000000000000000000000", "workspaceSid": "WS00000000000000000000000000000000" }, "parent_auth_id": "AC000000000000000099", "updated_at": "2026-11-20T10:15:00Z", "webhook_sid": "9f1c2d3e-0000-4000-8000-000000000002" }, "message": "Viber bot updated successfully", "status": "success"}Invalid body, bot_name over 28 characters, metadata without applicationId or aiAgentId, a bot_id change, or an account_id that is not a direct sub-account of the caller
object
Message says what went wrong.
Status is always “failed” on an error (some validation errors omit it).
Example
{ "message": "error message", "status": "failed"}Missing or invalid credentials; the body is the JSON string Authentication failed
Example generated
exampleNo such bot visible to this account (message: viber bot not found)
object
Message says what went wrong.
Status is always “failed” on an error (some validation errors omit it).
Example
{ "message": "error message", "status": "failed"}Webhook_sid is used by another bot
object
Message says what went wrong.
Status is always “failed” on an error (some validation errors omit it).
Example
{ "message": "error message", "status": "failed"}Storage error or a failed account lookup
object
Message says what went wrong.
Status is always “failed” on an error (some validation errors omit it).
Example
{ "message": "error message", "status": "failed"}