> 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 cohort

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

Generate many patients from one specification, cared for in one fictional health system. Returns at once with the cohort, `queued`; poll it with `GET /v1/cohorts/{cohort_id}`.

Reference: https://docs.emtelligent.com/synth/api/cohorts/submit-cohort-v-1-cohorts-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 CohortRequest.

- `size` (integer, required) — Number of patients.
- `age` (IntRange, optional) — Age range, years.
- `female_proportion` (double, optional, default: 0.5) — Share of female patients, e.g. 0.6.
- `complexity` (IntRange, optional) — 1 to 10.
- `conditions` (list of ConditionPrevalence, optional) — Conditions given to an exact share of the patients (rounded); others still arise naturally.
- `documents_per_patient` (IntRange, optional) — Clinical documents per patient.
- `document_types` (list of enum, optional, nullable) — Only these document types. Chosen per patient if omitted. To get normal charts that also have 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 every patient's chart has at least one document of each of these types; the rest are the usual mix. At most documents_per_patient.min 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.
- `country` (enum, optional, nullable) — Country of the health system. Random if omitted.
  - Allowed values: `US`, `CA`
- `region` (string, optional, nullable) — State or province for the health system, e.g. 'Ohio'. Random if omitted.
- `outputs` (list of CohortRequestOutputsItems, optional) — Each patient's `fhir` bundle, `notes`, and `pdf`s (as for a job), and `bulk`: the whole cohort as FHIR Bulk Data (NDJSON).
- `seed` (integer, optional, nullable) — Random seed: the same request gives the same cohort.

## Response

### 200

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

- `id` (string, required)
- `status` (enum, required)
  - Allowed values: `queued`, `running`, `succeeded`, `failed`, `canceled`
