---
title: "Edit Creative Data Endpoint"
method: POST
path: "/api/v1/share/edit_creative_data"
tags: ["posts"]
---

# Edit Creative Data Endpoint

`POST /api/v1/share/edit_creative_data`

Updates creative data for a specified post ID.

This endpoint updates the creative data associated with a specific post ID
using the provided data in the CreativeData model. It requires the user
to be authenticated via a JWT token. The user's information is extracted
and can be utilized for authorization or logging.

Args:
    data (CreativeData): A Pydantic model containing the new creative data to update.
    post_id (str): The ID of the post whose creative data is being updated.
    user (Users): The authenticated user object, obtained through JWT authentication.
    db (Session): The database session, provided by the dependency injection system.

Returns:
    dict: A JSON response containing the updated creative data if the update is successful.

Raises:
    HTTPException:
        - Raises a 400 error if there is an issue with the update process.
        - Raises a 404 error if the creative data for the specified post ID cannot be found.

## Query parameters

- `post_id` string, required — The ID of the post to fetch creative data for.

## Request body

- CreativeData — Model for representing creative data related to social media posts. This model defines the structure of creative data that can be used for creating or updating creative content associated with a post. All fields are optional, allowing for flexibility in data handling. Attributes: page_id (Optional[str]): The ID of the social media page associated with the creative. rule_name (Optional[str]): The name of the rule governing the creative's behavior or scheduling. scheduled_time (Optional[datetime]): The date and time when the creative is scheduled to be published. content (Optional[str]): The main content or title of the creative. description (Optional[str]): A brief description of the creative. image_url (Optional[HttpUrl]): URL of the image associated with the creative. video_url (Optional[HttpUrl]): URL of the video associated with the creative. video_thumbnail_url (Optional[HttpUrl]): URL of the thumbnail image for the video. platform (Optional[str]): The social media platform for which the creative is intended. user_id (Optional[UUID]): The ID of the user who created the creative. type (Optional[str]): The type/category of the creative (e.g., image, video). post_id (Optional[str]): The ID of the post to which the creative is associated. status (Optional[str]): The current status of the creative (e.g., draft, published). media_type (Optional[str]): The type of media (e.g., image, video, audio) represented by the creative.
  - `page_id` string, nullable
  - `rule_name` string, nullable
  - `scheduled_time` string, date-time, nullable
  - `content` string, nullable
  - `description` string, nullable
  - `image_url` string, uri, nullable
  - `video_url` string, uri, nullable
  - `video_thumbnail_url` string, uri, nullable
  - `platform` string, nullable
  - `user_id` string, uuid, nullable
  - `type` string, nullable
  - `post_id` string, nullable
  - `status` string, nullable
  - `media_type` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/brandbooster/apis/fastapi.md) · [All operations](https://skmtc.dev/brandbooster/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/brandbooster/fastapi/revisions/ff7f2b621b41/schema)
