# Generate a semantic diff against an existing agent without mutation.

Source: <https://everruns.com/docs/api/operations/diff_agent_package/>

POST

/v1/agents/diff

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/agents/diff';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"content":"example","file":"example","format":"example","target":"example"}'
};


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://app.everruns.com/api/v1/agents/diff \
  --header 'Content-Type: application/json' \
  --data '{ "content": "example", "file": "example", "format": "example", "target": "example" }'
```

* Production APIapp.everruns.com/api/v1/agents/diff

## Parameters

### Query Parameters

**from-example**

string

Import from a built-in example by name (e.g. `dad-jokes-agent`). When set, the request body is ignored.

**target**

string

Explicit target agent name for an update. Omit to create a new agent.

**format**

string

Input format: markdown, toml, yaml, json or zip. Omit to detect it.

## Request Bodyrequired

Media typeapplication/json

A self-contained agent definition or package in the current session workspace.

object

**content**

Markdown/TOML/YAML/JSON agent definition, with assets embedded.

string

**file**

Path in the current Platform Chat session workspace (never server disk).

string | null

**format**

Text encoding: auto, markdown, toml, yaml or json. Defaults to auto-detection.

string | null

**target**

Existing agent name to update or compare. Omit to create.

string | null

##### Examplegenerated

```json
{
  "content": "example",
  "file": "example",
  "format": "example",
  "target": "example"
}
```

## Responses

### 200

Semantic changes

Media typeapplication/json

##### Examplegenerated

```json
example
```