---
title: "Update the replication policy"
method: PUT
path: "/replication/policies/{id}"
tags: ["replication"]
---

# Update the replication policy

`PUT /replication/policies/{id}`

Update the replication policy

## Path parameters

- `id` integer, required

## Headers

- `X-Request-Id` string

## Request body

- ReplicationPolicy
  - `id` integer — The policy ID.
  - `name` string — The policy name.
  - `description` string — The description of the policy.
  - `src_registry` Registry
    - `id` integer — The registry ID.
    - `url` string — The registry URL string.
    - `name` string — The registry name.
    - `credential` RegistryCredential
      - `type` string — Credential type, such as 'basic', 'oauth'.
      - `access_key` string — Access key, e.g. user name when credential type is 'basic'.
      - `access_secret` string — Access secret, e.g. password when credential type is 'basic'.
    - `type` string — Type of the registry, e.g. 'harbor'.
    - `insecure` boolean — Whether or not the certificate will be verified when Harbor tries to access the server.
    - `ca_certificate` string, nullable — The PEM-encoded CA certificate for this registry endpoint. If provided, this CA will be used to verify the registry's certificate instead of the system CA pool.
    - `description` string — Description of the registry.
    - `status` string — Health status of the registry.
    - `creation_time` string, date-time — The create time of the policy.
    - `update_time` string, date-time — The update time of the policy.
  - `dest_registry` Registry
    - `id` integer — The registry ID.
    - `url` string — The registry URL string.
    - `name` string — The registry name.
    - `credential` RegistryCredential
      - `type` string — Credential type, such as 'basic', 'oauth'.
      - `access_key` string — Access key, e.g. user name when credential type is 'basic'.
      - `access_secret` string — Access secret, e.g. password when credential type is 'basic'.
    - `type` string — Type of the registry, e.g. 'harbor'.
    - `insecure` boolean — Whether or not the certificate will be verified when Harbor tries to access the server.
    - `ca_certificate` string, nullable — The PEM-encoded CA certificate for this registry endpoint. If provided, this CA will be used to verify the registry's certificate instead of the system CA pool.
    - `description` string — Description of the registry.
    - `status` string — Health status of the registry.
    - `creation_time` string, date-time — The create time of the policy.
    - `update_time` string, date-time — The update time of the policy.
  - `dest_namespace` string — The destination namespace.
  - `dest_namespace_replace_count` integer — Specify how many path components will be replaced by the provided destination namespace. The default value is -1 in which case the legacy mode will be applied.
  - `trigger` ReplicationTrigger
    - `type` string — The replication policy trigger type. The valid values are manual, event_based and scheduled.
    - `trigger_settings` ReplicationTriggerSettings
      - `cron` string — The cron string for scheduled trigger
  - `filters` ReplicationFilter[] — The replication policy filter array.
    - `type` string — The replication policy filter type.
    - `value` unknown
    - `decoration` string — matches or excludes the result
  - `replicate_deletion` boolean — Whether to replicate the deletion operation.
  - `deletion` boolean — Deprecated, use "replicate_deletion" instead. Whether to replicate the deletion operation.
  - `override` boolean — Whether to override the resources on the destination registry.
  - `enabled` boolean — Whether the policy is enabled or not.
  - `creation_time` string, date-time — The create time of the policy.
  - `update_time` string, date-time — The update time of the policy.
  - `speed` integer — speed limit for each task
  - `copy_by_chunk` boolean — Whether to enable copy by chunk.
  - `single_active_replication` boolean — Whether to skip execution until the previous active execution finishes, avoiding the execution of the same replication rules multiple times in parallel.

## Response `200`

Success

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `500` — Internal server error

---

[API](https://skmtc.dev/goharbor/apis/harbor-api.md) · [All operations](https://skmtc.dev/goharbor/apis/harbor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goharbor/harbor-api/revisions/62d78801f8df/schema)
