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.
Name | Description | Type | Default Value | Possible Values | Required |
---|---|---|---|---|---|
brand_id | Unique Identifier of your Brand. You can learn more about locating your Brand ID by visiting the link provided here. | String | None | YOUR_BRAND_ID | Yes |
text | Provide 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. | String | None | Any String | Yes |
post_type | Specify 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 . | String | generic | generic , meme , quotes | No |
input_language | Choose the language for your input text field. | String | english | malay , chinese (traditional) , croatian , english , dutch , indonesian , vietnamese , portuguese_br , finnish , french , german , italian , norwegian , polish , romanian , czech , spanish , swedish , turkish , danish , hungarian | No |
output_language | Choose the language in which you want to generate the post. | String | english | malay , chinese (traditional) , croatian , english , dutch , indonesian , vietnamese , portuguese_br , finnish , french , german , italian , norwegian , polish , romanian , czech , spanish , swedish , turkish , danish , hungarian | No |
media_type | Provide 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. | String | single_image | single_image , carousel , video | No |
video_duration | Specify 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 . | String | short | short , long | No |
template_ids | Provide 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 |
author | Provide this information only when the type of post you want to generate is quotes . | String | None | Any String | No |
media_urls | Provide 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_type | Choose 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. | String | ai_suggested | brand , ai_suggested | No |
brand_details | Provide brand details to make sure AI generates content in the given brand details only. | Dictionary | None | Please check Example here | No |
headlines | Provide this input when you wish to override the AI-generated content in the generated images/videos. | List | None | Please check Example here | No |
Sample Success Response
{
"post_ids": [
"..."
],
"post_status": "inProgress",
"errors": [{"..."}]
}
Sample Error Response
{
"errors": [{
"detail": "...",
"solution": "..."
}]
}
Response Codes
HTTP Status Code | Error Code | User Message | Recommended solution |
---|---|---|---|
429 | 001 | Maximum number of requests reached | Maximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again |
400 | 002 | Invalid brand_id provided | You have provided an invalid brand_id . Please provide a valid brand_id and try again. Read more here |
400 | 003 | You have reached your post generation limit | You have exhausted the credits available in your plan. Please upgrade to a higher plan or wait until the limit resets |
400 | 004 | You already have 3 posts inProgress | Please wait until the posts in progress gets completed and then try again |
400 | 005 | Your request method is invalid | Please make a POST request and then try again |
400 | 006 | Your provided text is too small | The provided text should contain atleast 3 words and 20 characters for best results |
400 | 007 | The provided value for the media_type field is not valid | Make sure the value is one of single_image , carousel or video |
400 | 008 | The provided value for the input_language or output_language field is not valid | Make sure the passed value is supported. Please check the Request Parameters in the above table for more details |
400 | 009 | The provided value for the video_duration field is not valid | Make sure the value is either short or long |
400 | 010 | The provided value for the post_type field is not valid | Make sure the value is either generic , meme or quotes |
400 | 011 | The provided value for the post_type field is not valid for the given media_type | The 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