Cue
Getting Started

Quickstart

Make your first API call to Cue in 5 minutes.

This guide walks you through creating and publishing your first post via the Cue API.

Prerequisites

  • A Cue account with at least one connected social account
  • An API key (get one here)

Step 1: Get your profile and account IDs

First, list your profiles to get the profile ID you'll post from:

curl https://api.oncue.so/v1/profiles \
  -H "Authorization: Bearer cue_sk_your_key_here"
const response = await fetch("https://api.oncue.so/v1/profiles", {
  headers: {
    Authorization: "Bearer cue_sk_your_key_here",
  },
});
const { data } = await response.json();
console.log(data[0].id); // prf_abc123...

Response:

{
  "data": [
    {
      "id": "prf_abc123def456",
      "name": "My Brand",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}

Then list your connected social accounts:

curl https://api.oncue.so/v1/social-accounts \
  -H "Authorization: Bearer cue_sk_your_key_here"
const response = await fetch("https://api.oncue.so/v1/social-accounts", {
  headers: {
    Authorization: "Bearer cue_sk_your_key_here",
  },
});
const { data } = await response.json();
console.log(data[0].id); // sac_xyz789...

Response:

{
  "data": [
    {
      "id": "sac_xyz789abc123",
      "platform": "bluesky",
      "platformUsername": "mybrand.bsky.social"
    }
  ]
}

Step 2: Create and publish a post

Use the publishNow option to create and publish immediately:

curl -X POST https://api.oncue.so/v1/posts \
  -H "Authorization: Bearer cue_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "prf_abc123def456",
    "platforms": {
      "sac_xyz789abc123": {
        "items": [{ "content": "Hello from the Cue API!" }]
      }
    },
    "publishNow": true
  }'
const response = await fetch("https://api.oncue.so/v1/posts", {
  method: "POST",
  headers: {
    Authorization: "Bearer cue_sk_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "prf_abc123def456",
    platforms: {
      sac_xyz789abc123: {
        items: [{ content: "Hello from the Cue API!" }],
      },
    },
    publishNow: true,
  }),
});
const result = await response.json();

Response:

{
  "data": [
    {
      "id": "pst_r3v8n2xk5qmj",
      "profileId": "prf_abc123def456",
      "socialAccountId": "sac_xyz789abc123",
      "status": "publishing",
      "createdAt": "2024-01-15T10:35:00Z"
    }
  ],
  "message": "Post queued for publishing to 1 platform(s)"
}

Your post will be published within 30 seconds.

Step 3: Schedule a post for later

To schedule instead of publishing immediately, use scheduledAt:

curl -X POST https://api.oncue.so/v1/posts \
  -H "Authorization: Bearer cue_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "prf_abc123def456",
    "platforms": {
      "sac_xyz789abc123": {
        "items": [{ "content": "This will post tomorrow at 9am!" }]
      }
    },
    "scheduledAt": "2024-01-16T09:00:00-05:00"
  }'
const response = await fetch("https://api.oncue.so/v1/posts", {
  method: "POST",
  headers: {
    Authorization: "Bearer cue_sk_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "prf_abc123def456",
    platforms: {
      sac_xyz789abc123: {
        items: [{ content: "This will post tomorrow at 9am!" }],
      },
    },
    scheduledAt: "2024-01-16T09:00:00-05:00",
  }),
});

The post status will be scheduled until the scheduled time, then automatically published.

Step 4: Auto-schedule for optimal times

Let Cue pick the best posting time for each platform using autoSchedule:

curl -X POST https://api.oncue.so/v1/posts \
  -H "Authorization: Bearer cue_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "prf_abc123def456",
    "platforms": {
      "sac_xyz789abc123": {
        "items": [{ "content": "Auto-scheduled for peak engagement!" }]
      }
    },
    "autoSchedule": true
  }'
const response = await fetch("https://api.oncue.so/v1/posts", {
  method: "POST",
  headers: {
    Authorization: "Bearer cue_sk_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "prf_abc123def456",
    platforms: {
      sac_xyz789abc123: {
        items: [{ content: "Auto-scheduled for peak engagement!" }],
      },
    },
    autoSchedule: true,
  }),
});

Each platform gets its own optimal time based on engagement windows.

What's next?

On this page