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

# Video Posts

> Create video posts with uploaded video files using the current Social+ SDKs.

Video posts combine uploaded videos with an optional text caption. Upload the videos first, then pass the uploaded video objects or file IDs to the post creation API.

<Info>
  This page focuses on the SDK call that creates the post. See [Video Handling](/social-plus-sdk/core-concepts/content-handling/files-images-and-videos/video-handling) for upload steps, supported file inputs, processing behavior, and upload constraints.
</Info>

<CardGroup cols={2}>
  <Card title="Uploaded Videos" icon="video">
    Create posts from video objects or file IDs returned by the file upload flow.
  </Card>

  <Card title="Caption Support" icon="text">
    Add text, metadata, mentions, or other SDK-supported post fields alongside the videos.
  </Card>
</CardGroup>

## Parameters

| Parameter                               | Required | Description                                                   |
| --------------------------------------- | -------- | ------------------------------------------------------------- |
| `videos`, `uploadedVideos`, or `fileId` | Yes      | Uploaded video objects or video file IDs, depending on SDK.   |
| `text`                                  | No       | Caption text shown with the video post.                       |
| `targetType`                            | Yes      | Feed target, usually `community` or `user`.                   |
| `targetId`                              | Yes      | Community ID or user ID for the target feed.                  |
| `metadata`                              | No       | Custom metadata stored with the post where supported.         |
| `mentionees`                            | No       | User mention payload where supported by the platform builder. |

## Create a Video Post

The examples below create a video post in a community. Replace the target with the SDK's user-feed target when posting to a user.

<CodeGroup>
  ```swift iOS theme={null}
  func createVideoPost(
      uploadedVideos: [AmityVideoData],
      communityId: String
  ) async throws -> AmityPost {
      let postRepository = AmityPostRepository()
      let builder = AmityVideoPostBuilder()
      builder.setVideos(uploadedVideos)
      builder.setText("Video from today")

      return try await postRepository.createVideoPost(
          builder,
          targetId: communityId,
          targetType: .community,
          metadata: nil,
          mentionees: nil
      )
  }
  ```

  ```kotlin Android theme={null}
  fun createVideoPost(
      uploadedVideos: Set<AmityVideo>,
      communityId: String
  ) {
      postRepository.createVideoPost(
          targetType = AmityPost.TargetType.COMMUNITY,
          targetId = communityId,
          videos = uploadedVideos,
          text = "Video from today"
      )
          .subscribe({ post ->
              showSuccessMessage(post.getPostId())
          }, { error ->
              handleGeneralError(error)
          })
  }
  ```

  ```typescript TypeScript theme={null}
  import { PostRepository } from "@amityco/ts-sdk";

  const { data: post } = await PostRepository.createPost({
    targetType: "community",
    targetId: communityId,
    data: {
      text: "Video from today",
    },
    attachments: [
      {
        type: "video",
        fileId,
      },
    ],
  });
  ```

  ```dart Flutter theme={null}
  Future<AmityPost> createVideoPost(List<AmityVideo> uploadedVideos) {
    return AmitySocialClient.newPostRepository()
        .createPost()
        .targetCommunity(communityId)
        .video(uploadedVideos)
        .text('Video from today')
        .post();
  }
  ```
</CodeGroup>

## Notes

* TypeScript accepts video attachments as `{ type: "video", fileId }`.
* Android accepts a `Set<AmityVideo>`.
* iOS accepts `[AmityVideoData]`.
* Flutter accepts `List<AmityVideo>`.

For mixed attachment types, use [Mixed Media Posts](./mixed-media-post).

## Related Topics

<CardGroup cols={3}>
  <Card title="Video Handling" icon="upload" href="/social-plus-sdk/core-concepts/content-handling/files-images-and-videos/video-handling">
    Upload videos before creating video posts.
  </Card>

  <Card title="Clip Posts" icon="film" href="./clip-post">
    Create short-form clip posts where supported.
  </Card>

  <Card title="Mixed Media Posts" icon="layer-group" href="./mixed-media-post">
    Combine videos with other supported media attachments.
  </Card>
</CardGroup>