- `created_at` (datetime, required)
- `size` (integer, required) — Patients requested.
- `max_documents` (integer, required) — Most documents the cohort can produce (size x documents per patient).
- `progress` (CohortProgress, required) — Patients by status.
- `started_at` (datetime, optional, nullable)
- `finished_at` (datetime, optional, nullable)
- `error` (JobError, optional, nullable) — Why the cohort failed, if it did.
- `summary` (CohortSummary, optional, nullable) — What was delivered, once succeeded.
- `results` (list of CohortResultFile, 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)
- `size` (integer, required) — Patients requested.
- `max_documents` (integer, required) — Most documents the cohort can produce (size x documents per patient).
- `progress` (CohortProgress, required) — Patients by status.
- `started_at` (datetime, optional, nullable)
- `finished_at` (datetime, optional, nullable)
- `error` (JobError, optional, nullable) — Why the cohort failed, if it did.
- `summary` (CohortSummary, optional, nullable) — What was delivered, once succeeded.
- `results` (list of CohortResultFile, 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

### IntRange

An inclusive range; each patient gets a value in it.

- `min` (integer, required)
- `max` (integer, required)

### ConditionPrevalence

- `name` (string, required) — Condition as free text, e.g. 'type 2 diabetes mellitus'.
- `proportion` (double, required) — Share of the cohort with it, e.g. 0.3 for 30%.
- `primary` (boolean, optional, default: false) — A primary condition (one the chart is mainly about) for the patients given it. If none of a patient's conditions is marked, all of them are primary.

### 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.

### CohortRequestOutputsItems

- enum
  - Allowed values: `fhir`, `notes`, `pdf`
- "bulk"

### CohortProgress

- `queued` (integer, required)
- `running` (integer, required)
- `succeeded` (integer, required)
- `failed` (integer, required)
- `canceled` (integer, required)

### 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.

### CohortSummary

- `patients` (integer, required)
- `succeeded` (integer, required)
- `failed` (integer, required)
- `canceled` (integer, required)
- `documents` (integer, required) — Clinical documents delivered.
- `failures` (list of PatientFailure, required) — Patients that failed; the others are delivered.
- `health_system` (HealthSystemSummary, required)
- `conditions` (ConditionCounts, optional, nullable)

### CohortResultFile

- `name` (enum, required) — Use in the download URL.
  - Allowed values: `patients`, `bulk`, `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.

### PatientFailure

- `index` (integer, required) — The patient's position in the cohort, from 1.
- `error` (JobError, required, nullable)

### HealthSystemSummary

- `region` (string, required, nullable) — State or province.
- `country` (string, required, nullable)
- `facilities` (integer, required)
- `clinicians` (integer, required)

### ConditionCounts

- `requested` (list of RequestedCondition, required)
- `most_common` (list of CommonCondition, required) — Up to 15, most frequent first.

### RequestedCondition

- `name` (string, required) — As in the request.
- `proportion` (double, required)
- `assigned` (integer, required) — Patients it was given to.
- `code` (string, required, nullable) — SNOMED CT code it was coded as.
- `display` (string, required, nullable)
- `patients` (integer, required, nullable) — Patients who have it: those assigned it, and others in whom it arose, counting more specific kinds of it and conditions due to it (by the SNOMED CT hierarchy).

### CommonCondition

- `code` (string, required) — SNOMED CT code.
- `display` (string, required)
- `patients` (integer, required) — Patients with it, or a more specific kind of it.

## Examples

### A cohort with condition prevalence

**Request**

```json
{
  "size": 20,
  "age": {
    "min": 45,
    "max": 85
  },
  "female_proportion": 0.5,
  "complexity": {
    "min": 3,
    "max": 8
  },
  "conditions": [
    {
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    },
    {
      "name": "essential hypertension",
      "proportion": 0.5
    }
  ],
  "documents_per_patient": {
    "min": 3,
    "max": 6
  },
  "country": "US",
  "region": "Ohio",
  "outputs": [
    "fhir",
    "notes",
    "bulk"
  ],
  "seed": 7
}
```

**Response**

```json
{
  "id": "2ed6b3ce-e415-4749-9de8-d0c71e72a8a6",
  "status": "queued",
  "created_at": "2026-10-15T07:40:11.313683Z",
  "size": 20,
  "max_documents": 120,
  "progress": {
    "queued": 0,
    "running": 0,
    "succeeded": 0,
    "failed": 0,
    "canceled": 0
  },
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A cohort with condition prevalence
import requests

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

payload = {
    "size": 20,
    "age": {
        "min": 45,
        "max": 85
    },
    "female_proportion": 0.5,
    "complexity": {
        "min": 3,
        "max": 8
    },
    "conditions": [
        {
            "name": "type 2 diabetes mellitus",
            "proportion": 0.3
        },
        {
            "name": "essential hypertension",
            "proportion": 0.5
        }
    ],
    "documents_per_patient": {
        "min": 3,
        "max": 6
    },
    "country": "US",
    "region": "Ohio",
    "outputs": ["fhir", "notes", "bulk"],
    "seed": 7
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A cohort with condition prevalence
const url = 'https://synth.emtelligent.com/v1/cohorts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"size":20,"age":{"min":45,"max":85},"female_proportion":0.5,"complexity":{"min":3,"max":8},"conditions":[{"name":"type 2 diabetes mellitus","proportion":0.3},{"name":"essential hypertension","proportion":0.5}],"documents_per_patient":{"min":3,"max":6},"country":"US","region":"Ohio","outputs":["fhir","notes","bulk"],"seed":7}'
};

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

```go A cohort with condition prevalence
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\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 cohort with condition prevalence
require 'uri'
require 'net/http'

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

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  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}"

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

```java A cohort with condition prevalence
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/cohorts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}")
  .asString();
```

```php A cohort with condition prevalence
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/cohorts', [
  'body' => '{
  "size": 20,
  "age": {
    "min": 45,
    "max": 85
  },
  "female_proportion": 0.5,
  "complexity": {
    "min": 3,
    "max": 8
  },
  "conditions": [
    {
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    },
    {
      "name": "essential hypertension",
      "proportion": 0.5
    }
  ],
  "documents_per_patient": {
    "min": 3,
    "max": 6
  },
  "country": "US",
  "region": "Ohio",
  "outputs": [
    "fhir",
    "notes",
    "bulk"
  ],
  "seed": 7
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A cohort with condition prevalence
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/cohorts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A cohort with condition prevalence
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "size": 20,
  "age": [
    "min": 45,
    "max": 85
  ],
  "female_proportion": 0.5,
  "complexity": [
    "min": 3,
    "max": 8
  ],
  "conditions": [
    [
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    ],
    [
      "name": "essential hypertension",
      "proportion": 0.5
    ]
  ],
  "documents_per_patient": [
    "min": 3,
    "max": 6
  ],
  "country": "US",
  "region": "Ohio",
  "outputs": ["fhir", "notes", "bulk"],
  "seed": 7
] as [String : Any]

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

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

**Request**

```json
{
  "size": 5
}
```

**Response**

```json
{
  "id": "97aaea8a-1f20-4285-bd4b-18bcf3a41c10",
  "status": "queued",
  "created_at": "2026-10-15T07:40:11.341285Z",
  "size": 5,
  "max_documents": 40,
  "progress": {
    "queued": 0,
    "running": 0,
    "succeeded": 0,
    "failed": 0,
    "canceled": 0
  },
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A small random cohort
import requests

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

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

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

print(response.json())
```

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

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

```go A small random cohort
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"size\": 5\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 small random cohort
require 'uri'
require 'net/http'

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

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  \"size\": 5\n}"

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp A small random cohort
using RestSharp;

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

```swift A small random cohort
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://synth.emtelligent.com/v1/cohorts")! 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 cohort with condition prevalence

**Request**

```json
{
  "size": 20,
  "age": {
    "min": 45,
    "max": 85
  },
  "female_proportion": 0.5,
  "complexity": {
    "min": 3,
    "max": 8
  },
  "conditions": [
    {
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    },
    {
      "name": "essential hypertension",
      "proportion": 0.5
    }
  ],
  "documents_per_patient": {
    "min": 3,
    "max": 6
  },
  "country": "US",
  "region": "Ohio",
  "outputs": [
    "fhir",
    "notes",
    "bulk"
  ],
  "seed": 7
}
```

