> 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 a job

POST https://synth.emtelligent.com/v1/jobs
Content-Type: application/json

Generate one synthetic patient. Returns at once with the job, `queued`; poll it with `GET /v1/jobs/{job_id}` until it has `succeeded`, then download its results.

Reference: https://docs.emtelligent.com/synth/api/jobs/submit-job-v-1-jobs-post

## Authentication

- `Authorization` header (bearer token, required) — An API key, or an OAuth 2.0 access token, with the `synth:process` scope.

## Request

### Headers

- `Idempotency-Key` (string, optional, nullable) — Optional, recommended: retrying with the same key and body returns the original job (200) instead of creating, and charging for, a second one. Per organization, for 24 hours. 1-128 of [A-Za-z0-9_.:-].

### Body (application/json)

This endpoint expects a GenerationRequest.

- `patient` (PatientSeed, optional, nullable) — Facts the patient must have.
- `complexity` (integer, optional, nullable) — 1 = healthy, routine care only; 10 = multiple serious chronic conditions with frequent specialist and inpatient care. Random if omitted.
- `num_documents` (integer, optional, default: 5) — Clinical documents to generate. A visit produces one; a hospital stay can produce several (H&P, progress notes, consults, operative note, discharge summary).
- `document_types` (list of enum, optional, nullable) — Only these document types. Generator chooses if omitted. To get a normal chart that also has certain types, use include_document_types instead.
  - Allowed values: `progress_note`, `history_and_physical`, `consult_note`, `discharge_summary`, `emergency_department_note`, `operative_note`, `procedure_note`, `radiology_report`, `pathology_report`, `nursing_note`, `telephone_encounter`, `preoperative_assessment`, `social_work_note`, `occupational_therapy_note`, `physical_therapy_note`, `palliative_care_note`, `radiation_oncology_consult`, `radiation_treatment_summary`, `dietitian_note`, `speech_language_pathology_note`, `respiratory_therapy_note`, `cardiac_rehabilitation_note`, `pulmonary_rehabilitation_note`, `laboratory_report`, `ecg_report`, `echocardiogram_report`, `cardiac_study_report`, `pulmonary_function_report`, `microbiology_report`, `insurance_coverage_summary`, `prior_authorization_request`, `letter_of_medical_necessity`
- `include_document_types` (list of enum, optional, nullable) — Make sure the chart has at least one document of each of these types; the rest are the chart's usual mix (of document_types, if given). At most num_documents types.
  - Allowed values: `progress_note`, `history_and_physical`, `consult_note`, `discharge_summary`, `emergency_department_note`, `operative_note`, `procedure_note`, `radiology_report`, `pathology_report`, `nursing_note`, `telephone_encounter`, `preoperative_assessment`, `social_work_note`, `occupational_therapy_note`, `physical_therapy_note`, `palliative_care_note`, `radiation_oncology_consult`, `radiation_treatment_summary`, `dietitian_note`, `speech_language_pathology_note`, `respiratory_therapy_note`, `cardiac_rehabilitation_note`, `pulmonary_rehabilitation_note`, `laboratory_report`, `ecg_report`, `echocardiogram_report`, `cardiac_study_report`, `pulmonary_function_report`, `microbiology_report`, `insurance_coverage_summary`, `prior_authorization_request`, `letter_of_medical_necessity`
- `timeline` (TimelineOptions, optional) — When the documents happen.
- `outputs` (list of enum, optional) — `fhir`: a FHIR R4 bundle; `notes`: the documents as text; `pdf`: each document as a PDF, plus the whole chart as one. The patient's full record (`result`) is always included.
  - Allowed values: `fhir`, `notes`, `pdf`
- `seed` (integer, optional, nullable) — The same request with the same seed generates the same patient.

## Response

### 200

Idempotent retry: the job already created with this Idempotency-Key

- `id` (string, required)
- `status` (enum, required)
  - Allowed values: `queued`, `running`, `succeeded`, `failed`, `canceled`
- `created_at` (datetime, required)
- `num_documents` (integer, required) — Clinical documents requested.
- `attempts` (integer, required) — Times processing started; a job interrupted on our side is retried.
- `started_at` (datetime, optional, nullable)
- `finished_at` (datetime, optional, nullable)
- `error` (JobError, optional, nullable) — Why the job failed, if it did.
- `summary` (JobSummary, optional, nullable) — The patient generated, once succeeded.
- `results` (list of ResultFile, optional) — Files ready to download.
- `results_expire_at` (datetime, optional, nullable) — Files not downloaded by then are deleted.

