Start Free — No Credit Card Required · IntelliReply AI now replies in Arabic and EnglishSee plans →

Templates, media and key check

List your message templates, download media files from chats, and check that an API key works.

List templates#

GEThttps://app.zapgen.ae/api/templates

Returns the message templates in your organization, paginated. Use it to find a template's exact name and language before you send it.

NameTypeRequiredDescription
pageintegerNoPage number, from 1.
per_pageintegerNoTemplates per page, 1–100. Default 10.
curl "https://app.zapgen.ae/api/templates?per_page=100" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Response
{
  "data": [
    {
      "uuid": "7c2e9f41-0b6d-4a3e-8f15-6d9a2c4b1e07",
      "name": "order_ready",
      "metadata": "{\"name\":\"order_ready\",\"language\":\"en_US\",\"status\":\"APPROVED\",\"category\":\"UTILITY\",\"components\":[{\"type\":\"BODY\",\"text\":\"Hi, your order {{1}} is ready for pickup.\"}],\"id\":\"1234567890123456\"}",
      "updated_at": "03 Oct 2026 6:20 PM"
    }
  ],
  "links": { "first": "…", "last": "…", "prev": null, "next": null },
  "meta": { "current_page": 1, "last_page": 1, "per_page": 100, "total": 1 }
}

Each template has just four fields:

FieldDescription
uuidThe template's ID in ZAPGEN.
nameThe template name to use when sending.
metadataA JSON string with the template as Meta describes it: language, category, components (header, body, footer, buttons) and, once synced with Meta, status. Parse it before use.
updated_atWhen the template last changed, formatted for display.

The list includes templates in every status. Before sending, check status in metadata is APPROVED. If status is missing, click Sync templates in the app to refresh your templates from Meta. Status, category and language aren't separate fields yet.

Tip

For a ready-made request body, use Copy API payload on the Templates page in the app. See Send a template.

Creating templates through the API isn't available yet. Create them in the app: see Create a template.

Download chat media#

GEThttps://app.zapgen.ae/api/chat-media/{id}

Downloads a photo, video, voice note or document from a chat in your organization. id is ZAPGEN's numeric media ID.

You'll find media IDs in:

  • the media_id of the chat in a send response or a message.sent webhook for media you sent;
  • the file link that a Flow Builder webhook step includes after a "Wait for attachment" step. That link already points to this endpoint.
curl https://app.zapgen.ae/api/chat-media/18342 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -L -o attachment

The response is the file itself, with its type in Content-Type and its name in Content-Disposition. Some older files answer with a redirect to the file's address instead, so let your HTTP client follow redirects.

StatusBodyMeaning
200The fileHere's the file.
302The file lives at another address. Follow the redirect.
404{"error": "Media not found"}No media with that ID in your organization.
410{"error": "Media expired"}The file was deleted. Chat media is kept for 30 days.
Media is kept for 30 days

ZAPGEN deletes chat media files 30 days after they arrive or are sent. Download anything you need to keep.

Check an API key#

GEThttps://app.zapgen.ae/api/verify

Confirms that a key is valid and your subscription is active. It has no parameters, and it's a good first call when you set up an integration.

curl https://app.zapgen.ae/api/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Response
{
  "statusCode": 200,
  "message": "API key is valid and active"
}
Statusmessage
200API key is valid and active
401Unauthorized. Invalid Bearer Token. (or Bearer Token is missing.)
403API key is inactive. Please renew or subscribe to a plan to continue!
Still stuck?Our team answers on WhatsApp and at [email protected].
Ask us on WhatsApp