**Response**

```json
{
  "id": "2ed6b3ce-e415-4749-9de8-d0c71e72a8a6",
  "status": "queued",
  "created_at": "2026-10-15T07:40:11.313683Z",
  "size": 20,
  "max_documents": 120,
  "progress": {
    "queued": 0,
    "running": 0,
    "succeeded": 0,
    "failed": 0,
    "canceled": 0
  },
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A cohort with condition prevalence
import requests

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

payload = {
    "size": 20,
    "age": {
        "min": 45,
        "max": 85
    },
    "female_proportion": 0.5,
    "complexity": {
        "min": 3,
        "max": 8
    },
    "conditions": [
        {
            "name": "type 2 diabetes mellitus",
            "proportion": 0.3
        },
        {
            "name": "essential hypertension",
            "proportion": 0.5
        }
    ],
    "documents_per_patient": {
        "min": 3,
        "max": 6
    },
    "country": "US",
    "region": "Ohio",
    "outputs": ["fhir", "notes", "bulk"],
    "seed": 7
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript A cohort with condition prevalence
const url = 'https://synth.emtelligent.com/v1/cohorts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"size":20,"age":{"min":45,"max":85},"female_proportion":0.5,"complexity":{"min":3,"max":8},"conditions":[{"name":"type 2 diabetes mellitus","proportion":0.3},{"name":"essential hypertension","proportion":0.5}],"documents_per_patient":{"min":3,"max":6},"country":"US","region":"Ohio","outputs":["fhir","notes","bulk"],"seed":7}'
};

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

```go A cohort with condition prevalence
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\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 cohort with condition prevalence
require 'uri'
require 'net/http'

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

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  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}"

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

```java A cohort with condition prevalence
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://synth.emtelligent.com/v1/cohorts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}")
  .asString();
```

```php A cohort with condition prevalence
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://synth.emtelligent.com/v1/cohorts', [
  'body' => '{
  "size": 20,
  "age": {
    "min": 45,
    "max": 85
  },
  "female_proportion": 0.5,
  "complexity": {
    "min": 3,
    "max": 8
  },
  "conditions": [
    {
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    },
    {
      "name": "essential hypertension",
      "proportion": 0.5
    }
  ],
  "documents_per_patient": {
    "min": 3,
    "max": 6
  },
  "country": "US",
  "region": "Ohio",
  "outputs": [
    "fhir",
    "notes",
    "bulk"
  ],
  "seed": 7
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp A cohort with condition prevalence
using RestSharp;

var client = new RestClient("https://synth.emtelligent.com/v1/cohorts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"size\": 20,\n  \"age\": {\n    \"min\": 45,\n    \"max\": 85\n  },\n  \"female_proportion\": 0.5,\n  \"complexity\": {\n    \"min\": 3,\n    \"max\": 8\n  },\n  \"conditions\": [\n    {\n      \"name\": \"type 2 diabetes mellitus\",\n      \"proportion\": 0.3\n    },\n    {\n      \"name\": \"essential hypertension\",\n      \"proportion\": 0.5\n    }\n  ],\n  \"documents_per_patient\": {\n    \"min\": 3,\n    \"max\": 6\n  },\n  \"country\": \"US\",\n  \"region\": \"Ohio\",\n  \"outputs\": [\n    \"fhir\",\n    \"notes\",\n    \"bulk\"\n  ],\n  \"seed\": 7\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift A cohort with condition prevalence
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "size": 20,
  "age": [
    "min": 45,
    "max": 85
  ],
  "female_proportion": 0.5,
  "complexity": [
    "min": 3,
    "max": 8
  ],
  "conditions": [
    [
      "name": "type 2 diabetes mellitus",
      "proportion": 0.3
    ],
    [
      "name": "essential hypertension",
      "proportion": 0.5
    ]
  ],
  "documents_per_patient": [
    "min": 3,
    "max": 6
  ],
  "country": "US",
  "region": "Ohio",
  "outputs": ["fhir", "notes", "bulk"],
  "seed": 7
] as [String : Any]

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

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

**Request**

```json
{
  "size": 5
}
```

**Response**

```json
{
  "id": "97aaea8a-1f20-4285-bd4b-18bcf3a41c10",
  "status": "queued",
  "created_at": "2026-10-15T07:40:11.341285Z",
  "size": 5,
  "max_documents": 40,
  "progress": {
    "queued": 0,
    "running": 0,
    "succeeded": 0,
    "failed": 0,
    "canceled": 0
  },
  "started_at": null,
  "finished_at": null,
  "error": null,
  "summary": null,
  "results": [],
  "results_expire_at": null
}
```

**SDK Code**

```python A small random cohort
import requests

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

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

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

print(response.json())
```

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

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

```go A small random cohort
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"size\": 5\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 small random cohort
require 'uri'
require 'net/http'

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

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  \"size\": 5\n}"

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp A small random cohort
using RestSharp;

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

```swift A small random cohort
import Foundation

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

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

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