apyhub
ARTIFICIAL INTELLIGENCE · SMART GENERATION

Translate Text API

What it does

Text Translation lets you submit text for translation as an asynchronous job, then check the job status and retrieve the translated result when it is ready.

Send a content string, and optionally include context, language, and voice_tone to guide the translation. context helps disambiguate terms, language specifies the language of the source content, and voice_tone lets you steer style toward a tone such as funny, joyous, or a named authorial voice. The submit endpoint returns a job_id immediately so you can track the translation without blocking your workflow.

Use it when you need translated copy in a content pipeline, multilingual support workflow, or batch processing job. Poll /job/status/:job_id with the returned job_id to see whether the job is queued, running, success, or failed.

When a job completes successfully, the status response includes the translated content along with from_language and to_language, so you can store or route the result with its language metadata.

▣ ENDPOINT 01 / 02
POST
Translate Text Submit Job
http://localhost:8080/sharpapi/translate-text
QUICKSTARTGUIDE

Quickstart

Send the text you want translated in a JSON body to start a translation job.

curl -X POST "http://localhost:8080/sharpapi/translate-text" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello, how are you?"
  }'

What you'll get back

Returns a JSON object with a required job_id string field identifying the translation job.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/content/translate/job/status/7a37675e-7e89-4257-9e91-23151c17e5e7",
  "job_id": "7a37675e-7e89-4257-9e91-23151c17e5e7"
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Provide the content to translate.
Provide additional context to the translated text, such as use case examples or additional explanations.
Specify the language of the content which needs to be translated.(For example: 'German').
Specify the voice tone of the output. It can be adjectives like `funny` or `joyous`, or even the name of a `famous writer`.

About this endpoint

What it does

Submits a text translation job using the supplied content and optional translation guidance, then returns a job identifier for tracking the asynchronous work.

Request Body

ParameterTypeMandatoryDescription
contentStringYesProvide the content to translate.
contextStringNoProvide additional context to the translated text, such as use case examples or additional explanations.
languageStringNoSpecify the language of the content which needs to be translated. For example: German.
voice_toneStringNoSpecify the voice tone of the output. It can be adjectives like funny or joyous, or even the name of a famous writer.

Response

Returns a JSON object with a job_id string and a status_url string for checking the submitted job status.

ParameterTypeMandatoryDescription
status_urlStringYesURL used to check the submitted job status. Format: URI.
job_idStringYesThe job identifier returned when the translation submission is accepted.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job identifier from job_id.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Translate Text Check Job Status
http://localhost:8080/sharpapi/translate-text/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a translate-text job by its job_id.

curl -X GET "http://localhost:8080/sharpapi/translate-text/job/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object. data contains id and type strings, plus an attributes object with status and type; when the job is complete, attributes.result includes the translated content and language pair.

{
  "data": {
    "id": "5de4887a-0dfd-49b6-8edb-9280e468c210",
    "type": "api_job_result",
    "attributes": {
      "status": "success",
      "type": "content_translate",
      "result": {
        "content": "Translated text here",
        "to_language": "English",
        "from_language": "French"
      }
    }
  }
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Checks the status of a previously submitted text-translation job identified by job_id. The response returns a JSON object containing job metadata under data, including the job id, type, and attributes with the current status and, when available, the translation result.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe translation job identifier, as a path parameter.

Response

Returns a JSON object with a data object field. The data object contains id and type string fields, plus an attributes object that includes status and type strings. When the job has completed successfully, attributes also contains a result object with content, to_language, and from_language string fields.

ParameterTypeMandatoryDescription
dataObjectYesJob result wrapper. Contains id, type, and attributes.
data.idStringYesThe job identifier.
data.typeStringYesThe object type returned by the API.
data.attributesObjectYesJob attributes. Contains status, type, and, on success, result.
data.attributes.statusENUMYesJob status. Allowed values: success, failed, running, queued.
data.attributes.typeStringYesThe job result type.
data.attributes.resultObjectNoTranslation result details returned when available. Contains content, to_language, and from_language.
data.attributes.result.contentStringYesThe translated content.
data.attributes.result.to_languageStringYesThe target language.
data.attributes.result.from_languageStringYesThe source language.

Notes

Poll this endpoint with the job_id returned by the submit call. The data.attributes.status field cycles through transitional values (queued, running) before reaching a terminal state (success, failed). The translation result is found under data.attributes.result and should be read only when data.attributes.status is success; otherwise it may be absent.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.