> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS S3 Sink

## Introduction

The S3 sink writes Run results to any S3-compatible storage as JSON files. This is useful for persisting results and accessing them later.

## Usage

S3 sinks can be used with either the [Run API](/client-apis/api-reference/projectsruns/run-api--start) or the [Job API](/client-apis/api-reference/projectsjobs/create-job).

When creating a Run or Job, specify the sink type as `s3` and provide the necessary S3 configuration such as `bucket`, `accessKeyId`, `secretAccessKey`, and `region`. You can also optionally provide a `prefix` to organize files within the bucket. See the Configuration section below for full details on available options.

## Configuration

### Properties

<ParamField body="type" type="enum<string>" required>
  The type of sink.

  Available options: `s3`
</ParamField>

<ParamField body="bucket" type="string" required>
  The name of the S3 bucket where Run results will be stored.

  Example: `my-s3-bucket`
</ParamField>

<ParamField body="accessKeyId" type="string" required>
  The access key ID for the S3 bucket.

  Example: `AKIAIOSFODNN7EXSSPLE`
</ParamField>

<ParamField body="secretAccessKey" type="string" required>
  The secret access key for the S3 bucket.

  Example: `wJalrXUtnFFFI/K7MDENG/bsxRfiCYEXAMPLEKEY`
</ParamField>

<ParamField body="region" type="string" required>
  The region where the S3 bucket is located.

  Example: `us-west-2`
</ParamField>

<ParamField body="prefix" type="string">
  Optional prefix for the S3 objects. This can be used to organize objects within the bucket.

  Example: `my-prefix/`
</ParamField>

<ParamField body="skipOnFail" type="boolean" default="false">
  If true, failed Runs will not be written to the bucket.
</ParamField>

<ParamField body="apisToSend" type="array<string>">
  List of API names to include. If not provided, results from all APIs are written.

  Example: `["api1", "api2"]`
</ParamField>

<ParamField body="endpoint" type="string">
  Optional custom endpoint for the S3 bucket. This can be used for S3-compatible services.

  Example: `https://s3.custom-endpoint.com`
</ParamField>

<ParamField body="forcePathStyle" type="boolean">
  If true, the S3 client will use path-style URLs instead of virtual-hosted-style URLs. This is useful for S3-compatible services that require path-style access.

  Example: `true`
</ParamField>

### Example Configuration

```json theme={null}
{
  // other run/job configuration fields
  ....
  "sink": {
    "type": "s3",
    "bucketName": "my-bucket",
    "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
    "secretAccessKey": "wJalrXUtnFFFI/SSSSSSSbsxRfiCYEXAMPLEKEY",
    "region": "us-west-2",
    "prefix": "my-prefix/",
    "skipOnFail": false
  }
}
```

## File content

Each file is a `.json` file containing the API Run result along with additional metadata. See the [sink body page](./body) for more information on the payload structure.