### 202

Successful Response

- `id` (string, required)
- `status` (enum, required)
  - Allowed values: `queued`, `running`, `succeeded`, `failed`, `canceled`
- `created_at` (datetime, required)
- `num_documents` (integer, required) — Clinical documents requested.
- `attempts` (integer, required) — Times processing started; a job interrupted on our side is retried.
- `started_at` (datetime, optional, nullable)
- `finished_at` (datetime, optional, nullable)
- `error` (JobError, optional, nullable) — Why the job failed, if it did.
- `summary` (JobSummary, optional, nullable) — The patient generated, once succeeded.
- `results` (list of ResultFile, optional) — Files ready to download.
- `results_expire_at` (datetime, optional, nullable) — Files not downloaded by then are deleted.

## Errors

### 400 Bad Request Error

Malformed Idempotency-Key (`invalid_idempotency_key`)

- `error` (ErrorDetail, required)

### 401 Unauthorized Error

Missing or invalid credentials (`invalid_credentials`)

- `error` (ErrorDetail, required)

### 402 Payment Required Error

Organization suspended or out of credit

- `error` (ErrorDetail, required)

### 409 Conflict Error

Idempotency-Key reused with a different body (`idempotency_conflict`)

- `error` (ErrorDetail, required)

### 422 Unprocessable Entity Error

The request is invalid (`request_validation`)

- `error` (ErrorDetail, required)

### 429 Too Many Requests Error

Over an active-job, active-cohort, or submission-rate limit (`rate_limited`); wait for the `Retry-After` seconds

- `error` (ErrorDetail, required)

### 503 Service Unavailable Error

Temporarily unavailable; retry with backoff

- `error` (ErrorDetail, required)

## Types

### PatientSeed

Facts the generated patient must be consistent with. Structured fields are authoritative. `narrative` lets customers describe anything the fields don't cover, in plain language.

- `age` (integer, optional, nullable) — Age when the timeline starts.
- `birth_date` (date, optional, nullable)
- `sex` (enum, optional, nullable) — Administrative sex. Random if omitted.
  - Allowed values: `male`, `female`, `other`, `unknown`
- `race` (string, optional, nullable) — As free text, e.g. 'Black or African American'.
- `ethnicity` (string, optional, nullable) — As free text, e.g. 'Hispanic or Latino'.
- `marital_status` (string, optional, nullable) — e.g. 'married', 'widowed'.
- `occupation` (string, optional, nullable) — e.g. 'retired teacher'.
- `country` (enum, optional, nullable) — Where the patient lives and receives care. If omitted, from the narrative's location, else random.
  - Allowed values: `US`, `CA`
- `conditions` (list of SeedCondition, optional) — Conditions the patient has, or had. Others may be added.
- `procedures` (list of SeedProcedure, optional) — Past procedures.
- `medications` (list of SeedMedication, optional) — Medications the patient takes when the timeline starts.
- `allergies` (list of SeedAllergy, optional)
- `no_known_allergies` (boolean, optional, default: false) — The patient has no allergies.
- `smoking` (SeedSmoking, optional, nullable)
- `immunizations_up_to_date` (boolean, optional, nullable) — Whether routine immunizations are current. Chosen if omitted.
- `narrative` (string, optional, nullable) — Anything else about the patient, in plain language, e.g. 'lives alone in Toledo, OH; poor adherence to medications; frequent ED visits'. A state or province (or a well-known city) named here sets where the patient lives. The structured fields take precedence.

### TimelineOptions

When the generated documents happen. start_date defaults to (end_date - span chosen by the generator); end_date defaults to today. If the seed gives both age and birth_date, start_date is derived from them.

- `start_date` (date, optional, nullable) — Date of the first encounter, at the earliest.
- `end_date` (date, optional, nullable) — Date of the last encounter, at the latest. Today if omitted.

### JobError

- `code` (string, required) — Why it failed, e.g. `invalid_request` or `generation_failed`.
- `message` (string, required) — What went wrong and what to do, for people.

### JobSummary

- `patient_id` (string, required)
- `complexity` (integer, required) — The complexity used (chosen at random if not requested).
- `seed` (integer, required) — Send it as `seed` with the same request to generate the same patient again.
- `counts` (Counts, required)

### ResultFile

- `name` (enum, required) — Use in the download URL.
  - Allowed values: `fhir`, `notes`, `pdf`, `result`
