> For the complete documentation index, see [llms.txt](https://faloker.gitbook.io/purify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faloker.gitbook.io/purify/getting-started/upload-report.md).

# Reports

Here you can find a way to upload your reports to Purify.

## Requirements

To upload a report you need to have:

1. Project and unit within this project

## Uploading

When uploading reports, you have two options: via the user interface on the reports tab of a specific unit, or via the API.

### Files

Now you can upload the report as **JSON** or **XML** file.

{% hint style="warning" %}
**unitName** is a combination of the project name and the unit name. In the example below

```
osint.google
```

The project name is **osint** and the unit name is **google**.
{% endhint %}

```bash
http -f POST https://hostname/api/units/bla.bla/reports  \
    "apikey: $PURIFY_TOKEN" \
    file@gitleaks-example.json
```

If you already created a template for such tool, you need to provide it, so report content will be parsed automatically

```bash
http -f POST https://hostname/api/units/bla.bla/reports  \
    "apikey: $PURIFY_TOKEN" \
    template="gitleaks" \
    file@gitleaks-example.json
```

### UI

And, of course, you can upload reports via the user interface, you can find the button for uploading at the **Reports** tab of a particular unit:

![](https://88240658-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3I4ZhftILe_kBZUamw%2F-MKVOUVEN4fYUwcbq558%2F-MKVSCp1kUOW8jwtTT7P%2FScreenshot%202020-10-25%20at%2017.49.39.png?alt=media\&token=c6584d92-94df-4c9a-b474-e688dea65d76)

### Oneshot

In addition, you can upload your results as separate JSON objects. The most common use case is getting events from the webhook from other tools or systems.

{% hint style="warning" %}
This can be done only via API.
{% endhint %}

To upload a oneshot:

```bash
http POST :3000/api/units/bla.bla/oneshots \
    "apikey: $PURIFY_TOKEN" \
    < Downloads/gitleaks-one-object.json
```

To apply a template:

```bash
http POST :3000/api/units/bla.bla/oneshots/gitleaks \
    "apikey: $PURIFY_TOKEN" \
    < Downloads/gitleaks-one-object.json
```

## API Reference

<https://purify-develop.herokuapp.com/swagger/#/reports>
