> For the complete documentation index, see [llms.txt](https://documentation.immuta.com/saas/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.immuta.com/saas/govern/detect-your-data/audit/reference-guides/immuta-audit-export-to-s3-and-adls-gen2-graphql-reference-guide.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` 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>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
