Skip to main content

Get Job Status

Endpoint: Get Job Status

This endpoint retrieves the status and result of a specific job. The job is identified by its unique job_id, and the app it belongs to is identified by its app_id.

info

The structure of the input field and the content of the result field are specific to the machine learning model configured in the app. Users must ensure that:

  1. Input Validation: The provided input aligns with the requirements of the model (e.g., parameters like prompt, height, or width for an image generation model).

  2. Output Expectation: The result field's format and content will depend on the type of task the model performs. For example:

    • Image generation models may return URLs to generated images.
    • Text-based models may return summaries, completions, or classifications.

To ensure proper usage:

  • Check the Model Documentation: Review the documentation for the specific model integrated into the app to understand its input requirements and expected outputs.
  • Validate Inputs and Outputs Programmatically: Use schema validation or other mechanisms to ensure inputs and outputs meet your expectations.

URL

GET https://api.rungen.ai/app/{app_id}/job/{job_id}

Path Parameters

ParameterTypeRequiredDescription
app_idStringYesThe unique identifier of the app the job belongs to.
job_idStringYesThe unique identifier of the job.

Headers

HeaderTypeRequiredDescription
x-api-keyStringYesYour API key for authentication.
x-team-idStringNoThe unique identifier for the team. If omitted, the request operates in the user's personal context.

Example Request

curl --location 'https://api.rungen.ai/app/47f1bce3-2218-4ee9-a7c3-50511f889713/job/e9257302-3c4d-47d0-bf90-5be1e4e3b6e2' \
--header 'x-api-key: 123456789abc'

Response

Success

Status Code: 200 OK

Response Body:

{
"data": {
"id": "e9257302-3c4d-47d0-bf90-5be1e4e3b6e2",
"result": {
"images": [
{
"image": "https://rungenai-output-v1.s3.us-east-2.amazonaws.com/01-25/47f1bce3-2218-4ee9-a7c3-1323423r4d32r23-u1/058cade4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=E3423423E32423R234E23%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20250104T150225Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=R2F3F34R34Fdfefergfrgergergergdfw0a33f40c302"
}
]
},
"status": "COMPLETED"
}
}

Response Fields

FieldTypeDescription
data.idStringThe unique identifier of the job.
created_atStringWhen the job was created
execution_timeStringTime elapsed from the created_at field and when the results are produced in seconds
data.statusStringThe current status of the job (e.g., QUEUED, RUNNING, COMPLETED, or FAILED).
data.resultObjectThe output of the job, if available.
data.result.imagesArrayList of images generated by the job (specific to image-generation workflows).
data.result.images[].imageStringURL to the generated image (signed URL).

Status Values

  • QUEUED: The job is waiting to be processed.
  • RUNNING: The job is currently being executed.
  • COMPLETED: The job has successfully completed, and the result is available.
  • FAILED: The job encountered an error during execution.

Error Responses

Status Code: 404 Not Found

Example Response Body:

{
"error": "Job with ID 'e9257302-3c4d-47d0-bf90-5be1e4e3b6e2' not found for App ID '47f1bce3-2218-4ee9-a7c3-50511f889713'."
}

Status Code: 403 Forbidden

Example Response Body:

{
"error": "Unauthorized access. Invalid API key."
}

Notes

  • Authentication: Ensure the x-api-key header is valid. If working within a team context, include the x-team-id header to access team jobs.
  • Signed URLs: The result URLs (e.g., for images) are pre-signed, meaning they can be accessed directly without further authentication.
  • Dynamic Result Content: The structure of the result field depends on the workflow associated with the app (e.g., image generation, text processing, etc.).