It appears as though statuses that have a visibility of private or direct can not be translated using the translation API.
This requirement is not clear in the documentation. The closest it gets to a mention is the description in https://docs.joinmastodon.org/methods/statuses/#404-not-found-3 which says it can occur:
Status is private or does not exist
-
This should be made more prominent in the documentation. I suggest amending the description of the API from "Translate the status content into some language." to "Translate the content of a status with public or unlisted visibility into some language".
-
The error that is returned is missing. If you try and translate a status with private or direct visibility the server returns a 403 with a JSON response body of { "error": "This action is not allowed" } (from mastodon.social at the time of writing (4.1.3+nightly-20230706))
It appears as though statuses that have a
visibilityofprivateordirectcan not be translated using the translation API.This requirement is not clear in the documentation. The closest it gets to a mention is the description in https://docs.joinmastodon.org/methods/statuses/#404-not-found-3 which says it can occur:
This should be made more prominent in the documentation. I suggest amending the description of the API from "Translate the status content into some language." to "Translate the content of a status with
publicorunlistedvisibility into some language".The error that is returned is missing. If you try and translate a status with
privateordirectvisibility the server returns a 403 with a JSON response body of{ "error": "This action is not allowed" }(from mastodon.social at the time of writing (4.1.3+nightly-20230706))