Create an extractor
const url = 'http://127.0.0.1:8000/v1/extractors';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"invoice","display_name":"Invoice","instructions":"Extract the invoice header, supplier, and total exactly as shown.","reasoning_effort":"none","provider_name":"openai","model":"gpt-4o-mini","schema":{},"examples":[{"input":{"type":"text","text":"example","file_id":"example"},"output":{}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8000/v1/extractors \ --header 'Content-Type: application/json' \ --data '{ "name": "invoice", "display_name": "Invoice", "instructions": "Extract the invoice header, supplier, and total exactly as shown.", "reasoning_effort": "none", "provider_name": "openai", "model": "gpt-4o-mini", "schema": {}, "examples": [ { "input": { "type": "text", "text": "example", "file_id": "example" }, "output": {} } ] }'Create a reusable extraction definition from instructions, a schema, and optional examples.
Request Bodyrequired
Section titled “Request Bodyrequired”Definition used to create a reusable extractor.
object
Natural-language extraction instructions.
Explicit reasoning effort for an extractor’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.
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.
JSON Schema that every successful extraction result must satisfy.
object
Optional few-shot examples for difficult document types.
Few-shot example pairing representative input with expected structured output.
object
Responses
Section titled “Responses”Successful Response
Public representation of a reusable extractor.
object
Immutable extractor identifier.
Stable URL-safe extractor name.
Human-readable extractor label.
Natural-language extraction instructions.
Explicit reasoning effort for an extractor’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.
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.
Extraction result JSON Schema.
object
Configured few-shot examples.
object
How the extractor was created.
Whether ParseHawk ships this extractor.
UTC creation time.
UTC last-update time.
Example
{ "name": "invoice", "reasoning_effort": "none", "provider_name": "openai", "source": "user"}The request or domain input failed validation.
Error returned by request validation or a ParseHawk domain service.
object
object
Examplegenerated
{ "detail": [ {} ]}Unexpected server error.
Error returned by request validation or a ParseHawk domain service.
object
object
Examplegenerated
{ "detail": [ {} ]}