> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reap.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Clip

> Immediately publish a completed clip to social media platforms

> **For AI agents:** a documentation index is at [/llms.txt](/llms.txt). Every page is also available as markdown, just append `.md` to the URL.

## Overview

Publish a completed clip directly to one or more social media platforms. The clip must have a `completed` status before it can be published. Use [Get Integrations](/api-reference/get-integrations) to retrieve your available integration IDs.

## Rate Limiting

This endpoint is rate limited to 10 requests per minute per API key.

<Note>
  Only completed clips can be published. Get integration IDs from the [Get Integrations](/api-reference/get-integrations) endpoint. The `platformSettings` object lets you configure per-platform settings. Only include platforms you're publishing to.
</Note>

<Note>
  Clips belonging to a cancelled project can't be published. The API returns `400` — *"This project was cancelled and can no longer be modified or published."*
</Note>

## Response

<ResponseField name="id" type="string">
  Unique post identifier
</ResponseField>

<ResponseField name="projectId" type="string">
  ID of the parent project
</ResponseField>

<ResponseField name="clipId" type="string">
  ID of the published clip
</ResponseField>

<ResponseField name="platforms" type="array">
  Array of target platform names
</ResponseField>

<ResponseField name="successPlatforms" type="array">
  Platforms where publishing succeeded
</ResponseField>

<ResponseField name="failedPlatforms" type="array">
  Platforms where publishing failed
</ResponseField>

<ResponseField name="integrations" type="array">
  Array of integration IDs used for publishing
</ResponseField>

<ResponseField name="title" type="string">
  Post title
</ResponseField>

<ResponseField name="description" type="string">
  Post description
</ResponseField>

<ResponseField name="tags" type="array">
  Array of tags applied to the post
</ResponseField>

<ResponseField name="status" type="string">
  Current post status

  * `processing` - Post is being published
  * `completed` - Published successfully to all platforms
  * `failed` - Publishing failed on all platforms
  * `unresolved` - Partial success (some platforms failed)
</ResponseField>

<ResponseField name="scheduleType" type="string">
  Type of scheduling (`immediate` or `scheduled`)
</ResponseField>

<ResponseField name="scheduleDate" type="integer">
  Scheduled publish date as Unix timestamp (null for immediate)
</ResponseField>

<ResponseField name="publishDate" type="integer">
  Actual publish date as Unix timestamp
</ResponseField>

<ResponseField name="urls" type="object">
  Published URLs per platform (populated after successful publishing)
</ResponseField>

<ResponseField name="platformSettings" type="object">
  Per-platform configuration

  <Expandable title="Platform Settings">
    <ResponseField name="youtube" type="object">
      YouTube-specific settings

      <Expandable title="YouTube Settings">
        <ResponseField name="privacy" type="string">
          Video privacy: `public`, `private`, or `unlisted`
        </ResponseField>

        <ResponseField name="embeddable" type="boolean">
          Whether the video can be embedded on other sites
        </ResponseField>

        <ResponseField name="publicStats" type="boolean">
          Whether view counts are publicly visible
        </ResponseField>

        <ResponseField name="madeForKids" type="boolean">
          Whether the video is made for kids (COPPA compliance)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="tiktok" type="object">
      TikTok-specific settings

      <Expandable title="TikTok Settings">
        <ResponseField name="privacy" type="string">
          Video privacy: `public`, `friends`, or `private`
        </ResponseField>

        <ResponseField name="disableComments" type="boolean">
          Disable comments on the video
        </ResponseField>

        <ResponseField name="disableDuet" type="boolean">
          Disable duets for the video
        </ResponseField>

        <ResponseField name="disableStitch" type="boolean">
          Disable stitches for the video
        </ResponseField>

        <ResponseField name="brandContent" type="boolean">
          Mark as paid partnership / brand content
        </ResponseField>

        <ResponseField name="brandOrganic" type="boolean">
          Mark as organic brand content
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="instagram" type="object">
      Instagram-specific settings

      <Expandable title="Instagram Settings">
        <ResponseField name="shareToFeed" type="boolean">
          Whether to share Reels to the main feed
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="linkedin" type="object">
      LinkedIn-specific settings

      <Expandable title="LinkedIn Settings">
        <ResponseField name="privacy" type="string">
          Post visibility: `public` or `connections`
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="createdAt" type="integer">
  Unix timestamp when the post was created
</ResponseField>

