Get Task Status
curl --request GET \
--url https://api.legnext.ai/api/v1/job/{job_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.legnext.ai/api/v1/job/{job_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.legnext.ai/api/v1/job/{job_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.legnext.ai/api/v1/job/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.legnext.ai/api/v1/job/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.legnext.ai/api/v1/job/{job_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.legnext.ai/api/v1/job/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyTask Management
Get Task
Retrieve job status and results
GET
/
v1
/
job
/
{job_id}
Get Task Status
curl --request GET \
--url https://api.legnext.ai/api/v1/job/{job_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.legnext.ai/api/v1/job/{job_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.legnext.ai/api/v1/job/{job_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.legnext.ai/api/v1/job/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.legnext.ai/api/v1/job/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.legnext.ai/api/v1/job/{job_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.legnext.ai/api/v1/job/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyStatus Values
| Status | Description |
|---|---|
pending | Job is queued and waiting to be processed |
staged | Job is prepared and staged for processing |
processing | Job is currently being processed |
failed | Job has failed due to an error |
completed | Job has completed successfully |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-api-key | string | Yes | Your API key |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id | string | Yes | The unique identifier of the job |
Example Request
curl -X GET "https://api.legnext.ai/api/v1/job/98761286-cdc7-4085-abfe-c9f149ff722b" \
-H "x-api-key: YOUR_API_KEY"
import requests
job_id = "98761286-cdc7-4085-abfe-c9f149ff722b"
url = f"https://api.legnext.ai/api/v1/job/{job_id}"
headers = {
"x-api-key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
result = response.json()
print(result)
const jobId = '98761286-cdc7-4085-abfe-c9f149ff722b';
const response = await fetch(`https://api.legnext.ai/api/v1/job/${jobId}`, {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
const result = await response.json();
console.log(result);
Response
Returns the complete job information including current status and results.{
"job_id": "a616de55-6130-4e1f-b8cd-531ed0599353",
"model": "midjourney",
"task_type": "diffusion",
"status": "completed",
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"secret": ""
}
},
"input": null,
"output": {
"image_url": "https://cdn.legnext.ai/temp/1760408558306.png",
"image_urls": [
"https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_0.png",
"https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_1.png",
"https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_2.png",
"https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_3.png"
],
"seed": "1904983176",
"available_actions": {
"edit": [
0,
1,
2,
3
],
"inpaint": [
0,
1,
2,
3
],
"outpaint": [
0,
1,
2,
3
],
"pan": [
0,
1,
2,
3
],
"remix": [
0,
1,
2,
3
],
"reroll": true,
"upscale": [
0,
1,
2,
3
],
"variation": [
0,
1,
2,
3
]
}
},
"meta": {
"created_at": "2025-10-14T02:22:04Z",
"started_at": "2025-10-14T02:22:06Z",
"ended_at": "2025-10-14T02:22:50Z",
"usage": {
"type": "point",
"frozen": 80,
"consume": 80
}
},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
}
⌘I