> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emtelligent.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emtelligent.com/_mcp/server.

# Submit Job

POST /jobs

Submit an input file as a raw request body, streamed to disk.

Accepted formats (sniffed from the file signature, the Content-Type
header is ignored): PDF, PNG, JPEG, TIFF.

The optional ``X-Filename`` header sets the job's display name (percent-
decoded, basename only -- see JobStore.create); it does not affect where
bytes land.

curl -X POST --data-binary @doc.pdf -H 'Content-Type: application/pdf' \
    -H 'X-Filename: doc.pdf' http://host:8200/jobs

Reference: https://docs.emtelligent.com/ocr/api/submit-job-jobs-post

## Request

### Headers

- `x-filename` (string, optional, nullable) — Optional display name for the job, percent-encoded as UTF-8. Metadata only; does not affect processing.

## Response

### 201

Successful Response

- `job_id` (string, required)
- `filename` (string, required)
- `mime_type` (enum, required)
  - Allowed values: `application/pdf`, `image/jpeg`, `image/png`, `image/tiff`
- `state` (enum, required)
  - Allowed values: `queued`, `rendering`, `ocr`, `done`, `failed`
- `bytes_received` (integer, required)
- `status_url` (string, required)
- `result_url` (string, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "job_id": "string",
  "filename": "string",
  "mime_type": "application/pdf",
  "state": "queued",
  "bytes_received": 1,
  "status_url": "string",
  "result_url": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/jobs"

response = requests.post(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/jobs';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/jobs"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/jobs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/jobs")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/jobs');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/jobs");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/jobs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```