<ResponseField name="updatedAt" type="integer">
  Unix timestamp when the post was last updated
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -X POST "https://public.reap.video/api/v1/automation/publish-clip" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "projectId": "65f1a2b3c4d5e6f7a8b9c0d2",
      "clipId": "65f1a2b3c4d5e6f7a8b9c0d4",
      "integrations": ["66a1b2c3d4e5f6a7b8c9d0e1"],
      "title": "The Future of AI",
      "description": "Exploring how AI will transform our daily lives",
      "tags": ["ai", "technology", "future"],
      "platformSettings": {
        "youtube": {
          "privacy": "private",
          "embeddable": true,
          "publicStats": true,
          "madeForKids": false
        }
      }
    }'
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch('https://public.reap.video/api/v1/automation/publish-clip', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      projectId: '65f1a2b3c4d5e6f7a8b9c0d2',
      clipId: '65f1a2b3c4d5e6f7a8b9c0d4',
      integrations: ['66a1b2c3d4e5f6a7b8c9d0e1'],
      title: 'The Future of AI',
      description: 'Exploring how AI will transform our daily lives',
      tags: ['ai', 'technology', 'future'],
      platformSettings: {
        youtube: {
          privacy: 'private',
          embeddable: true,
          publicStats: true,
          madeForKids: false
        }
      }
    })
  });

  const post = await response.json();
  console.log('Post created:', post.id, 'Status:', post.status);
  ```

  ```python Python theme={"system"}
  import requests

  headers = {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
  }

  data = {
      'projectId': '65f1a2b3c4d5e6f7a8b9c0d2',
      'clipId': '65f1a2b3c4d5e6f7a8b9c0d4',
      'integrations': ['66a1b2c3d4e5f6a7b8c9d0e1'],
      'title': 'The Future of AI',
      'description': 'Exploring how AI will transform our daily lives',
      'tags': ['ai', 'technology', 'future'],
      'platformSettings': {
          'youtube': {
              'privacy': 'private',
              'embeddable': True,
              'publicStats': True,
              'madeForKids': False
          }
      }
  }

  response = requests.post(
      'https://public.reap.video/api/v1/automation/publish-clip',
      headers=headers,
      json=data
  )

  post = response.json()
  print(f"Post created: {post['id']} Status: {post['status']}")
  ```

  ```php PHP theme={"system"}
  <?php
  $data = [
      'projectId' => '65f1a2b3c4d5e6f7a8b9c0d2',
      'clipId' => '65f1a2b3c4d5e6f7a8b9c0d4',
      'integrations' => ['66a1b2c3d4e5f6a7b8c9d0e1'],
      'title' => 'The Future of AI',
      'description' => 'Exploring how AI will transform our daily lives',
      'tags' => ['ai', 'technology', 'future'],
      'platformSettings' => [
          'youtube' => [
              'privacy' => 'private',
              'embeddable' => true,
              'publicStats' => true,
              'madeForKids' => false
          ]
      ]
  ];

  $ch = curl_init('https://public.reap.video/api/v1/automation/publish-clip');
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer YOUR_API_KEY',
      'Content-Type: application/json'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  curl_close($ch);
  $post = json_decode($response, true);
  echo 'Post created: ' . $post['id'] . ' Status: ' . $post['status'] . "\n";
  ?>
  ```

  ```go Go theme={"system"}
  package main
  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )
  func main() {
      data := map[string]interface{}{
          "projectId":    "65f1a2b3c4d5e6f7a8b9c0d2",
          "clipId":       "65f1a2b3c4d5e6f7a8b9c0d4",
          "integrations": []string{"66a1b2c3d4e5f6a7b8c9d0e1"},
          "title":        "The Future of AI",
          "description":  "Exploring how AI will transform our daily lives",
          "tags":         []string{"ai", "technology", "future"},
          "platformSettings": map[string]interface{}{
              "youtube": map[string]interface{}{
                  "privacy":     "private",
                  "embeddable":  true,
                  "publicStats": true,
                  "madeForKids": false,
              },
          },
      }
      jsonData, _ := json.Marshal(data)
      req, _ := http.NewRequest("POST", "https://public.reap.video/api/v1/automation/publish-clip", bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={"system"}
  import java.io.*;
  import java.net.HttpURLConnection;
  import java.net.URL;
  public class PublishClipExample {
      public static void main(String[] args) throws Exception {
          URL url = new URL("https://public.reap.video/api/v1/automation/publish-clip");
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          conn.setRequestMethod("POST");
          conn.setRequestProperty("Authorization", "Bearer YOUR_API_KEY");
          conn.setRequestProperty("Content-Type", "application/json");
          conn.setDoOutput(true);
          String jsonBody = """
              {
                "projectId": "65f1a2b3c4d5e6f7a8b9c0d2",
                "clipId": "65f1a2b3c4d5e6f7a8b9c0d4",
                "integrations": ["66a1b2c3d4e5f6a7b8c9d0e1"],
                "title": "The Future of AI",
                "description": "Exploring how AI will transform our daily lives",
                "tags": ["ai", "technology", "future"],
                "platformSettings": {
                  "youtube": {
                    "privacy": "private",
                    "embeddable": true,
                    "publicStats": true,
                    "madeForKids": false
                  }
                }
              }""";
          try (OutputStream os = conn.getOutputStream()) {
              os.write(jsonBody.getBytes("utf-8"));
          }
          BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
          StringBuilder response = new StringBuilder();
          String responseLine;
          while ((responseLine = br.readLine()) != null) {
              response.append(responseLine.trim());
          }
          System.out.println(response.toString());
      }
  }
  ```
</CodeGroup>

## Example Response

<CodeGroup>
  <CodeGroup.Tab label="200 OK">
    ```json theme={"system"}
    {
      "id": "67b1c2d3e4f5a6b7c8d9e0f1",
      "projectId": "65f1a2b3c4d5e6f7a8b9c0d2",
      "clipId": "65f1a2b3c4d5e6f7a8b9c0d4",
      "platforms": ["youtube"],
      "successPlatforms": [],
      "failedPlatforms": [],
      "integrations": ["66a1b2c3d4e5f6a7b8c9d0e1"],
      "title": "The Future of AI",
      "description": "Exploring how AI will transform our daily lives",
      "tags": ["ai", "technology", "future"],
      "status": "processing",
      "scheduleType": "immediate",
      "scheduleDate": null,
      "publishDate": null,
      "urls": {},
      "platformSettings": {
        "youtube": {
          "privacy": "private",
          "embeddable": true,
          "publicStats": true,
          "madeForKids": false
        }
      },
      "createdAt": 1710000000,
      "updatedAt": 1710000000
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="400 Bad Request">
    ```json theme={"system"}
    {
      "detail": "Clip is not completed. Only completed clips can be published."
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="400 Invalid Integration">
    ```json theme={"system"}
    {
      "detail": "Invalid integration ID: 66a1b2c3d4e5f6a7b8c9d0e1"
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="400 Invalid Title">
    ```json theme={"system"}
    {
      "detail": "Title exceeds maximum length of 100 characters"
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="404 Not Found">
    ```json theme={"system"}
    {
      "detail": "Clip not found"
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="401 Unauthorized">
    ```json theme={"system"}
    {
      "detail": "Unauthorized - Invalid or missing API key"
    }
    ```
  </CodeGroup.Tab>

  <CodeGroup.Tab label="429 Too Many Requests">
    ```json theme={"system"}
    {
      "detail": "Too Many Requests - Rate limit of 10 requests per minute exceeded"
    }
    ```
  </CodeGroup.Tab>
</CodeGroup>


## OpenAPI

````yaml POST /automation/publish-clip
openapi: 3.1.0
info:
  title: Reap Automation API
  description: AI-powered video processing automation API
  version: 1.0.0
servers:
  - url: https://public.reap.video/api/v1
security:
  - bearerAuth: []
paths:
  /automation/publish-clip:
    post:
      summary: Publish Clip
      description: Immediately publish a completed clip to social media
      operationId: publishClip
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishClipRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationPost'
components:
  schemas:
    PublishClipRequest:
      type: object
      required:
        - projectId
        - clipId
        - integrations
      properties:
        projectId:
          type: string
          description: ID of the project containing the clip
        clipId:
          type: string
          description: ID of the clip to publish
        integrations:
          type: array
          items:
            type: string
          description: List of integration IDs to publish to
        title:
          type: string
          nullable: true
          description: Post title (defaults to clip title)
        description:
          type: string
          nullable: true
          description: Post description
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Post tags (max 10)
        platformSettings:
          $ref: '#/components/schemas/PlatformSettings'
          nullable: true
          description: Per-platform publishing settings
    AutomationPost:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
          nullable: true
        clipId:
          type: string
          nullable: true
        platforms:
          type: array
          items:
            type: string
        successPlatforms:
          type: array
          items:
            type: string
        failedPlatforms:
          type: array
          items:
            type: string
        integrations:
          type: array
          items:
            type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        status:
          type: string
          enum:
            - processing
            - draft
            - completed
            - failed
            - cancelled
            - unresolved
        scheduleType:
          type: string
          enum:
            - scheduled
            - immediate
        scheduleDate:
          type: integer
        publishDate:
          type: integer
        urls:
          type: object
          description: Social media URLs keyed by integration ID
        platformSettings:
          $ref: '#/components/schemas/PlatformSettings'
        createdAt:
          type: integer
        updatedAt:
          type: integer
    PlatformSettings:
      type: object
      properties:
        youtube:
          $ref: '#/components/schemas/YouTubeSettings'
          nullable: true
        tiktok:
          $ref: '#/components/schemas/TikTokSettings'
          nullable: true
        instagram:
          $ref: '#/components/schemas/InstagramSettings'
          nullable: true
        linkedin:
          $ref: '#/components/schemas/LinkedInSettings'
          nullable: true
    YouTubeSettings:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - unlisted
            - private
          default: public
          description: YouTube video privacy
        embeddable:
          type: boolean
          default: true
          description: Allow embedding
        publicStats:
          type: boolean
          default: true
          description: Show public statistics
        madeForKids:
          type: boolean
          default: false
          description: Mark as made for kids
    TikTokSettings:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - unlisted
            - followers
            - friends
            - private
          default: public
          description: TikTok video privacy
        disableComments:
          type: boolean
          default: false
        disableDuet:
          type: boolean
          default: false
        disableStitch:
          type: boolean
          default: false
        brandContent:
          type: boolean
          default: false
        brandOrganic:
          type: boolean
          default: false
    InstagramSettings:
      type: object
      properties:
        shareToFeed:
          type: boolean
          default: false
          description: Share reel to Instagram feed
    LinkedInSettings:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - connections
            - logged_in
          default: public
          description: LinkedIn post visibility
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````