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.
| Setting | Value |
|---|---|
| Method | POST |
| Path | /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}/translate |
| Authorization | User 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
| Name | Type | Required | Description |
|---|---|---|---|
account_id | integer | Yes | Account ID. |
conversation_id | integer | Yes | Conversation display ID. |
message_id | integer | Yes | Message ID. |
Body parameters (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
target_language | string | Yes | Language 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
- 200
- 401
- 403
- 404
- 422
The translation. If the message already has a translation to target_language, an empty body.
The access token is missing or wrong, or its user does not belong to this account.
The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See Authorization.
The resource does not exist in this account.
The account's OpenAI integration is not enabled.