---
title: "Replace workspace repost rules"
method: PUT
path: "/repost-automation"
tags: ["Repost Automation"]
---

# Replace workspace repost rules

`PUT /repost-automation`

## Request

- Base URL: `https://app.openpo.st/api/v1`
- URL: `https://app.openpo.st/api/v1/repost-automation`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `openpost_session`

## Request body

- SaveRepostSettingsInputBody
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `expected_revision` string: Revision returned by the last read; stale updates fail with 409
  - `policies` PolicyInput[], nullable, required: Complete replacement set of workspace repost rules
    - `enabled` boolean, required
    - `id` string
    - `name` string, required
    - `rule` Rule, required
      - `delay_seconds` integer, required: Wait after publishing before the first eligibility check
      - `evaluation_window_seconds` integer, required: How long OpenPost may wait for engagement gates
      - `min_comments` integer, required: Minimum comments; zero disables this gate
      - `min_likes` integer, required: Minimum likes; zero disables this gate
      - `min_reposts` integer, required: Minimum reposts or shares; zero disables this gate
      - `min_views` integer, required: Minimum views; zero disables this gate
      - `plateau_checks` integer, required: Consecutive unchanged analytics checks required
      - `require_plateau` boolean, required: Wait until stored engagement has stopped changing
      - `stages` Stage[], nullable: Ordered repost times measured from the original publish time
        - `delay_seconds` integer, required: Wait from the original publish time before this repost
        - `unrepost_previous` boolean, required: Remove the preceding repost before creating this one
      - `threshold_mode` 'all' | 'any', required: Require all configured thresholds or any one
    - `source_account_ids` string[], nullable: Empty means every compatible source account in this workspace
    - `target_account_ids` string[], nullable, required
  - `workspace_id` string, required: Workspace ID

## Response `200`

OK

- SettingsResponse
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `accounts` AccountOption[], nullable, required
    - `avatar_url` string
    - `cross_workspace` boolean, required
    - `grant_active` boolean, required
    - `grant_required` boolean, required
    - `id` string, required
    - `instance_url` string
    - `platform` string, required
    - `supports_repost` boolean, required
    - `unavailable_reason` string
    - `username` string, required
    - `workspace_id` string, required
    - `workspace_name` string, required
  - `can_manage` boolean, required
  - `executions` RepostExecutionResponse[], nullable
    - `created_at` string, date-time, required
    - `current_stage` integer, required
    - `error` string
    - `history` StageHistoryEntry[], nullable, required
      - `delay_seconds` integer, required
      - `executed_at` string, date-time, required
      - `external_url` string
      - `repost_external_id` string
      - `stage` integer, required
      - `unrepost_previous` boolean, required
      - `unreposted_at` string, date-time
    - `id` string, required
    - `next_check_at` string, date-time
    - `policy_id` string
    - `policy_name` string
    - `publication_id` string, required
    - `rule` Rule, required
      - `delay_seconds` integer, required: Wait after publishing before the first eligibility check
      - `evaluation_window_seconds` integer, required: How long OpenPost may wait for engagement gates
      - `min_comments` integer, required: Minimum comments; zero disables this gate
      - `min_likes` integer, required: Minimum likes; zero disables this gate
      - `min_reposts` integer, required: Minimum reposts or shares; zero disables this gate
      - `min_views` integer, required: Minimum views; zero disables this gate
      - `plateau_checks` integer, required: Consecutive unchanged analytics checks required
      - `require_plateau` boolean, required: Wait until stored engagement has stopped changing
      - `stages` Stage[], nullable: Ordered repost times measured from the original publish time
        - `delay_seconds` integer, required: Wait from the original publish time before this repost
        - `unrepost_previous` boolean, required: Remove the preceding repost before creating this one
      - `threshold_mode` 'all' | 'any', required: Require all configured thresholds or any one
    - `status` string, required
    - `target_account_id` string, required
    - `total_stages` integer, required
  - `grants` GrantResponse[], nullable, required
    - `created_at` string, required
    - `direction` 'outbound' | 'inbound', required
    - `id` string, required
    - `platform` string, required
    - `source_workspace_id` string, required
    - `source_workspace_name` string, required
    - `target_account_id` string, required
    - `target_username` string, required
    - `target_workspace_id` string, required
    - `target_workspace_name` string, required
  - `policies` PolicyResponse[], nullable, required
    - `created_at` string
    - `enabled` boolean, required
    - `id` string
    - `name` string, required
    - `rule` Rule, required
      - `delay_seconds` integer, required: Wait after publishing before the first eligibility check
      - `evaluation_window_seconds` integer, required: How long OpenPost may wait for engagement gates
      - `min_comments` integer, required: Minimum comments; zero disables this gate
      - `min_likes` integer, required: Minimum likes; zero disables this gate
      - `min_reposts` integer, required: Minimum reposts or shares; zero disables this gate
      - `min_views` integer, required: Minimum views; zero disables this gate
      - `plateau_checks` integer, required: Consecutive unchanged analytics checks required
      - `require_plateau` boolean, required: Wait until stored engagement has stopped changing
      - `stages` Stage[], nullable: Ordered repost times measured from the original publish time
        - `delay_seconds` integer, required: Wait from the original publish time before this repost
        - `unrepost_previous` boolean, required: Remove the preceding repost before creating this one
      - `threshold_mode` 'all' | 'any', required: Require all configured thresholds or any one
    - `source_account_ids` string[], nullable: Empty means every compatible source account in this workspace
    - `target_account_ids` string[], nullable, required
    - `updated_at` string
  - `revision` string
  - `supported_platforms` string[], nullable, required
  - `workspace_id` string, required

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `409`: Conflict
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/openpo/apis/openpost-api.md) · [All operations](https://skmtc.dev/openpo/apis/openpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openpo/apis/openpost-api/revisions/67d3964458a7?raw)
