> ## 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.

# Update Post

> Updates an existing post based on the ID supplied



## OpenAPI

````yaml PUT /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:
    put:
      description: Updates an existing post based on the ID supplied
      parameters:
        - $ref: '#/components/parameters/X-API-KEY'
      requestBody:
        description: Updated post content and media
        content:
          multipart/form-data:
            schema:
              properties:
                content:
                  description: Content of the post
                  type: string
                parentId:
                  type: integer
                  nullable: true
                  description: ID of the parent post if applicable
              required:
                - content
                - parentId
        required: true
      responses:
        '200':
          description: Post updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        '400':
          description: Invalid input provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Post not found
          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:
    Post:
      type: object
      properties:
        id:
          type: integer
          description: ID of the post
        snowflakeId:
          type: string
          description: Snowflake ID of the post
        content:
          type: string
          nullable: true
          description: Content of the post
        user:
          type: object
          properties:
            id:
              type: integer
              description: User ID
            username:
              type: string
              description: Users' username
            bio:
              type: string
              description: User's bio
            name:
              type: string
              description: User's name
            image:
              type: string
              description: Link to user's avatar
            verifiedAt:
              type: string
              format: date-time
              description: Last timestamp of user verified by admin
          required:
            - id
            - username
          description: User who created 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
        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
        repliesCount:
          type: integer
          nullable: true
          description: Number of replies to the post
        replies:
          type: array
          items:
            $ref: '#/components/schemas/Post'
          description: List of replies to the post
          nullable: true
        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
        parent:
          $ref: '#/components/schemas/Post'
          nullable: true
          description: Parent post if applicable
        repostsCount:
          type: integer
          nullable: true
          description: Number of reposts of the post
        reposts:
          type: array
          items:
            type: integer
          description: List of userIds reposted
          nullable: true
        hashtags:
          type: array
          items:
            type: string
          description: >-
            List of hashtags associated with the post without the hashtag symbol
            (#), e.g. ['viral']
        isSuspended:
          type: boolean
          nullable: true
          description: A boolean if the post/reply is suspended or not
        links:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                description: URL of the OpenGraph link
              title:
                type: string
                nullable: true
                description: Title of the OpenGraph link
              description:
                type: string
                nullable: true
                description: Description of the OpenGraph link
              image:
                type: string
                nullable: true
                description: Image URL of the OpenGraph link
            required:
              - url
          description: List of OpenGraph details associated with the media
      required:
        - id
        - snowflakeId
        - user
        - createdAt
        - updatedAt
        - type
        - hashtags
    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

````