Get a List of All Templates
The endpoint is used to get a list of all system templates including Video, Carousel, Image, Quotes and Memes templates. This is a paginated endpoint and hence you will receive a paginated response.
Request URL
- GET https://brain.predis.ai/predis_api/v1/get_templates/
Request Parameters
| Name | Description | Type | Default Value | Possible Values | Required |
|---|---|---|---|---|---|
brand_id | The brand_id serves as the unique identifier for your brand. Using the brand_id, you will also have access to your custom templates on the first page. | String | None | YOUR_BRAND_ID | Yes |
media_type | To obtain templates of a specific media type. | String | single_image | single_image, carousel, video | No |
post_type | To obtain templates of a specific type of post. For meme and quotes post media_type should be single_image. | String | generic | generic, meme, quotes | No |
aspect_ratio | To obtain templates of a specific aspect ratio. | String | all | square, portrait, landscape, all | No |
page_n | Indicate the page number to retrieve templates from that particular page. | Integer | 1 | 1, 2, 3...etc | No |
items_n | Indicate the desired number of templates for each page. | Integer | 10 | 1, 2, 3...etc | No |
Sample Success Response
{
"templates": [{
"template_id": "...",
"media_type": "..."
}],
"total_pages": 50,
"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 | Page numbers of Items number is invalid | Make sure the value of page_n and items_n is integer |
| 400 | 004 | Provided aspect_ratio is not supported | Make sure the value of aspect_ratio field is supported. Please check the Request Parameters in the above table for more details |
| 400 | 005 | The provided value for the media_type field is not valid | Make sure the value is one of single_image, carousel or video |
| 400 | 006 | The provided value for the video_duration field is not valid | Make sure the value is either short or long |
| 400 | 007 | The provided value for the post_type field is not valid | Make sure the value is either generic, meme or quotes |
| 400 | 008 | 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