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
.
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:
-
Input Validation: The provided
input
aligns with the requirements of the model (e.g., parameters likeprompt
,height
, orwidth
for an image generation model). -
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
Parameter | Type | Required | Description |
---|---|---|---|
app_id | String | Yes | The unique identifier of the app the job belongs to. |
job_id | String | Yes | The unique identifier of the job. |
Headers
Header | Type | Required | Description |
---|---|---|---|
x-api-key | String | Yes | Your API key for authentication. |
x-team-id | String | No | The 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
Field | Type | Description |
---|---|---|
data.id | String | The unique identifier of the job. |
created_at | String | When the job was created |
execution_time | String | Time elapsed from the created_at field and when the results are produced in seconds |
data.status | String | The current status of the job (e.g., QUEUED , RUNNING , COMPLETED , or FAILED ). |
data.result | Object | The output of the job, if available. |
data.result.images | Array | List of images generated by the job (specific to image-generation workflows). |
data.result.images[].image | String | URL 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 thex-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.).