Send Files to CRM: Receiving-System Integration

Modified on Thu, 15 Oct at 5:35 PM

Connect Mediabriz to your system so it can receive file submissions, download the files and save them against the correct customer or case.

Before you begin: complete General webhook requirements for connection security, shared fields, responses and duplicate prevention.

1. Understand the delivery

A SEND_FILES delivery contains file details and download links. Your system downloads the files separately. File contents and conversation messages are not included.

  • Files: 1 to 10 successfully prepared files, up to 15 MB (15,728,640 bytes) each.
  • Unavailable files: expired, oversized, unavailable or Guard-blocked files are omitted and reported to the agent. If none can be prepared, no delivery is sent.
  • Do not assume file order. File-sharing time, a separate media-type field and link-expiry timestamp are not supplied.
  • No order fields: items, requestedDeliveryDate, metadata.agentModifiedFields, purchaseOrderNumber and notes are absent.

2. Read the fields and identify the customer

The shared guide defines the envelope, agent, customer, queue and custom fields. These rules are specific to file deliveries:

FieldMeaning
action.typeAlways SEND_FILES.
customer.customerReferenceAlways present and null on real deliveries. Match using customer.externalContactId, customer.channelAddress or a configured customer/case custom field.
filesAlways present. Contains the prepared files described below.

Customer matching: on email, the name and address belong to the sender, or the recipient if your organization started the thread. Anonymous Web Messaging may have no address. WhatsApp may provide a business-scoped identifier instead of a phone number.

File information included in the delivery

Fields below are present; nullable values remain present as null. Within schema version 1, ignore additional fields you do not recognize.

FieldType and presenceMeaning
files[].mediaIdstring; alwaysGenesys Cloud media ID; unchanged when the same file is sent again.
files[].fileNamestring; alwaysName used as a label and download filename, up to 255 characters. Slashes, backslashes, double quotes and control characters are removed.
files[].contentTypestring; alwaysLowercase MIME type without parameters. Guard scan type when Guard is active; otherwise Genesys-served type. application/octet-stream when unknown.
files[].sizeBytesnumber or nullExact byte size, up to 15,728,640; null only for an empty file.
files[].sourceMessageIdstring or nullOriginating message ID; email message ID for email attachments. null if unavailable.
files[].senderPartystring or nullcustomer, agent or bot; null if unavailable.
files[].downloadUrlstring; alwaysPer-file secret download link, valid for 24 hours from preparation. US: https://api.mediabriz.com/prod/actions/files/<token>; EU: https://eu.api.mediabriz.com/prod/actions/files/<token>. Each attempt carries new links.

Generated filenames: unnamed files use their kind (image, audio, video, document or file), UTC sending date and minute, and MIME extension, for example image-2026-10-06-1120.jpg. Unknown extensions are omitted. Repeated generated names receive -2, -3, etc. Original names may repeat.

Example: one file

{
  "schemaVersion": 1,
  "eventId": "7d1f0c3a-2b4e-4c5d-9e8f-0a1b2c3d4e5f",
  "action": {
    "type": "SEND_FILES",
    "actionId": "act_8a1e2f3c",
    "label": "Save to CRM"
  },
  "organizationId": "your-genesys-org-guid",
  "conversationId": "c0ffee00-1111-2222-3333-444455556666",
  "metadata": {
    "agent": {
      "id": "agent-user-guid",
      "name": "Dana Levi",
      "email": "dana.levi@example.com"
    },
    "submittedAt": "2026-10-06T11:20:33.000Z",
    "source": "mediabriz-agent"
  },
  "customer": {
    "externalContactId": null,
    "name": "David Cohen",
    "channelType": "whatsapp",
    "channelAddress": "15551234567",
    "customerReference": null
  },
  "queue": {
    "id": "q-guid",
    "name": "Support"
  },
  "customFields": {
    "case_number": "CS-20931",
    "document_type": "invoice"
  },
  "files": [
    {
      "mediaId": "a1b2c3d4-0000-4000-8000-000000000001",
      "fileName": "invoice-0915.pdf",
      "contentType": "application/pdf",
      "sizeBytes": 184320,
      "sourceMessageId": "msg-guid-1",
      "senderParty": "customer",
      "downloadUrl": "https://api.mediabriz.com/prod/actions/files/<token>"
    }
  ]
}

Here, case_number is agent-entered and document_type is a Dropdown option key. Each file has its own secret download token.

3. Download and store the files

  1. Save the delivery details.
  2. Respond to Mediabriz within the configured timeout (3 to 20 seconds). Do not wait for the downloads.
  3. Download each file using HTTPS GET and its downloadUrl. Do not send an Authorization header, API key or cookies. The link itself gives access.
  4. Follow the 302 redirect immediately. The address in Location works for only 60 seconds. Do not save that address or send an Authorization header to it.
  5. Save the file in your system. The filename is included in Content-Disposition.

Note: 
- Download links expire 24 hours after file preparation.
- Keep download links private. Anyone with a valid link can download the file. Do not share full links or include them in logs. Each link gives access to one file in your organization.


If a download fails

ResponseWhat to do
404The link has expired, is invalid, or the file is no longer marked safe by Guard. Send the file again if it is still available in Genesys Cloud.
503Wait briefly, then try the download again.


Download example

curl -L -o invoice-0915.pdf "https://api.mediabriz.com/prod/actions/files/<token>"

4. Respond and handle retries

Send a response

Return 2xx with JSON: {"success":true,"referenceId":"CS-20931"}. Agents see Files sent and the reference returned by your system.

ResponseResult
2xx, success true or omittedAccepted; reference shown if supplied.
2xx, non-JSON bodyAccepted without a reference.
2xx, success falseFailed.
3xx, 4xx or 5xxFailed. Redirects are not followed; 4xx/5xx bodies are ignored.
Timeout or connection errorFailed, although your system may have processed it.

Limits: First 64 KB read; referenceId 200 characters; message 300.

On failure, the agent sees Your system did not accept the files or could not be reached. Try again.


Handle retries and repeated sends

Mediabriz does not retry automatically. Use eventId for agent retries and new sends:

CaseHow to handle it
Already accepted eventIdReturn success and the original reference. Do not save again. Continue unfinished downloads.
Retry without changesSame ID, new links. File preparation failures may reduce the file count, never increase it.
Changed files or custom fieldsNew ID. Treat separately; the earlier attempt may already have reached you.
New sendNew ID, even for previously sent files. For one copy per conversation, also check conversationId and mediaId.

5. Allow outbound downloads

If outbound traffic is restricted, allow HTTPS port 443 to both hosts for your region:

RegionDownload hostStorage host
USapi.mediabriz.com*.s3.us-east-1.amazonaws.com
EUeu.api.mediabriz.com*.s3.eu-west-1.amazonaws.com

6. Next step

Follow the next step in the setup guide. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article