curl --request POST \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--form "request_data={\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}" \
--form "input_files=@/path/to/document.pdf"
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.create_job(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
async def create_job():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.create_job_async(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
asyncio.run(create_job())
{
"id": "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"workflow_id": "f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"workflow_name": "My ETL Workflow",
"status": "SCHEDULED",
"stop_requested": false,
"created_at": "2026-01-01T00:00:00Z",
"input_file_ids": ["a6a27cf4-684f-45ed-992e-d2b1be77f2c6"],
"job_type": "ephemeral"
}
Job
Create job
Create a job that processes local files, using either a template or a custom directed acyclic graph (DAG).
POST
/
api
/
v1
/
jobs
/
curl --request POST \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--form "request_data={\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}" \
--form "input_files=@/path/to/document.pdf"
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.create_job(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
async def create_job():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.create_job_async(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
asyncio.run(create_job())
{
"id": "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"workflow_id": "f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"workflow_name": "My ETL Workflow",
"status": "SCHEDULED",
"stop_requested": false,
"created_at": "2026-01-01T00:00:00Z",
"input_file_ids": ["a6a27cf4-684f-45ed-992e-d2b1be77f2c6"],
"job_type": "ephemeral"
}
An local-file processing job is a job that takes one or more local files only as input, and whose temporary workflow exists only for the duration of the job’s run.
To run a workflow that was already created at some point in the past and still exists, see run workflow endpoint instead.
To run a workflow that takes files and data from remote locations as input (instead of local files), do the following instead:
- Create a source connector to the remote source locations.
- Create a destination connector to the remote destination location.
- Create a long-lived workflow that uses this specific source connector and destination connector.
- Run this long-lived workflow manually, if you have not already created the workflow to run on a schedule.
Body
string
required
Job configuration data.
- To use a workflow template for a job, include a
template_idfield that specifies the unique ID of the workflow template. For more information, see list templates. - To use a custom workflow definition for a job, include a
job_nodesfield that specifies the settings for the job’s workflow nodes. For instructions, see Workflow Nodes.
array
Input files to process. Upload as multipart/form-data, in the following format:For more information, see Unstructured API Quickstart - local-file processing jobs.
--form "input_files=@</full/path/to/local/filename.extension>;filename=<filename.extension>;type=<local-file-media-type>" \
--form "input_files=@</full/path/to/local/filename.extension>;filename=<filename.extension>;type=<local-file-media-type>" # For each additional file to be uploaded.
array
IDs of files already uploaded to the playground. Send one multipart field per ID. The API combines these with IDs in
request_data and removes duplicates. Provide files, file IDs, or both.Response
string
required
Unique identifier for the job.
string
required
Unique identifier of the workflow that created this job.
string
required
Name of the workflow that created this job.
string
required
Job lifecycle state. One of:
SCHEDULED, IN_PROGRESS, COMPLETED, STOPPED, FAILED, REJECTED. COMPLETED means job execution finished. Check processing_status for the document outcome.string
required
ISO 8601 timestamp when the job was created.
string
ISO 8601 duration of the job run.
array
IDs of input files for this job.
array
Output file metadata objects. Each object includes
node_id, file_id, node_type, and node_subtype.string
Job type. Default:
ephemeral.boolean
true means someone requested a stop for the job. false means no one has requested a stop.string
Identifier of the user who created the job, when available.
string
Sanitized failure reason for a failed job, when available.
string
Document processing outcome. This field is absent when a newly created job has not processed documents.
integer
Number of documents recorded as failed so far. A zero on an unfinished job is not a final result.
string
Reason a completed job delivered no documents, if detected:
NO_DOCUMENTS_DISCOVERED or NO_DOCUMENTS_SUCCEEDED.curl --request POST \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--form "request_data={\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}" \
--form "input_files=@/path/to/document.pdf"
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.create_job(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import CreateJobRequest
async def create_job():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.create_job_async(
request=CreateJobRequest(
request_data="{\"template_id\":\"f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c\"}"
)
)
print(response)
asyncio.run(create_job())
{
"id": "b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
"workflow_id": "f0a1b2c3-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"workflow_name": "My ETL Workflow",
"status": "SCHEDULED",
"stop_requested": false,
"created_at": "2026-01-01T00:00:00Z",
"input_file_ids": ["a6a27cf4-684f-45ed-992e-d2b1be77f2c6"],
"job_type": "ephemeral"
}
Was this page helpful?

