Skip to content

Create a parse job

POST
/v1/parse-jobs
Code sample: curl
API="${PARSEHAWK_API_URL:-http://127.0.0.1:8000}"
curl --fail --silent --show-error \
--request POST "$API/v1/parse-jobs" \
--header "Content-Type: application/json" \
--data '{"parser_name":"document-to-markdown","file_id":"file_..."}' | jq .

Enqueue page-preserving Markdown parsing for one uploaded PDF, JPG/JPEG, or PNG file. The parser configuration is snapshotted when the job is created.

Media typeapplication/json
CreateParseJobRequest

Request to enqueue one document parsing job.

object
parser_id
Any of:
string
parser_name
Any of:
string
file_id
required
File Id

Uploaded PDF, JPG/JPEG, or PNG file identifier.

string

Successful Response

Media typeapplication/json
ParseJobResponse

Current state and eventual Markdown result of one parse job.

object
id
required
Id

Immutable parse job identifier.

string
parser_id
required
Parser Id

Immutable parser identifier used by the job.

string
file_id
required
File Id

Input file identifier.

string
parser_snapshot
required
ParserSnapshotResponse

Immutable parser configuration captured when the job was created.

object
parser_id
required
Parser Id

Immutable parser identifier.

string
name
required
Name

Stable parser name at enqueue time.

string
display_name
required
Display Name

Parser label at enqueue time.

string
output_format
required
ParserOutputFormat

Output format at enqueue time.

string
Allowed values: markdown
instructions
required
Instructions

Parsing instructions at enqueue time.

string
reasoning_effort
required
Any of:
ReasoningEffort

Explicit reasoning effort for an extractor’s or parser’s model.

The values mirror OpenAI’s reasoning_effort parameter. Extractors store None by default, which means “send no reasoning parameter and use the model’s own default” — the only setting that is safe for every model. Which explicit values a model accepts is the provider’s call; incompatible pairs surface the provider’s error at extraction time.

string
Allowed values: none minimal low medium high xhigh
provider_name
required
Any of:
ProviderName

The fixed set of model providers ParseHawk ships.

Providers are preconfigured and configurable, not user-creatable, so the name doubles as the stable identifier extractors reference and as the discriminator the engine factory switches on.

string
Allowed values: openai microsoft_foundry openai_compatible_api
model
required
Any of:
string
provider_name_used
required
Any of:
ProviderName

The fixed set of model providers ParseHawk ships.

Providers are preconfigured and configurable, not user-creatable, so the name doubles as the stable identifier extractors reference and as the discriminator the engine factory switches on.

string
Allowed values: openai microsoft_foundry openai_compatible_api
model_used
required
Any of:
string
reasoning_effort_used
required
Any of:
ReasoningEffort

Explicit reasoning effort for an extractor’s or parser’s model.

The values mirror OpenAI’s reasoning_effort parameter. Extractors store None by default, which means “send no reasoning parameter and use the model’s own default” — the only setting that is safe for every model. Which explicit values a model accepts is the provider’s call; incompatible pairs surface the provider’s error at extraction time.

string
Allowed values: none minimal low medium high xhigh
model_adapter_used
required
Any of:
string
status
required
JobStatus

Current job lifecycle state.

string
Allowed values: queued running completed failed canceling deleting canceled
result
required
Any of:
ParseResultResponse

Canonical Markdown result for a completed parse job.

object
format
required
ParserOutputFormat

Result content format.

string
Allowed values: markdown
content
required
Content

All page content joined by an HTML page-break comment.

string
page_count
required
Page Count

Number of parsed source pages.

integer
>= 1
pages
required
Pages

Canonical one-based per-page Markdown output.

Array<object>
ParsePageResultResponse

Markdown output for one source page.

object
page_number
required
Page Number

One-based source page number.

integer
>= 1
content
required
Content

Markdown transcription for this page.

string
error
required
Any of:
ParseErrorResponse

Terminal parsing error stored with a failed job.

object
message
required
Message

Human-readable failure message.

string
code
required
Code

Stable machine-readable failure code.

string
created_at
required
Created At

UTC creation time.

string format: date-time
started_at
required
Any of:
string format: date-time
completed_at
required
Any of:
string format: date-time
Example
{
"parser_snapshot": {
"output_format": "markdown",
"reasoning_effort": "none",
"provider_name": "openai"
},
"provider_name_used": "openai",
"reasoning_effort_used": "none",
"status": "queued",
"result": {
"format": "markdown"
}
}

The requested ParseHawk resource does not exist.

Media typeapplication/json
ApiErrorResponse

Error returned by request validation or a ParseHawk domain service.

object
code
Any of:
string
detail
required
Any of:
string
Examplegenerated
{
"code": "example",
"detail": [
{}
]
}

The request or domain input failed validation.

Media typeapplication/json
ApiErrorResponse

Error returned by request validation or a ParseHawk domain service.

object
code
Any of:
string
detail
required
Any of:
string
Examplegenerated
{
"code": "example",
"detail": [
{}
]
}

Unexpected server error.

Media typeapplication/json
ApiErrorResponse

Error returned by request validation or a ParseHawk domain service.

object
code
Any of:
string
detail
required
Any of:
string
Examplegenerated
{
"code": "example",
"detail": [
{}
]
}

Persistence is temporarily busy and the request can be retried.

Media typeapplication/json
ApiErrorResponse

Error returned by request validation or a ParseHawk domain service.

object
code
Any of:
string
detail
required
Any of:
string
Examplegenerated
{
"code": "example",
"detail": [
{}
]
}