Skip to main content
POST
/
v1
/
schedule
/
create
curl -X POST "https://api.hooked.ai/v1/schedule/create" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "videoId": "vid_abc123xyz",
    "integrationId": "int_yt_def456",
    "scheduledDateTime": "2024-03-15T14:00:00.000Z",
    "platformData": {
      "title": "10 Tips for Productivity",
      "description": "Learn how to boost your productivity...",
      "tags": ["productivity", "tips"],
      "privacyStatus": "public"
    }
  }'
{
  "success": true,
  "message": "Video scheduled successfully",
  "data": {
    "scheduleId": "post_abc123xyz",
    "status": "pending",
    "scheduledDateTime": "2024-03-15T14:00:00.000Z",
    "platform": "youtube",
    "videoId": "vid_abc123xyz"
  }
}
Try it out! Use the API playground on the right to test the Schedule Video endpoint directly.

Overview

Schedule a completed video for automatic publishing to a connected social platform. The video will be published at the specified time without any manual intervention. This is perfect for:
  • Building a content calendar
  • Automating your publishing workflow
  • Scheduling content for optimal posting times
  • Bulk scheduling videos across platforms
Videos must be in completed status before they can be scheduled. Connect your social platforms in the Hooked Dashboard first.

Endpoint

POST /v1/schedule/create

Required Fields

videoId
string
required
ID of the completed video to schedule. Get this from the video creation response or the /v1/video/list endpoint.
integrationId
string
required
ID of the connected social platform. Get available integrations from /v1/integration/list.
scheduledDateTime
string
required
ISO 8601 datetime for when to publish the video. Must be in the future.Example: 2024-03-15T14:00:00.000Z

Optional Fields

platformData
object
Platform-specific metadata for the post

Request Examples

Basic Schedule

const response = await fetch('https://api.hooked.ai/v1/schedule/create', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    videoId: 'vid_abc123xyz',
    integrationId: 'int_yt_def456',
    scheduledDateTime: '2024-03-15T14:00:00.000Z'
  })
});

const data = await response.json();
console.log('Scheduled:', data.data.scheduleId);

With Platform Data (YouTube)

const response = await fetch('https://api.hooked.ai/v1/schedule/create', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    videoId: 'vid_abc123xyz',
    integrationId: 'int_yt_def456',
    scheduledDateTime: '2024-03-15T14:00:00.000Z',
    platformData: {
      title: '10 Tips for Better Productivity',
      description: 'In this video, I share my top 10 productivity tips that have helped me work smarter, not harder.\n\nTimestamps:\n0:00 Intro\n0:30 Tip 1...',
      tags: ['productivity', 'tips', 'workflow', 'efficiency'],
      privacyStatus: 'public',
      madeForKids: false
    }
  })
});

With Platform Data (TikTok/Instagram)

const response = await fetch('https://api.hooked.ai/v1/schedule/create', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    videoId: 'vid_abc123xyz',
    integrationId: 'int_tt_ghi789',
    scheduledDateTime: '2024-03-15T18:00:00.000Z',
    platformData: {
      description: 'This productivity hack changed everything!',
      tags: ['productivity', 'lifehack', 'tips', 'viral']
    }
  })
});

Complete Workflow Example

async function createAndScheduleVideo() {
  // Step 1: Create a video
  const videoResponse = await fetch('https://api.hooked.ai/v1/project/create/script-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      script: 'Your video script here...',
      voiceId: 'voice_confident',
      mediaType: 'ai-images'
    })
  });

  const { data: videoData } = await videoResponse.json();
  const videoId = videoData.videoId;

  // Step 2: Wait for video to complete (use webhooks in production!)
  // ...

  // Step 3: Get available integrations
  const integrationsResponse = await fetch('https://api.hooked.ai/v1/integration/list', {
    headers: { 'x-api-key': process.env.HOOKED_API_KEY }
  });

  const { data: intData } = await integrationsResponse.json();
  const youtubeIntegration = intData.integrations.find(i => i.type === 'youtube');

  // Step 4: Schedule for tomorrow at 2 PM UTC
  const tomorrow = new Date();
  tomorrow.setDate(tomorrow.getDate() + 1);
  tomorrow.setHours(14, 0, 0, 0);

  const scheduleResponse = await fetch('https://api.hooked.ai/v1/schedule/create', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      videoId: videoId,
      integrationId: youtubeIntegration.id,
      scheduledDateTime: tomorrow.toISOString(),
      platformData: {
        title: 'My Awesome Video',
        description: 'Check out this video!',
        privacyStatus: 'public'
      }
    })
  });

  return await scheduleResponse.json();
}
curl -X POST "https://api.hooked.ai/v1/schedule/create" \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "videoId": "vid_abc123xyz",
    "integrationId": "int_yt_def456",
    "scheduledDateTime": "2024-03-15T14:00:00.000Z",
    "platformData": {
      "title": "10 Tips for Productivity",
      "description": "Learn how to boost your productivity...",
      "tags": ["productivity", "tips"],
      "privacyStatus": "public"
    }
  }'

Response

{
  "success": true,
  "message": "Video scheduled successfully",
  "data": {
    "scheduleId": "post_abc123xyz",
    "status": "pending",
    "scheduledDateTime": "2024-03-15T14:00:00.000Z",
    "platform": "youtube",
    "videoId": "vid_abc123xyz"
  }
}

Platform-Specific Notes

YouTube

FieldRequirementNotes
titleRecommendedMax 100 characters. Falls back to video name if not provided.
descriptionRecommendedMax 5000 characters. Supports line breaks and links.
tagsOptionalMax 30 tags. Used for search discovery.
privacyStatusOptionalDefaults to public.
madeForKidsOptionalRequired for COPPA compliance. Defaults to false.

TikTok

FieldRequirementNotes
descriptionRecommendedMax 2200 characters. Hashtags are auto-extracted.
tagsOptionalAppended as hashtags to description.

Instagram

FieldRequirementNotes
descriptionRecommendedCaption for the post. Max 2200 characters.
tagsOptionalAppended as hashtags to caption.

Best Practices

Schedule Ahead

Schedule at least 15 minutes in the future to allow for processing.

Use Optimal Times

Research your audience’s active hours for better engagement.

Set Up Webhooks

Get notified when posts are published or if publishing fails.

Include Metadata

Add titles, descriptions, and tags for better discoverability.

Error Handling

ErrorDescriptionSolution
Video not foundInvalid video IDUse a valid video ID from /v1/video/list
Integration not foundInvalid integration IDUse a valid integration ID from /v1/integration/list
Video must be completedVideo still processingWait for video to complete before scheduling
Scheduled time must be in the futureTime has already passedUse a future datetime
Video does not belong to your teamWrong teamEnsure you’re using the correct API key

Next Steps

Authorizations

x-api-key
string
header
required

Body

application/json
videoId
string
required

ID of the completed video to schedule

integrationId
string
required

ID of the connected social platform

scheduledDateTime
string<date-time>
required

ISO 8601 datetime for publishing

platformData
object

Response

201

Schedule created successfully