# Merge reports

Source: https://deeperesearch.com/docs/api/reference/operations/createmerge/

POST

/v1/research/{id}/merge

```js
const url = 'https://deeperesearch.com/v1/research/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"mode":"comparison","instructions":"Focus on reliability and operating cost","max_cost_usd":3}'
};


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

```sh
curl --request POST \
  --url https://deeperesearch.com/v1/research/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "mode": "comparison", "instructions": "Focus on reliability and operating cost", "max_cost_usd": 3 }'
```

Combines the research’s finished mergeable reports into one synthesis report with checked citations. You can merge again with another model or mode. The synthesis appears in the research’s reports when the merge completes.

## Authorizations

- **[apiKey](https://deeperesearch.com/docs/api/reference/#apikey)**

## Parameters

### Path Parameters

**id**

required

string format: uuid

### Header Parameters

**Idempotency-Key**

string

<= 255 characters

Up to 255 characters. Retrying with the same key returns the original instead of starting (and charging) again.

## Request Bodyrequired

application/json

object

**model**

A synthesis model id from GET /v1/merge/models. Defaults to the default model.

string

\>= 1 characters <= 120 characters

**thinking**

Reasoning depth. Defaults to the model’s default.

string

Allowed values: off low medium high

**mode**

Comprehensive (default), executive or comparison.

string

Allowed values: comprehensive executive comparison

**instructions**

What the synthesis should focus on. Up to 1,000 characters.

string

<= 1000 characters

**report_ids**

Only merge these provider reports. Defaults to every finished mergeable report.

Array\<string>

\>= 1 items <= 16 items

**max_cost_usd**

Refuse to start if the worst case (hold_usd) is above this.

number

\> 0 <= 10000

### Example

```json
{
  "mode": "comparison",
  "instructions": "Focus on reliability and operating cost",
  "max_cost_usd": 3
}
```

## Responses

### 200

Already started with this Idempotency-Key

application/json

object

**id**

required

string format: uuid

**object**

required

string

Allowed value: merge

**research_id**

required

string format: uuid

**trigger**

required

Auto: requested with the research; manual: started afterwards

string

Allowed values: auto manual

**model**

required

string

**thinking**

required

string

Allowed values: off low medium high

**mode**

required

string

Allowed values: comprehensive executive comparison

**instructions**

required

string | null

**state**

required

string

Allowed values: pending running completed failed skipped cancelled

**source_report_ids**

required

Array\<string>

**excluded_reports**

required

Array\<object>

A report left out of a merge, and why.

object

**report_id**

required

Any of:

- string

  string format: uuid

- null

  null

**vendor**

required

string

**offering**

required

string

**reason**

required

string

**resolved_provider**

required

string | null

**two_stage**

required

boolean

**estimate_usd**

required

US dollars

number

**charged_usd**

required

Any of:

- number

  US dollars

  number

- null

  null

**error**

required

string | null

**created_at**

required

ISO 8601 timestamp, UTC

string

**started_at**

required

Any of:

- string

  ISO 8601 timestamp, UTC

  string

- null

  null

**finished_at**

required

Any of:

- string

  ISO 8601 timestamp, UTC

  string

- null

  null

#### Example

```json
{
  "object": "merge",
  "trigger": "auto",
  "thinking": "off",
  "mode": "comprehensive",
  "state": "pending"
}
```

### 202

Started

application/json

object

**id**

required

string format: uuid

**object**

required

string

Allowed value: merge

**research_id**

required

string format: uuid

**trigger**

required

Auto: requested with the research; manual: started afterwards

string

Allowed values: auto manual

**model**

required

string

**thinking**

required

string

Allowed values: off low medium high

**mode**

required

string

Allowed values: comprehensive executive comparison

**instructions**

required

string | null

**state**

required

string

Allowed values: pending running completed failed skipped cancelled

**source_report_ids**

required

Array\<string>

**excluded_reports**

required

Array\<object>

A report left out of a merge, and why.

object

**report_id**

required

Any of:

- string

  string format: uuid

- null

  null

**vendor**

required

string

**offering**

required

string

**reason**

required

string

**resolved_provider**

required

string | null

**two_stage**

required

boolean

**estimate_usd**

required

US dollars

number

**charged_usd**

required

Any of:

- number

  US dollars

  number

- null

  null

**error**

required

string | null

**created_at**

required

ISO 8601 timestamp, UTC

string

**started_at**

required

Any of:

- string

  ISO 8601 timestamp, UTC

  string

- null

  null

**finished_at**

required

Any of:

- string

  ISO 8601 timestamp, UTC

  string

- null

  null

#### Example

```json
{
  "object": "merge",
  "trigger": "auto",
  "thinking": "off",
  "mode": "comprehensive",
  "state": "pending"
}
```

### 400

The body isn’t valid JSON (invalid_json)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 401

Missing or invalid API key (unauthorized)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 402

Not enough credit for the worst case (insufficient_credit)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 403

The key lacks the scope this needs (forbidden)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 404

Not found in this organization (not_found)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 409

Conflicts with the current state, e.g. not_cancellable or idempotency_conflict

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 413

The body is over 128 KB (body_too_large)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 422

Invalid request; the message names the field (invalid_request, exceeds_max_cost, vendor_unavailable, …)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 429

Rate limit, spending limit or quota reached (rate_limited, limit_reached, quota_exceeded). See Retry-After.

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 503

The feature isn’t available on this server (merge_unavailable)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```
