curl --request GET \
--url https://transform.unstructured.io/api/v2/jobs/{jobId} \
--header 'unstructured-api-key: <api-key>'import requests
url = "https://transform.unstructured.io/api/v2/jobs/{jobId}"
headers = {"unstructured-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'unstructured-api-key': '<api-key>'}};
fetch('https://transform.unstructured.io/api/v2/jobs/{jobId}', 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://transform.unstructured.io/api/v2/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"unstructured-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://transform.unstructured.io/api/v2/jobs/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("unstructured-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://transform.unstructured.io/api/v2/jobs/{jobId}")
.header("unstructured-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://transform.unstructured.io/api/v2/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["unstructured-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "9eb6c914-02a5-4c5d-8490-a06476946a38",
"status": "queued",
"file_id": "<string>",
"filename": "<string>",
"cancellation_requested": false,
"source": {
"file_id": "<string>",
"filename": "<string>",
"mimetype": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"error": {
"code": "invalid_input",
"message": "<string>"
},
"result": {
"id": "<string>",
"status": "processing",
"profile": "balanced",
"markdown": "<string>",
"format_version": "2.0",
"metadata": {
"page_count": 123
},
"extracted_data": [
{
"data": "<unknown>",
"field_metadata": {}
}
],
"elements": [
{
"element_id": "<string>",
"type": "<string>",
"text": "<string>",
"metadata": {
"page_number": 123,
"coordinates": {},
"text_as_html": "<string>"
}
}
],
"source": {
"file_id": "<string>",
"filename": "<string>",
"mimetype": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"warnings": []
}
}{
"code": "unauthorized",
"message": "Authentication required: send either an 'unstructured-api-key' header or 'Authorization: Bearer <token>'."
}{
"code": "not_found",
"message": "No such job."
}{
"code": "result_expired",
"message": "The result for job 9eb6c914-02a5-4c5d-8490-a06476946a38 is no longer available."
}{
"code": "parse_job_failed",
"message": "The upstream service could not retrieve the job. Try again."
}Get the status or result of a job
Retrieve a job status and its result when available. Review the result wrapper or request server-sent events to follow progress.
curl --request GET \
--url https://transform.unstructured.io/api/v2/jobs/{jobId} \
--header 'unstructured-api-key: <api-key>'import requests
url = "https://transform.unstructured.io/api/v2/jobs/{jobId}"
headers = {"unstructured-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'unstructured-api-key': '<api-key>'}};
fetch('https://transform.unstructured.io/api/v2/jobs/{jobId}', 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://transform.unstructured.io/api/v2/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"unstructured-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://transform.unstructured.io/api/v2/jobs/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("unstructured-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://transform.unstructured.io/api/v2/jobs/{jobId}")
.header("unstructured-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://transform.unstructured.io/api/v2/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["unstructured-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "9eb6c914-02a5-4c5d-8490-a06476946a38",
"status": "queued",
"file_id": "<string>",
"filename": "<string>",
"cancellation_requested": false,
"source": {
"file_id": "<string>",
"filename": "<string>",
"mimetype": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"error": {
"code": "invalid_input",
"message": "<string>"
},
"result": {
"id": "<string>",
"status": "processing",
"profile": "balanced",
"markdown": "<string>",
"format_version": "2.0",
"metadata": {
"page_count": 123
},
"extracted_data": [
{
"data": "<unknown>",
"field_metadata": {}
}
],
"elements": [
{
"element_id": "<string>",
"type": "<string>",
"text": "<string>",
"metadata": {
"page_number": 123,
"coordinates": {},
"text_as_html": "<string>"
}
}
],
"source": {
"file_id": "<string>",
"filename": "<string>",
"mimetype": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"warnings": []
}
}{
"code": "unauthorized",
"message": "Authentication required: send either an 'unstructured-api-key' header or 'Authorization: Bearer <token>'."
}{
"code": "not_found",
"message": "No such job."
}{
"code": "result_expired",
"message": "The result for job 9eb6c914-02a5-4c5d-8490-a06476946a38 is no longer available."
}{
"code": "parse_job_failed",
"message": "The upstream service could not retrieve the job. Try again."
}Authorizations
Path Parameters
Identifies one piece of work, whichever path submitted it. The same id the blocking call returns.
"9eb6c914-02a5-4c5d-8490-a06476946a38"
Query Parameters
Shape of the parsed output.
markdown, elements Optional list of projection fields to include in elements output. Allowed values are 'coordinates' and 'table_html'. Only valid when output='elements'.
Response
The job's state, carrying parsed content as soon as it is available. As an event stream, progress events then one terminal result or error event.
A job's state, carrying parsed content as soon as it is available.
Identifies one piece of work, whichever path submitted it. The same id the blocking call returns.
"9eb6c914-02a5-4c5d-8490-a06476946a38"
Terminal values match the blocking call's own status values.
queued, processing, failed, completed, completed_with_warnings, cancelled The authoritative source/input file ID. This is the ID accepted by GET /api/v2/upload/{fileId}, never a job ID, result artifact ID, storage key, or signed URL. Null for legacy or unassociated jobs.
The document's original uploaded filename.
True after cancellation has been requested for this job.
The associated original uploaded source file, when known.
Show child attributes
Show child attributes
A machine-readable code and an actionable message.
Show child attributes
Show child attributes
Null until parsed content is available.
Show child attributes
Show child attributes
Was this page helpful?

