Skip to main content

Translate a Message

POST 

/accounts/:account_id/conversations/:conversation_id/messages/:message_id/translate

Translates a message with the account's OpenAI integration.

The translation is stored in content_attributes.translations. If a translation to that language already exists, it returns 200 with an empty body; the stored translation is then in the message's content_attributes.translations, for example in List of Messages.

SettingValue
MethodPOST
Path/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}/translate
AuthorizationUser token. New rules: Inbox ai assistance for the inbox.

Permissions:

  • User token — any agent who can see the conversation (see Who can see a conversation). New rules system: also Inbox ai assistance for the conversation's inbox.
  • Agent-bot token: not allowed.

Path parameters

NameTypeRequiredDescription
account_idintegerYesAccount ID.
conversation_idintegerYesConversation display ID.
message_idintegerYesMessage ID.

Body parameters (JSON)

NameTypeRequiredDescription
target_languagestringYesLanguage code, e.g. he, en, ar, ru.

Example request

curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/messages/40113/translate' \
-H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "target_language": "he" }'

Example response (200 OK)

{ "content": "היי, איפה ההזמנה שלי?" }

Error responses: 422 {"error": "OpenAI integration is not enabled"}.

Request​

Responses​

The translation. If the message already has a translation to target_language, an empty body.