Peach
  1. medias
Peach
  • messaging
    • Send a pre-approved template message
      POST
    • Poll template message status
      GET
    • Launch a broadcast
      POST
    • Poll broadcast status
      GET
    • Poll template messages status
      GET
    • Connect to AI Agent
      POST
    • Send an App message
      POST
  • whatsapp_templates
    • List all templates
      GET
    • Create a template
      POST
    • Update template
      PATCH
    • Archive template
      PATCH
    • Pause template
      PATCH
    • Submit template
      PATCH
  • conversations
    • Agent Assignment
      POST
    • Close Conversation
      POST
  • contacts
    • Create a contact
      POST
    • Update a contact
      PATCH
    • Create multiple contacts
      POST
  • orders
    • Create an order
      POST
    • Find order by ID
      GET
    • Create a refund for an order
      POST
  • medias
    • About uploaded media
    • List available medias
      GET
    • Add a media
      POST
    • Remove a media
      DELETE
  • webhooks
    • Order status webhooks
    • Flow execution status webhooks
    • Message delivery status webhooks
    • AI Agent Execution Webhooks
  • Schemas
    • Schemas
      • Order
      • RefundRequest
      • Contact
      • LineItem
      • OrderExpiry
      • TemplateMessage
      • AnyValue
      • Argument
  1. medias

About uploaded media

What is an uploaded media?#

Simply put, an uploaded media is just a media file that you upload to Peach.
You can then use a reference to the uploaded media to send messages to your contacts, using its media_url field.
Peach uses the media_url you supply to our APIs to look-up uploaded media files. If one is present with the specified media_url, it fetches the media from our servers, instead of yours.

Why use uploaded media over inline file URLs?#

Using uploaded media can help in the following ways:
it can help reduce network load on your media servers
your payload sizes reduce, which lead to reduced network costs
since Peach doesn't have to do a network call to fetch the media, it reduces the latency for sending messages

How to use uploaded media#

Once you upload a media file to Peach's servers using the add media API, you can use the uploaded file's media_url in subsequent API calls, for example, to send a pre-approved template message
.

An example#

Here's an example of how you can use an uploaded media to send out a pre-approved WhatsApp Template:
1.
Upload a media
Here's how the response may look like:
The media file can be base 64 encoded via any online utility or via code.
If you're using Bash, you can use the following script to verify if the encoded file data you're sending to the API is correct or not:
2.
Use the media_url from the response of the previous request to send a template message
Here's a sample response:

Things to note#

Meta's file size limits will still apply when sending out messages to your contacts, be it free-form or a template message.
Make sure you're not using an uploaded media that is too large, or which isn't supported by Meta.
Modified at 2025-11-18 09:51:57
Previous
Create a refund for an order
Next
List available medias
Built with