Skip to content

Docs

follow_original

Make a channel post follow its content item's original draft again (`follow: true`, the default), or stop following (`follow: false`, it keeps its text). A following version takes each later edit of the original (update_original) while it is a draft or ready; editing its own segments with update_post customizes it. Linking copies the original into it now, as a new version: blocks split by a `---` line become thread posts where the format takes a thread, else paragraphs, with the original's media on the first post. Refused with `invalid_post` when the original would break the channel's rules (nothing changes; the message says why), and with `post_locked` unless the version is a draft or ready. Pass the `version` you read as `expectedVersion`.

Make a channel post follow its content item's original draft again (follow: true, the default), or stop following (follow: false, it keeps its text). A following version takes each later edit of the original (update_original) while it is a draft or ready; editing its own segments with update_post customizes it. Linking copies the original into it now, as a new version: blocks split by a --- line become thread posts where the format takes a thread, else paragraphs, with the original's media on the first post. Refused with invalid_post when the original would break the channel's rules (nothing changes; the message says why), and with post_locked unless the version is a draft or ready. Pass the version you read as expectedVersion.

Access and cost

  • Kind: mutation
  • Scope: workspace
  • Actors: member, agent
  • Credits: Free
  • Requires confirmation: false
  • Accepts idempotency key: false

Input schema

{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "postId": {
      "format": "uuid",
      "type": "string"
    },
    "follow": {
      "default": true,
      "type": "boolean"
    },
    "expectedVersion": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "workspaceId",
    "postId"
  ],
  "type": "object"
}

Output schema

{
  "additionalProperties": false,
  "properties": {
    "post": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "workspaceId": {
          "format": "uuid",
          "type": "string"
        },
        "pieceId": {
          "format": "uuid",
          "type": "string"
        },
        "channelAccountId": {
          "format": "uuid",
          "type": "string"
        },
        "format": {
          "pattern": "^[a-z][a-z0-9_]*$",
          "type": "string"
        },
        "segments": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "text": {
                "type": "string"
              },
              "media": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "mediaAssetId": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "altText": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  },
                  "required": [
                    "mediaAssetId"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "text",
              "media"
            ],
            "type": "object"
          },
          "minItems": 1,
          "type": "array"
        },
        "settings": {
          "type": "object"
        },
        "state": {
          "enum": [
            "draft",
            "ready",
            "awaiting_confirmation",
            "scheduled",
            "publishing",
            "published",
            "failed_retrying",
            "needs_attention",
            "failed",
            "manual",
            "removed"
          ],
          "type": "string"
        },
        "scheduledAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheduleSource": {
          "anyOf": [
            {
              "enum": [
                "manual",
                "queue",
                "recurrence",
                "evergreen"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "isSkipped": {
          "type": "boolean"
        },
        "version": {
          "minimum": 1,
          "type": "integer"
        },
        "followsOriginal": {
          "type": "boolean"
        },
        "followIssue": {
          "type": [
            "string",
            "null"
          ]
        },
        "requestedByAgentClientId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "confirmedByAccountId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "confirmedAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastError": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "fix": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "publishedAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "permalink": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdByAccountId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdByAgentClientId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "workspaceId",
        "pieceId",
        "channelAccountId",
        "format",
        "segments",
        "settings",
        "state",
        "scheduledAt",
        "scheduleSource",
        "isSkipped",
        "version",
        "followsOriginal",
        "followIssue",
        "requestedByAgentClientId",
        "confirmedByAccountId",
        "confirmedAt",
        "lastError",
        "publishedAt",
        "permalink",
        "createdByAccountId",
        "createdByAgentClientId",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "changed": {
      "type": "boolean"
    }
  },
  "required": [
    "post",
    "changed"
  ],
  "type": "object"
}

Errors

[
  "version_conflict",
  "post_locked",
  "invalid_post"
]

Annotations

{
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Link a channel version to the original"
}