- `filename` (string, required) — Suggested file name.
- `content_type` (string, required)
- `size_bytes` (integer, required)
- `url` (string, required) — Where to download it (once).

### ErrorDetail

- `code` (string, required) — Stable error code, e.g. `not_found`; branch on this.
- `message` (string, required) — What went wrong, for people. May change.
- `request_id` (string, required, nullable) — Also in the `X-Request-Id` header; quote it to support.

### SeedCondition

- `name` (string, required) — Condition as free text, e.g. 'mild hypertension'.
- `onset_years_ago` (double, optional, nullable) — How long before the timeline starts it began. Chosen if omitted.
- `resolved` (boolean, optional, default: false) — A past condition, now resolved.
- `primary` (boolean, optional, default: false) — A primary condition: one the chart is mainly about. Mark as many as apply. If none is marked, the requested conditions that aren't resolved are the primary ones; if no conditions are requested, they're chosen to fit the patient.

### SeedProcedure

- `name` (string, required) — Procedure as free text, e.g. 'appendectomy'.
- `years_ago` (double, optional, nullable) — How long before the timeline starts it was done. 0: during the timeline, with the documents it produces (e.g. a procedure note, and a pathology report for a biopsy). Chosen if omitted.

### SeedMedication

- `name` (string, required) — Drug name, optionally with strength, e.g. 'hydrochlorothiazide 25 mg'.
- `frequency` (string, optional, nullable) — e.g. 'once daily'. Chosen if omitted.

### SeedAllergy

- `substance` (string, required) — What the patient is allergic to, e.g. 'penicillin', 'peanuts'.
- `reaction` (string, optional, nullable) — e.g. 'hives'. Chosen if omitted.

### SeedSmoking

- `status` (enum, required) — Smoking status.
  - Allowed values: `never`, `former`, `current_every_day`, `current_some_day`, `unknown`
- `start_age` (integer, optional, nullable) — Age they started smoking.
- `quit_age` (integer, optional, nullable) — Age they quit (former smokers).
- `packs_per_day` (double, optional, nullable)

### Counts

- `conditions` (integer, required)
- `medications` (integer, required)
- `allergies` (integer, required)
- `procedures` (integer, required)
- `immunizations` (integer, required)
- `encounters` (integer, required)
- `observations` (integer, required) — Vital signs and laboratory results.
- `notes` (integer, required) — Clinical documents.

## Examples

### A patient to a specification

**Request**

```json
{
  "patient": {
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [
      {
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      },
      {
        "name": "atrial fibrillation"
      }
    ],
    "medications": [
      {
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      }
    ],
    "allergies": [
      {
        "substance": "penicillin",
        "reaction": "hives"
      }
    ],
    "smoking": {
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    }
  },
  "complexity": 7,
  "num_documents": 8,
  "document_types": [
    "progress_note",
    "history_and_physical",
    "discharge_summary"
  ],
  "outputs": [
    "fhir",
    "notes",
    "pdf"
  ],
  "seed": 20260630
}
```

**Response**

```json
{
  "id": "d2d22495-d31b-4aa9-a497-e29309a2440e",
  "status": "queued",
  "created_at": "2026-10-15T07:38:53.021000Z",
  "num_documents": 8,
  "attempts": 0,
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A patient to a specification
import requests

url = "https://synth.emtelligent.com/v1/jobs"

payload = {
    "patient": {
        "age": 72,
        "sex": "male",
        "country": "US",
        "conditions": [{
                "name": "heart failure with reduced ejection fraction",
                "onset_years_ago": 4
            }, { "name": "atrial fibrillation" }],
        "medications": [
            {
                "name": "apixaban 5 mg",
                "frequency": "twice daily"
            }
        ],
        "allergies": [
            {
                "substance": "penicillin",
                "reaction": "hives"
            }
        ],
        "smoking": {
            "status": "former",
            "start_age": 20,
            "quit_age": 55
        }
    },
    "complexity": 7,
    "num_documents": 8,
    "document_types": ["progress_note", "history_and_physical", "discharge_summary"],
    "outputs": ["fhir", "notes", "pdf"],
    "seed": 20260630
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A patient to a specification
const url = 'https://synth.emtelligent.com/v1/jobs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"patient":{"age":72,"sex":"male","country":"US","conditions":[{"name":"heart failure with reduced ejection fraction","onset_years_ago":4},{"name":"atrial fibrillation"}],"medications":[{"name":"apixaban 5 mg","frequency":"twice daily"}],"allergies":[{"substance":"penicillin","reaction":"hives"}],"smoking":{"status":"former","start_age":20,"quit_age":55}},"complexity":7,"num_documents":8,"document_types":["progress_note","history_and_physical","discharge_summary"],"outputs":["fhir","notes","pdf"],"seed":20260630}'
};

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

```go A patient to a specification
package main

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

