Skip to content

Docs

publish_now

Publish one post right away. Pass the `version` you showed the person as `expectedVersion`; if the post changed since, nothing happens (`version_conflict`). Same checks as scheduling: `invalid_post`, `signoff_required` (required approval missing), `channel_unavailable`, `skipped` and `not_schedulable`. The post enters `scheduled` at the current time and the publisher picks it up; follow it with get_post_status. Calling it again while the post is already due changes nothing. People can use it; an agent only on Autopilot for the post's channel (`confirmation_required` otherwise, saying why: use request_schedule so a human confirms).

Publish one post right away. Pass the version you showed the person as expectedVersion; if the post changed since, nothing happens (version_conflict). Same checks as scheduling: invalid_post, signoff_required (required approval missing), channel_unavailable, skipped and not_schedulable. The post enters scheduled at the current time and the publisher picks it up; follow it with get_post_status. Calling it again while the post is already due changes nothing. People can use it; an agent only on Autopilot for the post's channel (confirmation_required otherwise, saying why: use request_schedule so a human confirms).

A human confirms the result in heyeveryone's Updates unless a workspace owner put this agent on Autopilot for the post's channel (see whoami).

Access and cost

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

Input schema

{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "postId": {
      "format": "uuid",
      "type": "string"
    },
    "expectedVersion": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "workspaceId",
    "postId",
    "expectedVersion"
  ],
  "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"
    },
    "queued": {
      "type": "boolean"
    }
  },
  "required": [
    "post",
    "queued"
  ],
  "type": "object"
}

Errors

[
  "not_schedulable",
  "time_in_past",
  "invalid_post",
  "signoff_required",
  "channel_unavailable",
  "skipped",
  "no_queue_slots",
  "queue_full",
  "plan_limit_reached",
  "publishing_paused",
  "near_duplicate",
  "version_conflict",
  "confirmation_required"
]

Annotations

{
  "destructiveHint": true,
  "idempotentHint": true,
  "openWorldHint": true,
  "readOnlyHint": false,
  "title": "Publish a post now"
}