# Mutations / Reports

# Reports

**Mutation**
## deleteReport — Returns [FavouriteReportInterface](/documentation/Interfaces/Favourite-Report-Interface#FavouriteReportInterface)

**Scopes required:** run_actions_reports, run_sales_reports, run_inventory_reports, run_purchase_reports

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the report to delete |

**Example Mutation**

```graphql
mutation DeleteReport($id: ID!) {
    deleteReport(id: $id) {
        id,
        name,
        layers,
        nextEmailDate,
        syntaxErrors
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## saveReport — Returns *boolean*

<p class="scopes"><span class="scope scope--none">No scope required</span></p>

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID](/documentation/Types/UUID#UUID) | The ID of the report (specify if updating a report, leave if saving a new report) |
| name | *String* | The name of the report |
| type | [ReportTypeEnum](/documentation/Enums/Report-Type-Enum#ReportTypeEnum) | The type of report this is |
| layers | *Float* | The maximum layers of depth that the reports will export (if unset will export all data) |
| query | *String* | The report query to run |

**Example Mutation**

```graphql
mutation SaveReports($id: ID) {
    saveReport(id: $id)
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## saveSpecialReport — Returns *boolean*

<p class="scopes"><span class="scope scope--none">No scope required</span></p>

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID](/documentation/Types/UUID#UUID) | The ID of the report (specify if updating a report, leave if saving a new report) |
| name | *String* | The name of the report |
| type | [SpecialReportTypeEnum](/documentation/Enums/Special-Report-Type-Enum#SpecialReportTypeEnum) | The type of report this is |
| layers | *Float* | The maximum layers of depth that the reports will export (if unset will export all data) |
| query | [SpecialReportQueryInput!](/documentation/Inputs/Reports#SpecialReportQueryInput) | The report query to run |

**Example Mutation**

```graphql
mutation SaveSpecialReport($query: SpecialReportQueryInput!) {
    saveSpecialReport(query: $query)
}

# Example variables
{
    "query": {
        "parameters": "<PARAMETERS>"
    }
}
```

**Mutation**
## updateReportEmailSettings — Returns [FavouriteReportInterface](/documentation/Interfaces/Favourite-Report-Interface#FavouriteReportInterface)

**Scopes required:** modify_report_email_settings

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the report to update the email settings for |
| emailSettings | [FavouriteReportEmailSettingsInput](/documentation/Inputs/Favourite-Report-Email-Settings-Input#FavouriteReportEmailSettingsInput) | The email settings to use |

**Example Mutation**

```graphql
mutation UpdateEmailSettings($id: ID!) {
    updateReportEmailSettings(id: $id) {
        id,
        name,
        layers,
        nextEmailDate,
        syntaxErrors
    }
}

# Example variables
{
    "id": "<ID>"
}
```