--- layout: "http" page_title: "HTTP API: /sys/repliation/primary" sidebar_current: "docs-http-replication-primary" description: |- The '/sys/replication/primary' endpoint focuses on managing replication behavior for a primary cluster, including management of secondaries. --- # /sys/replication/primary/enable ## POST
Description
Enables replication in primary mode. This is used when replication is currently disabled on the cluster (if the cluster is already a secondary, it must be promoted). Caution: only one primary should be active at a given time. Multiple primaries may result in data loss!
Method
POST
URL
`/sys/repliation/primary/enable`
Parameters
Returns
`200` response code with a warning.
# /sys/replication/primary/demote ## POST
Description
Demotes a primary cluster to a secondary. This secondary cluster will not attempt to connect to a primary (see the update-primary call), but will maintain knowledge of its cluster ID and can be reconnected to the same replication set without wiping local storage.
Method
POST
URL
`/sys/repliation/primary/demote`
Parameters
None
Returns
`200` response code with a warning.
# /sys/replication/primary/disable ## POST
Description
Disable replication entirely on the cluster. Any secondaries will no longer be able to connect. Caution: re-enabling this node as a primary or secondary will change its cluster ID; in the secondary case this means a wipe of the underlying storage when connected to a primary, and in the primary case, secondaries connecting back to the cluster (even if they have connected before) will require a wipe of the underlying storage.
Method
POST
URL
`/sys/repliation/primary/disable`
Parameters
None
Returns
`200` response code with a warning..
# /sys/replication/primary/secondary-token ## GET
Description
Requires ‘sudo’ capability. Generate a secondary activation token for the cluster with the given opaque identifier, which must be unique. This identifier can later be used to revoke a secondary's access.
Method
GET
URL
`/sys/replication/primary/secondary-token`
Parameters
Returns
```javascript { "request_id": "", "lease_id": "", "lease_duration": 0, "renewable": false, "data": null, "warnings": null, "wrap_info": { "token": "fb79b9d3-d94e-9eb6-4919-c559311133d6", "ttl": 300, "creation_time": "2016-09-28T14:41:00.56961496-04:00", "wrapped_accessor": "" } } ```
# /sys/replication/primary/revoke-secondary ## POST
Description
Revoke a secondary’s ability to connect to the primary cluster; the secondary will immediately be disconnected and will not be allowed to connect again unless given a new activation token.
Method
URL
`/sys/replication/secondary/revoke-secondary`
Parameters
Returns
`200` response code with a warning.