func main() {

	url := "https://synth.emtelligent.com/v1/jobs"

	payload := strings.NewReader("{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 A patient to a specification
require 'uri'
require 'net/http'

url = URI("https://synth.emtelligent.com/v1/jobs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}"

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

```java A patient to a specification
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/jobs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}")
  .asString();
```

```php A patient to a specification
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/jobs', [
  'body' => '{
  "patient": {
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [
      {
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      },
      {
        "name": "atrial fibrillation"
      }
    ],
    "medications": [
      {
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      }
    ],
    "allergies": [
      {
        "substance": "penicillin",
        "reaction": "hives"
      }
    ],
    "smoking": {
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    }
  },
  "complexity": 7,
  "num_documents": 8,
  "document_types": [
    "progress_note",
    "history_and_physical",
    "discharge_summary"
  ],
  "outputs": [
    "fhir",
    "notes",
    "pdf"
  ],
  "seed": 20260630
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A patient to a specification
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/jobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A patient to a specification
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "patient": [
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [[
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      ], ["name": "atrial fibrillation"]],
    "medications": [
      [
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      ]
    ],
    "allergies": [
      [
        "substance": "penicillin",
        "reaction": "hives"
      ]
    ],
    "smoking": [
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    ]
  ],
  "complexity": 7,
  "num_documents": 8,
  "document_types": ["progress_note", "history_and_physical", "discharge_summary"],
  "outputs": ["fhir", "notes", "pdf"],
  "seed": 20260630
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://synth.emtelligent.com/v1/jobs")! 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()
```

### A random patient

**Request**

```json
{}
```

**Response**

```json
{
  "id": "99eebed0-23d5-4e9d-b07a-ff490b928ad9",
  "status": "queued",
  "created_at": "2026-10-15T07:38:53.039658Z",
  "num_documents": 5,
  "attempts": 0,
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A random patient
import requests

url = "https://synth.emtelligent.com/v1/jobs"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A random patient
const url = 'https://synth.emtelligent.com/v1/jobs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go A random patient
package main

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

func main() {

	url := "https://synth.emtelligent.com/v1/jobs"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 A random patient
require 'uri'
require 'net/http'

url = URI("https://synth.emtelligent.com/v1/jobs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java A random patient
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/jobs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/jobs', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A random patient
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/jobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A random patient
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://synth.emtelligent.com/v1/jobs")! 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()
```

### A patient to a specification

**Request**

```json
{
  "patient": {
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [
      {
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      },
      {
        "name": "atrial fibrillation"
      }
    ],
    "medications": [
      {
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      }
    ],
    "allergies": [
      {
        "substance": "penicillin",
        "reaction": "hives"
      }
    ],
    "smoking": {
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    }
  },
  "complexity": 7,
  "num_documents": 8,
  "document_types": [
    "progress_note",
    "history_and_physical",
    "discharge_summary"
  ],
  "outputs": [
    "fhir",
    "notes",
    "pdf"
  ],
  "seed": 20260630
}
```

**Response**

```json
{
  "id": "d2d22495-d31b-4aa9-a497-e29309a2440e",
  "status": "queued",
  "created_at": "2026-10-15T07:38:53.021000Z",
  "num_documents": 8,
  "attempts": 0,
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A patient to a specification
import requests

url = "https://synth.emtelligent.com/v1/jobs"

payload = {
    "patient": {
        "age": 72,
        "sex": "male",
        "country": "US",
        "conditions": [{
                "name": "heart failure with reduced ejection fraction",
                "onset_years_ago": 4
            }, { "name": "atrial fibrillation" }],
        "medications": [
            {
                "name": "apixaban 5 mg",
                "frequency": "twice daily"
            }
        ],
        "allergies": [
            {
                "substance": "penicillin",
                "reaction": "hives"
            }
        ],
        "smoking": {
            "status": "former",
            "start_age": 20,
            "quit_age": 55
        }
    },
    "complexity": 7,
    "num_documents": 8,
    "document_types": ["progress_note", "history_and_physical", "discharge_summary"],
    "outputs": ["fhir", "notes", "pdf"],
    "seed": 20260630
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A patient to a specification
const url = 'https://synth.emtelligent.com/v1/jobs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"patient":{"age":72,"sex":"male","country":"US","conditions":[{"name":"heart failure with reduced ejection fraction","onset_years_ago":4},{"name":"atrial fibrillation"}],"medications":[{"name":"apixaban 5 mg","frequency":"twice daily"}],"allergies":[{"substance":"penicillin","reaction":"hives"}],"smoking":{"status":"former","start_age":20,"quit_age":55}},"complexity":7,"num_documents":8,"document_types":["progress_note","history_and_physical","discharge_summary"],"outputs":["fhir","notes","pdf"],"seed":20260630}'
};

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

```go A patient to a specification
package main

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

func main() {

	url := "https://synth.emtelligent.com/v1/jobs"

	payload := strings.NewReader("{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 A patient to a specification
require 'uri'
require 'net/http'

url = URI("https://synth.emtelligent.com/v1/jobs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}"

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

```java A patient to a specification
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/jobs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}")
  .asString();
```

```php A patient to a specification
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/jobs', [
  'body' => '{
  "patient": {
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [
      {
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      },
      {
        "name": "atrial fibrillation"
      }
    ],
    "medications": [
      {
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      }
    ],
    "allergies": [
      {
        "substance": "penicillin",
        "reaction": "hives"
      }
    ],
    "smoking": {
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    }
  },
  "complexity": 7,
  "num_documents": 8,
  "document_types": [
    "progress_note",
    "history_and_physical",
    "discharge_summary"
  ],
  "outputs": [
    "fhir",
    "notes",
    "pdf"
  ],
  "seed": 20260630
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A patient to a specification
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/jobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"patient\": {\n    \"age\": 72,\n    \"sex\": \"male\",\n    \"country\": \"US\",\n    \"conditions\": [\n      {\n        \"name\": \"heart failure with reduced ejection fraction\",\n        \"onset_years_ago\": 4\n      },\n      {\n        \"name\": \"atrial fibrillation\"\n      }\n    ],\n    \"medications\": [\n      {\n        \"name\": \"apixaban 5 mg\",\n        \"frequency\": \"twice daily\"\n      }\n    ],\n    \"allergies\": [\n      {\n        \"substance\": \"penicillin\",\n        \"reaction\": \"hives\"\n      }\n    ],\n    \"smoking\": {\n      \"status\": \"former\",\n      \"start_age\": 20,\n      \"quit_age\": 55\n    }\n  },\n  \"complexity\": 7,\n  \"num_documents\": 8,\n  \"document_types\": [\n    \"progress_note\",\n    \"history_and_physical\",\n    \"discharge_summary\"\n  ],\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"pdf\"\n  ],\n  \"seed\": 20260630\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A patient to a specification
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "patient": [
    "age": 72,
    "sex": "male",
    "country": "US",
    "conditions": [[
        "name": "heart failure with reduced ejection fraction",
        "onset_years_ago": 4
      ], ["name": "atrial fibrillation"]],
    "medications": [
      [
        "name": "apixaban 5 mg",
        "frequency": "twice daily"
      ]
    ],
    "allergies": [
      [
        "substance": "penicillin",
        "reaction": "hives"
      ]
    ],
    "smoking": [
      "status": "former",
      "start_age": 20,
      "quit_age": 55
    ]
  ],
  "complexity": 7,
  "num_documents": 8,
  "document_types": ["progress_note", "history_and_physical", "discharge_summary"],
  "outputs": ["fhir", "notes", "pdf"],
  "seed": 20260630
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://synth.emtelligent.com/v1/jobs")! 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()
```

### A random patient

**Request**

```json
{}
```

**Response**

```json
{
  "id": "99eebed0-23d5-4e9d-b07a-ff490b928ad9",
  "status": "queued",
  "created_at": "2026-10-15T07:38:53.039658Z",
  "num_documents": 5,
  "attempts": 0,
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A random patient
import requests

url = "https://synth.emtelligent.com/v1/jobs"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A random patient
const url = 'https://synth.emtelligent.com/v1/jobs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go A random patient
package main

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

func main() {

	url := "https://synth.emtelligent.com/v1/jobs"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 A random patient
require 'uri'
require 'net/http'

url = URI("https://synth.emtelligent.com/v1/jobs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java A random patient
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/jobs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/jobs', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A random patient
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/jobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A random patient
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://synth.emtelligent.com/v1/jobs")! 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()
```