---
title: "Update a Distribution Object"
method: PATCH
path: "/distributions/{distributionKey}"
tags: ["Distributions"]
---

# Update a Distribution Object

`PATCH /distributions/{distributionKey}`

## Request

- Base URL: `https://eu-west-1.api.silverflow.com/v1`
- URL: `https://eu-west-1.api.silverflow.com/v1/distributions/{distributionKey}`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/silverflow/apis/silverflow-api/docs/distributions/:distributionKey/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates a distribution object reference and targets.

Requires the `distributions:Update` permission.

## Path parameters

- `distributionKey` string, required: Uniquely identifies a distribution object

## Request body

- UpdateDistributionRequest
  - `reference` string: A reference to the distribution
  - `targets` union
    - EmailDistributionTargets: The targets of the email distribution.
      - `recipients` EmailRecipients[], required: List of recipients
        - `to` EmailRecipient[], required: The recipients that receive the email.
        - `cc` EmailRecipient[]: The CC recipients that receive the email.
        - `bcc` EmailRecipient[]: The BCC recipients that receive the email.
    - SftpDistributionTargets: The targets of the SFTP distribution.
      - `host` string, required: A valid hostname or IP
      - `port` integer: The SFTP Host port.
      - `username` string, required: The SFTP username.
      - `dirPath` string, required: The directory path in the SFTP server where the files will be uploaded.
    - S3DistributionTargets
      - `bucketName` string, required: Name of the AWS S3 bucket where the files will be delivered.
      - `accountId` string, required: AWS account ID that owns the S3 bucket. For security reasons, the file is delivered only if the bucket is still owned by this account.
      - `directory` string, required: Optional prefix (subdirectory) inside the bucket where the files will be delivered (e.g., `reports/daily/`).
      - `roleArn` string, required: IAM role ARN that the Silverflow service will assume to access the bucket.
      - `externalId` string, required: External ID used when assuming the IAM role. Share it only with Silverflow; the role trust policy should require this value.

## Response `200`

The updated distribution object

- union
  - EmailDistribution: A distribution
    - `key` string, required: Uniquely identifies a distribution object
    - `status` 'active' | 'archived', required: The status of the object
    - `agentKey` string, required: Uniquely identifies an Agent
    - `created` string, date-time, required: The date and time this object was created
    - `lastModified` string, date-time: The date and time this object was last modified
    - `version` integer, required: The version of this object
    - `reference` string: A reference to the distribution
    - `type` 'email', required: Email distribution type.
    - `targets` EmailDistributionTargets, required: The targets of the email distribution.
      - `recipients` EmailRecipients[], required: List of recipients
        - `to` EmailRecipient[], required: The recipients that receive the email.
        - `cc` EmailRecipient[]: The CC recipients that receive the email.
        - `bcc` EmailRecipient[]: The BCC recipients that receive the email.
  - SftpDistribution: A distribution
    - `key` string, required: Uniquely identifies a distribution object
    - `status` 'active' | 'archived', required: The status of the object
    - `agentKey` string, required: Uniquely identifies an Agent
    - `created` string, date-time, required: The date and time this object was created
    - `lastModified` string, date-time: The date and time this object was last modified
    - `version` integer, required: The version of this object
    - `reference` string: A reference to the distribution
    - `type` 'sftp', required: SFTP distribution type.
    - `targets` SftpDistributionTargets, required: The targets of the SFTP distribution.
      - `host` string, required: A valid hostname or IP
      - `port` integer: The SFTP Host port.
      - `username` string, required: The SFTP username.
      - `dirPath` string, required: The directory path in the SFTP server where the files will be uploaded.
  - S3Distribution: A distribution
    - `key` string, required: Uniquely identifies a distribution object
    - `status` 'active' | 'archived', required: The status of the object
    - `agentKey` string, required: Uniquely identifies an Agent
    - `created` string, date-time, required: The date and time this object was created
    - `lastModified` string, date-time: The date and time this object was last modified
    - `version` integer, required: The version of this object
    - `reference` string: A reference to the distribution
    - `type` 's3', required: S3 distribution type.
    - `targets` S3DistributionTargets, required
      - `bucketName` string, required: Name of the AWS S3 bucket where the files will be delivered.
      - `accountId` string, required: AWS account ID that owns the S3 bucket. For security reasons, the file is delivered only if the bucket is still owned by this account.
      - `directory` string, required: Optional prefix (subdirectory) inside the bucket where the files will be delivered (e.g., `reports/daily/`).
      - `roleArn` string, required: IAM role ARN that the Silverflow service will assume to access the bucket.
      - `externalId` string, required: External ID used when assuming the IAM role. Share it only with Silverflow; the role trust policy should require this value.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Distribution not found
- `429`: Too Many Requests

---

[API](https://skmtc.dev/silverflow/apis/silverflow-api.md) - [All operations](https://skmtc.dev/silverflow/apis/silverflow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/silverflow/apis/silverflow-api/revisions/43ecbe4fd6ea?raw)
