Skip to main content

Create Content

The endpoint is used to generate all types of posts including Videos, Carousels, Images, Quotes and Memes.

Request URL

  • POST https://brain.predis.ai/predis_api/v1/create_content/

Request Payload

Note - Please use "Payload Type" as form-data when you calling this API.

NameDescriptionTypeDefault ValuePossible ValuesRequired
brand_idUnique Identifier of your Brand. You can learn more about locating your Brand ID by visiting the link provided here.StringNoneYOUR_BRAND_IDYes
textProvide the topic for which you intend to create the post. Make sure the topic is at least 20 characters long and consists of a minimum of 3 words to ensure accurate output.StringNoneAny StringYes
post_typeSpecify the type of post you wish to generate.
If you're creating a meme or quotes post, the media_type should be set to single_image.
Stringgenericgeneric, meme, quotesNo
input_languageChoose the language for your input text field.Stringenglishmalay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarianNo
output_languageChoose the language in which you want to generate the post.Stringenglishmalay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarianNo
media_typeProvide this information only when you want a specific media_type of post.
It is not required when template_ids are selected, but it is necessary otherwise.
Stringsingle_imagesingle_image, carousel, videoNo
video_durationSpecify the type of your video.
This field is not required when template_ids are selected. However, it is required when the media_type value is set to video.
Stringshortshort, longNo
template_idsProvide this information only when you want your output to be generated using specific templates.
You can provide a list of template IDs in the following format:
Sample 1: ["template_id1"]
Sample 2: ["template_id1", "template_id2", "template_id3"]
List of strings[][]No
authorProvide this information only when the type of post you want to generate is quotes.StringNoneAny StringNo
media_urlsProvide a list of URLs for images/videos that you want to use in your post.
Here are two sample formats:
Sample 1: ["url1"]
Sample 2: ["url1", "url2", "url3"]
List of strings[][]No
color_palette_typeChoose the color palette in which you would like your content to be generated.
If you have specified palette as brand but haven't set the brand colors, the content will be automatically generated using the ai_suggested palette.
Stringai_suggestedbrand, ai_suggestedNo
brand_detailsProvide brand details to make sure AI generates content in the given brand details only.DictionaryNone Please check Example hereNo
headlinesProvide this input when you wish to override the AI-generated content in the generated images/videos.ListNone Please check Example hereNo

Sample Success Response

{
"post_ids": [
"..."
],
"post_status": "inProgress",
"errors": [{"..."}]
}

Sample Error Response

{
"errors": [{
"detail": "...",
"solution": "..."
}]
}

Response Codes

HTTP Status CodeError CodeUser MessageRecommended solution
429001Maximum number of requests reachedMaximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again
400002Invalid brand_id providedYou have provided an invalid brand_id. Please provide a valid brand_id and try again. Read more here
400003You have reached your post generation limitYou have exhausted the credits available in your plan. Please upgrade to a higher plan or wait until the limit resets
400004You already have 3 posts inProgressPlease wait until the posts in progress gets completed and then try again
400005Your request method is invalidPlease make a POST request and then try again
400006Your provided text is too smallThe provided text should contain atleast 3 words and 20 characters for best results
400007The provided value for the media_type field is not validMake sure the value is one of single_image, carousel or video
400008The provided value for the input_language or output_language field is not validMake sure the passed value is supported. Please check the Request Parameters in the above table for more details
400009The provided value for the video_duration field is not validMake sure the value is either short or long
400010The provided value for the post_type field is not validMake sure the value is either generic, meme or quotes
400011The provided value for the post_type field is not valid for the given media_typeThe provided post_type and media_type combination of post is not supported yet. Please check the Request Parameters in the above table for more details

Rate Limiting

Standard API rate limits apply to this endpoint. Read more about the rate limits here