---
title: "Create an S3 data forwarding rule."
method: POST
path: "/v1/logsDataForwarding/rules"
tags: ["logsDataForwardingManagement"]
---

# Create an S3 data forwarding rule.

`POST /v1/logsDataForwarding/rules`

Create a data forwarding rule to send data from a Partition or Scheduled View to an S3 bucket.

## Request body

- CreateDataForwardingRule
  - `indexId` string, required — The `id` of the Partition or Scheduled View the rule applies to.
  - `destinationId` string, required — The data forwarding destination id.
  - `enabled` boolean — True when the data forwarding rule is enabled.
  - `fileFormat` string — Specify the path prefix to a directory in the S3 bucket and how to format the file name.
  - `payloadSchema` string — Schema for the payload. Default value of the payload schema is "allFields" for scheduled view, and "builtInFields" for partition. "raw" payloadSchema should be used in conjunction with "text" format and vice-versa.
  - `format` string — Format of the payload. Default format will be "csv". "text" format should be used in conjunction with "raw" payloadSchema and vice-versa.

## Response `200`

The data forwarding rule was created.

- DataForwardingRule
  - `indexId` string, required — The `id` of the Partition or Scheduled View the rule applies to.
  - `destinationId` string, required — The data forwarding destination id.
  - `enabled` boolean — True when the data forwarding rule is enabled.
  - `fileFormat` string — Specify the path prefix to a directory in the S3 bucket and how to format the file name.
  - `payloadSchema` string — Schema for the payload. Default value of the payload schema is "allFields" for scheduled view, and "builtInFields" for partition. "raw" payloadSchema should be used in conjunction with "text" format and vice-versa.
  - `format` string — Format of the payload. Default format will be "csv". "text" format should be used in conjunction with "raw" payloadSchema and vice-versa.
  - `createdAt` string, date-time, required — Creation timestamp in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
  - `createdBy` string, required — Identifier of the user who created the resource.
  - `modifiedAt` string, date-time, required — Last modification timestamp in UTC.
  - `modifiedBy` string, required — Identifier of the user who last modified the resource.
  - `id` string — The unique identifier of the data forwarding rule.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/revisions/e4e4c7554890/schema)
