> 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

Use GraphQL to manage exporting your audit logs to Amazon S3 and ADLS Gen2

{% 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 for small changes, such as rotating a token, rather than deleting it and creating a new one. Updating the existing configuration prevents unnecessary disruption, but it does not recover historical exports missed before the update.

{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
