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

# job [worker job]

POST https://worker/job
Content-Type: application/json

POST a template id and pass the email of the creating user to create a new dataset with metadata corresponding to the template ID.

This requires an x-auth header with a valid API Token.

Reference: https://docs.odr.io/odr-search-api-v-4/job-worker-job

## Request

### Body (application/json)

This endpoint expects an object.

- `user_email` (string, required)
- `job` (object, required)
  - `tracked_job_id` (integer, required)
  - `random_key` (string, required)
  - `job_order` (integer, required)
  - `line_count` (integer, required)

## Response

### 200

OK

- `database_uuid` (string, required)
- `internal_id` (integer, required)
- `record_name` (integer, required)
- `record_uuid` (string, required)
- `template_uuid` (string, required)
- `metadata_for_uuid` (string, required)
- `_record_metadata` (object, required)
  - `_create_date` (string, required)
  - `_updated_date` (string, required)
  - `_create_auth` (string, required)
  - `_public_date` (string, required)
- `fields` (list of any, required)
- `records` (list of any, required)

## Examples

**Request**

```json
{
  "user_email": "nate@opendatarepository.org",
  "job": {
    "tracked_job_id": 1866,
    "random_key": "random_key_1866",
    "job_order": 0,
    "line_count": 1
  }
}
```

**Response**

```json
{
  "database_uuid": "48e7e532a715a1c1cb02bed99138",
  "internal_id": 326,
  "record_name": 326,
  "record_uuid": "b14c1b13587b9db6832a8635cb78",
  "template_uuid": "93253b88d314bc2f11848f0eca15",
  "metadata_for_uuid": "b418ef9777d61f2f0a88144ed71a",
  "_record_metadata": {
    "_create_date": "2022-08-24 20:56:03",
    "_updated_date": "2022-08-24 20:56:03",
    "_create_auth": "nate@opendatarepository.org",
    "_public_date": "2200-01-01 00:00:00"
  },
  "fields": [],
  "records": []
}
```

**SDK Code**

```python job [worker job]_example
import requests

url = "https://https/worker/job"

payload = {
    "user_email": "nate@opendatarepository.org",
    "job": {
        "tracked_job_id": 1866,
        "random_key": "random_key_1866",
        "job_order": 0,
        "line_count": 1
    }
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript job [worker job]_example
const url = 'https://https/worker/job';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"user_email":"nate@opendatarepository.org","job":{"tracked_job_id":1866,"random_key":"random_key_1866","job_order":0,"line_count":1}}'
};

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

```go job [worker job]_example
package main

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

func main() {

	url := "https://https/worker/job"

	payload := strings.NewReader("{\n  \"user_email\": \"nate@opendatarepository.org\",\n  \"job\": {\n    \"tracked_job_id\": 1866,\n    \"random_key\": \"random_key_1866\",\n    \"job_order\": 0,\n    \"line_count\": 1\n  }\n}")

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

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby job [worker job]_example
require 'uri'
require 'net/http'

url = URI("https://https/worker/job")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user_email\": \"nate@opendatarepository.org\",\n  \"job\": {\n    \"tracked_job_id\": 1866,\n    \"random_key\": \"random_key_1866\",\n    \"job_order\": 0,\n    \"line_count\": 1\n  }\n}"

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

```java job [worker job]_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/worker/job")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_email\": \"nate@opendatarepository.org\",\n  \"job\": {\n    \"tracked_job_id\": 1866,\n    \"random_key\": \"random_key_1866\",\n    \"job_order\": 0,\n    \"line_count\": 1\n  }\n}")
  .asString();
```

```php job [worker job]_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/worker/job', [
  'body' => '{
  "user_email": "nate@opendatarepository.org",
  "job": {
    "tracked_job_id": 1866,
    "random_key": "random_key_1866",
    "job_order": 0,
    "line_count": 1
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp job [worker job]_example
using RestSharp;

var client = new RestClient("https://https/worker/job");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user_email\": \"nate@opendatarepository.org\",\n  \"job\": {\n    \"tracked_job_id\": 1866,\n    \"random_key\": \"random_key_1866\",\n    \"job_order\": 0,\n    \"line_count\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift job [worker job]_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "user_email": "nate@opendatarepository.org",
  "job": [
    "tracked_job_id": 1866,
    "random_key": "random_key_1866",
    "job_order": 0,
    "line_count": 1
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/worker/job")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```