# Reports

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://faloker.gitbook.io/purify/getting-started/upload-report.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
