Skip to main content
GET
Create translation Task Status
This endpoint serves as your window into the translation process, allowing you to monitor the status of tasks you’ve submitted through the /translate endpoint. By providing the unique task_id you received when initiating a translation, you can check whether your translation is still being processed, has completed successfully, or encountered an issue. When translation is complete, this endpoint also delivers your translated text.

Understanding the Translation Lifecycle

When you submit a translation request, it goes through several stages before completion. This endpoint keeps you informed about which stage your task has reached:

Status Types

The status field in the response will contain one of these values:
  • PENDING: Your translation is currently in the processing queue or actively being translated. This indicates that everything is working as expected, but the translation is not yet complete. Continue polling at reasonable intervals.
  • SUCCESS: The translation process has completed successfully. When you receive this status, your run_id is returned which the identifier that you would use to fetch your translations by using the /translation-result/{run_id}
  • ERROR: Something went wrong during the translation process. This could be due to invalid input parameters, server issues, or problems with the translation engine. The response may include additional details about the nature of the error.
  • TIMEOUT: The translation task exceeded the maximum allowed processing time. This typically happens with extremely large translation requests or during periods of high system load. Consider breaking your request into smaller batches.
  • PAYMENT_REQUIRED: Your account does not have sufficient credits or permissions to complete this translation. Please check your subscription status or contact support for assistance.
Asynchronous operations like translation require a thoughtful approach to status checking:
  1. Start with short intervals: Initially check every 1-2 seconds for very short translations
  2. Use exponential backoff: Gradually increase the time between checks (e.g., doubling the wait time after each check)
  3. Set a maximum interval: Don’t let the wait time grow beyond 10-15 seconds
  4. Implement a timeout: Establish a maximum total wait time for your application
This approach balances responsiveness with server efficiency, ensuring you get your translations promptly without overloading the system with unnecessary requests.

Example: Monitoring Translation Progress

Here’s how you might implement status checking for a translation task:
This function demonstrates a robust implementation of status polling with several key features:
  1. Exponential backoff: The wait time between requests starts small and gradually increases, which is efficient for both short and long-running tasks
  2. Multiple status handling: Each possible status value is handled appropriately
  3. Error reporting: Meaningful error messages help diagnose issues
  4. Progress tracking: The elapsed time is displayed to keep users informed
  5. Timeout protection: Both client-side and server-side timeouts are accounted for
By implementing a similar approach in your application, you can create a responsive user experience that keeps users informed about translation progress while efficiently managing system resources.

When to Stop Polling

You should stop polling when you receive one of these definitive statuses:
  • SUCCESS: You’ve received your translations
  • ERROR: The task failed and won’t recover
  • TIMEOUT: The server timed out the request
  • PAYMENT_REQUIRED: Payment issues need to be resolved
Only the PENDING status indicates that you should continue polling. With this endpoint, you gain visibility into the translation process, allowing your application to respond appropriately based on real-time status information and retrieve completed translations as soon as they’re available.

Authorizations

x-api-key
string
header
required

The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.

Path Parameters

task_id
string
required

A unique identifier for the task. This is used to query the status of the translation task that is running. It is returned when a create request is made for translation.

Response

Successful Response

status
enum<string>
Available options:
SUCCESS,
PENDING,
TIMEOUT,
ERROR,
PAYMENT_REQUIRED
run_id
integer | null