# Preview Agent source changes

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

[Docs](https://everruns.com/docs/)/[API reference](https://everruns.com/docs/api/)/[Agents & authoring](https://everruns.com/docs/api/groups/agents-authoring/)/Preview Agent source changes

# Preview Agent source changes

Preview

Validate and compare a GitHub Agent package without changing the Agent.

Public APIEverruns Cloud and self-hosted Platform

POST`/v1/agents/{agent_id}/source/preview`

See [authentication](https://everruns.com/docs/sre/runbooks/authentication/) for credentials and permissions.

## Parameters

### Path Parameters

**agent_id**

required

string

Prefixed public identifier

## Request Bodyrequired

Media typeapplication/json

Repository, branch and package path that define an Agent’s GitHub source.

object

**branch**

required

Branch whose future commits the Agent follows.

string

### Example

```plaintext
main
```

**path**

Repository-relative package folder or manifest; empty selects the repository root.

string

### Example

```plaintext
agents/support
```

**repository**

required

GitHub repository in owner/name form.

string

### Example

```plaintext
acme/agents
```

## Responses

200Success

### 200

Success

Media typeapplication/json

### Example generated

```json
example
```

FetchcURL

Request

```js
const url = 'https://app.everruns.com/api/v1/agents/example/source/preview';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"branch":"main","path":"agents/support","repository":"acme/agents"}'
};


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

Request

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/agents/example/source/preview \
  --header 'Content-Type: application/json' \
  --data '{ "branch": "main", "path": "agents/support", "repository": "acme/agents" }'
```

Additional language examples require JavaScript. The default request example is available above.

200

200 · Success

No response body example is declared for this status.

## Matching endpoints