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

# Create Post

> Create a new post with media file uploads

<Warning>For `repost` / `quote` type, ensure `parentId` & `originalId` are passed</Warning>
<Note>For `repost` type, you can use empty string ("") or `null` for the `content`</Note>


## OpenAPI

````yaml POST /post
openapi: 3.0.1
info:
  title: Post API
  description: API for managing posts with media file uploads
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://our-secret-api-url.com
security: []
paths:
  /post:
    post:
      description: Create a new post with media file uploads
      parameters:
        - $ref: '#/components/parameters/X-API-KEY'
      requestBody:
        description: Post content and media to be uploaded
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NewPost'
        required: true
      responses:
        '200':
          description: Post created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedPost'
        '400':
          description: Invalid input provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    X-API-KEY:
      name: X-API-KEY
      description: API key required for authentication
      in: header
      required: true
      schema:
        type: string
  schemas:
    NewPost:
      type: object
      required:
        - content
        - hashtags
        - type
      properties:
        content:
          description: Content of the post
          type: string
        hashtags:
          type: array
          items:
            type: string
          description: >-
            List of hashtags associated with the post without the hashtag symbol
            (#), e.g. ['viral']
        type:
          type: string
          enum:
            - post
            - quote
            - repost
          description: Type of the post
        originalId:
          type: integer
          nullable: true
          description: ID of the original post if this is a reply, repost & quote repost
        parentId:
          type: integer
          nullable: true
          description: ID of the parent post if applicable
        parentUserId:
          description: >-
            The userId of the parent's post to send notifications to, if
            applicable
          type: integer
        media_1:
          description: First media file to be uploaded
          type: string
          format: binary
        media_2:
          description: Second media file to be uploaded
          type: string
          format: binary
        media_3:
          description: Third media file to be uploaded
          type: string
          format: binary
        media_4:
          description: Fourth media file to be uploaded
          type: string
          format: binary
    CreatedPost:
      type: object
      properties:
        id:
          type: integer
          description: ID of the post
        snowflakeId:
          type: string
          description: Snowflake ID of the post
        userId:
          type: integer
          description: ID of the user who created the post
        content:
          type: string
          nullable: true
          description: Content of the post
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp of the post
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp of the post
        type:
          type: string
          enum:
            - post
            - quote
            - repost
          description: Type of the post
        originalId:
          type: integer
          nullable: true
          description: ID of the original post if this is a reply, repost & quote repost
        parentId:
          type: integer
          nullable: true
          description: ID of the parent post if applicable
        hashtags:
          type: array
          items:
            type: string
          description: >-
            List of hashtags associated with the post without the hashtag symbol
            (#), e.g. ['viral']
        repliesCount:
          type: integer
          description: Number of replies to the post
        repostsCount:
          type: integer
          description: Number of reposts of the post
        reposts:
          type: array
          items:
            type: integer
          description: List of userIds reposted
        media:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: ID of the media
              mediaUrl:
                type: string
                description: URL of the media
              mimeType:
                type: string
                description: MIME type of the media
              updatedAt:
                type: string
                format: date-time
                description: Last update timestamp of the media
            required:
              - id
              - mediaUrl
              - mimeType
              - updatedAt
          description: List of media items associated with the post
          nullable: true
      required:
        - id
        - snowflakeId
        - userId
        - createdAt
        - updatedAt
        - type
        - hashtags
        - repliesCount
        - repostsCount
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          description: Error code
          type: integer
          format: int32
        message:
          description: Error message
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````