RelayAPI
Guides

Cross-Post Actions

Automatically repost, comment, or quote from other accounts after publishing.

Overview

Cross-post actions let you schedule automatic follow-up actions from other connected accounts after a post is published. For example, you can publish an announcement from your personal account and have your company account automatically repost it 3 hours later.

Actions are defined at post creation time via the cross_post_actions array and execute after the post is successfully published.

How It Works

  1. Create a post with one or more cross_post_actions attached
  2. The post publishes normally to its target accounts
  3. After publishing, each cross-post action fires at its configured delay
  4. Each action runs independently — if one fails, others still execute
# Create a post with cross-post actions
curl -X POST https://api.relayapi.dev/v1/posts \
  -H "Authorization: Bearer rlay_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Check out this announcement!",
    "targets": ["acc_personal"],
    "scheduled_at": "now",
    "cross_post_actions": [
      {
        "action_type": "repost",
        "target_account_id": "acc_company",
        "delay_minutes": 180
      },
      {
        "action_type": "comment",
        "target_account_id": "acc_company",
        "content": "Great post!",
        "delay_minutes": 60
      }
    ]
  }'

Action Types

ActionDescriptionRequires content
repostRepost/retweet/reshare the original post from the target accountNo
commentPost a reply/comment on the original post from the target accountYes
quoteQuote-post the original post with additional commentaryYes

The target_account_id must be a connected account on the same platform as the original post's target. For example, if the post goes to a Twitter account, the cross-post action's target must also be a Twitter account.

Delay

The delay_minutes field controls how long after the original post is published before the action executes.

ValueBehavior
0Execute immediately after publish
1 to 1440Delay in minutes (max 24 hours)

Staggering delays creates a natural amplification pattern — for example, a comment at 1 hour and a repost at 3 hours.

Status Tracking

Each cross-post action has its own status that you can monitor:

StatusDescription
pendingAction is waiting to execute (post not yet published or delay not yet elapsed)
executedAction completed successfully
failedAction failed (e.g., platform error, account disconnected)
cancelledAction was manually cancelled before execution

Cancellation

You can cancel a pending cross-post action before it executes:

curl -X DELETE https://api.relayapi.dev/v1/cross-post-actions/cpa_xyz789 \
  -H "Authorization: Bearer rlay_live_your_api_key"

Once an action has been executed or has already failed, it cannot be cancelled.

SDK Usage

import Relay from "@relayapi/sdk";

const client = new Relay({ apiKey: "rlay_live_..." });

// Create a post with cross-post actions
const post = await client.posts.create({
  content: "Check out this announcement!",
  targets: ["acc_personal"],
  scheduled_at: "now",
  cross_post_actions: [
    { action_type: "repost", target_account_id: "acc_company", delay_minutes: 180 },
    { action_type: "comment", target_account_id: "acc_company", content: "Great post!", delay_minutes: 60 },
  ],
});

// List cross-post actions for a post
const { data } = await client.posts.crossPostActions.list("post_abc123");

// Get a specific action
const action = await client.posts.crossPostActions.get("post_abc123", "cpa_xyz789");

// Cancel a pending action
await client.posts.crossPostActions.cancel("post_abc123", "cpa_xyz789");

API Endpoints

MethodEndpointDescription
GET/v1/posts/:post_id/cross-post-actionsList actions for a post
GET/v1/posts/:post_id/cross-post-actions/:idGet action details
DELETE/v1/cross-post-actions/:idCancel a pending action

Found something wrong? Help us improve this page.

On this page

Submit an Issue
Requires a GitHub account.View repo