# Audit Export GraphQL Reference Guide

{% hint style="info" %}
**Public preview**: This feature is available to all accounts.
{% endhint %}

Use these audit export configuration commands to manage exporting your audit logs to S3 and ADLS Gen2. To configure an audit export see the [Export to S3](/saas/govern/detect-your-data/audit/how-to-guides/enable-uam.md) or [Export to ADLS](/saas/govern/detect-your-data/audit/how-to-guides/export-adls.md) guides.

## Disable a configuration

To disable a configuration, use the `disableExportConfiguration` mutation:

{% tabs %}
{% tab title="Mutation" %}

```graphql
mutation {
  disableExportConfiguration(
    id: "<export configuration ID>"
  )
  {
    id
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
"data": {
  "disableExportConfiguration": {
    "id": "<export configuration ID>"
  }
}
```

{% endtab %}
{% endtabs %}

## Enable a configuration

To enable a disabled configuration, use the `enableExportConfiguration` mutation:

{% tabs %}
{% tab title="Mutation" %}

```graphql
mutation {
  enableExportConfiguration(
    id: "<export configuration ID>"
  )
  {
    id
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
"data": {
  "enableExportConfiguration": {
    "id": "<export configuration ID>"
  }
}
```

{% endtab %}
{% endtabs %}

### Delete a configuration

To delete a configuration, use the `deleteExportConfiguration` mutation:

{% tabs %}
{% tab title="Mutation" %}

```graphql
mutation {
  deleteExportConfiguration(
    id: "<export configuration ID>"
  )
  {
    id
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
"data": {
  "deleteExportConfiguration": {
    "id": "<export configuration ID>"
  }
}
```

{% endtab %}
{% endtabs %}

## Update a configuration

To update an existing configuration, use the mutation for your specific export configuration:

* [Export to S3 with access key](/saas/govern/detect-your-data/audit/how-to-guides/enable-uam.md#how-to-export-using-an-access-key): `updateS3AccessKeyExportConfiguration`
* [Export to S3 with assumed role](/saas/govern/detect-your-data/audit/how-to-guides/enable-uam.md#how-to-export-using-an-aws-iam-role): `updateS3AssumedRoleExportConfiguration`
* [Export to ADLS](/saas/govern/detect-your-data/audit/how-to-guides/export-adls.md): `updateAdlsSasTokenExportConfiguration`

Update the configuration to make small changes, i.e., to rotate the token, rather than deleting the existing one and creating a new one.

{% tabs %}
{% tab title="Mutation" %}

```graphql
mutation {
    updateAdlsSasTokenExportConfiguration(
        data: {
            id: "<export configuration ID>"
            interval: EVERY_2_HOURS
            storageAccount: "your-adls-storage-account",
            fileSystem: "audit-output",
            path: "immuta-audit",
            sasToken: "your-sas-token"
        } 
     ) 
     {
       id
       interval
       enabled
       endpointConfiguration {
            __typename
            ... on AdlsSasTokenEndpointConfiguration {
                storageAccount
                path
                fileSystem
            }
        }
    }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
    "data": {
        "updateAdlsSasTokenExportConfiguration": {
            "id": "<export configuration ID>",
            "interval": "EVERY_12_HOURS",
            "enabled": true,
            "endpointConfiguration": {
                "storageAccount": "your-adls-storage-account",
                "fileSystem": "audit-output",
                "path": "immuta-audit"
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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://documentation.immuta.com/saas/govern/detect-your-data/audit/reference-guides/immuta-audit-export-to-s3-and-adls-gen2-graphql-reference-guide.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.
