---
title: "Enable Storage Management for a bucket"
method: PUT
path: "/api/v2/cloudinventoryservice/syncconfigs"
tags: ["Storage Management"]
---

# Enable Storage Management for a bucket

`PUT /api/v2/cloudinventoryservice/syncconfigs`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/cloudinventoryservice/syncconfigs`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Enable Storage Management for an S3 bucket, GCS bucket, or Azure container by registering the destination that holds its inventory reports. Set `data.id` to the cloud provider (`aws`, `gcp`, or `azure`) and provide the matching settings under data.attributes. Calling this endpoint with the same provider replaces the existing configuration.

## Request body

- UpsertCloudInventorySyncConfigRequest: Request body for creating or updating a cloud inventory sync configuration.
  - `data` UpsertCloudInventorySyncConfigRequestData, required: Storage Management configuration data for the create or update request.
    - `attributes` UpsertCloudInventorySyncConfigRequestAttributes, required: Settings for the cloud provider specified in `data.id`. Include only the matching provider object (`aws`, `gcp`, or `azure`).
      - `aws` CloudInventorySyncConfigAWSRequestAttributes: AWS settings for the S3 bucket Storage Management reads inventory reports from.
        - `aws_account_id` string, required: AWS account ID that owns the inventory bucket.
        - `destination_bucket_name` string, required: Name of the S3 bucket containing inventory files.
        - `destination_bucket_region` string, required: AWS Region of the inventory bucket.
        - `destination_prefix` string: Object key prefix where inventory reports are written. Omit or set to `/` when reports are written at the bucket root.
      - `azure` CloudInventorySyncConfigAzureRequestAttributes: Azure settings for the storage account and container with inventory data.
        - `client_id` string, required: Azure AD application (client) ID used for access.
        - `container` string, required: Blob container name.
        - `resource_group` string, required: Resource group containing the storage account.
        - `storage_account` string, required: Storage account name.
        - `subscription_id` string, required: Azure subscription ID.
        - `tenant_id` string, required: Azure AD tenant ID.
      - `gcp` CloudInventorySyncConfigGCPRequestAttributes: GCP settings for buckets involved in inventory reporting.
        - `destination_bucket_name` string, required: GCS bucket name where Datadog reads inventory reports.
        - `project_id` string, required: GCP project ID for the inventory destination bucket.
        - `service_account_email` string, required: Service account email used to read the destination bucket.
        - `source_bucket_name` string, required: GCS bucket name that inventory reports are generated for.
    - `id` 'aws' | 'gcp' | 'azure', required: Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`.
    - `type` 'cloud_provider', required: Always `cloud_provider`.

## Response `200`

OK

- CloudInventorySyncConfigResponse: Storage Management configuration returned after a create or update. Additional read-only fields appear on list and get responses.
  - `data` CloudInventorySyncConfigResponseData, required: Storage Management configuration data.
    - `attributes` CloudInventorySyncConfigAttributes, required: Attributes for a Storage Management configuration. Fields other than `id` may be empty in the response immediately after a create or update; subsequent reads return the full configuration.
      - `aws_account_id` string, required: AWS account ID for the inventory bucket.
      - `aws_bucket_name` string, required: AWS S3 bucket name for inventory files.
      - `aws_region` string, required: AWS Region for the inventory bucket.
      - `azure_client_id` string, required: Azure AD application (client) ID.
      - `azure_container_name` string, required: Azure blob container name.
      - `azure_storage_account_name` string, required: Azure storage account name.
      - `azure_tenant_id` string, required: Azure AD tenant ID.
      - `cloud_provider` 'aws' | 'gcp' | 'azure', required: Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`.
      - `error` string, required: Human-readable error detail when sync is unhealthy.
      - `error_code` string, required: Machine-readable error code when sync is unhealthy.
      - `gcp_bucket_name` string, required: GCS bucket name for inventory files Datadog reads.
      - `gcp_project_id` string, required: GCP project ID.
      - `gcp_service_account_email` string, required: Service account email for bucket access.
      - `prefix` string, required: Object key prefix where inventory reports are written. Returns `/` when reports are written at the bucket root.
    - `id` string, required: Unique identifier for this Storage Management configuration.
    - `type` 'sync_configs', required: Always `sync_configs`.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
