Method: GET
URL: https://api.trypopcorn.ai/template/

Headers

  • POPCORN-API-KEY (string, required) - API key provided by the Popcorn team.

Example Request

GET https://api.trypopcorn.ai/template/
POPCORN-API-KEY: your_popcorn_api_key

Example Response

{
  "success": true,
  "data": {
    "templates": [
      {
        "id": "12345",
        "metaTemplateName": "Welcome Template",
        "metaTemplateCategory": "Greeting",
        "metaTemplateType": "Text",
        "metaTemplateLanguage": "EN",
        "metaTemplateComponents": ["text"],
        "metaTemplateMetaId": "meta_12345",
        "metaTemplateMetaStatus": "active",
        "createdAt": "2023-10-10T10:00:00Z",
        "updatedAt": "2023-10-10T10:00:00Z"
      }
    ],
    "count": 1
  }
}

If there’s an error, the response may look like:

{
  "success": false,
  "error": "Failed to fetch templates",
  "details": "Database connection error"
}

Errors

  • 500 - Internal server error, failed to fetch templates.