---
title: "Host card media"
method: POST
path: "/media/upload"
tags: ["Surveys"]
---

# Host card media

`POST /media/upload`

## Request

- Base URL: `https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent`
- URL: `https://rcs-templates-api-dot-msg2ai-server.ue.r.appspot.com/api/agent/media/upload`
- Auth: HTTP bearer

Host an image or video for use as rich-card media.

## Request body

- object
  - `base64` string: Raw base64 or data: URL of the image bytes.
  - `mime` string: Image MIME type (required with base64), e.g. image/png.
  - `filename` string
  - `sourceUrl` string: https image URL to fetch and re-host onto GCS.

## Response `200`

Success.

- object

## Other responses

- `400`: Arguments failed validation.
- `401`: Missing or invalid agent key.
- `403`: Key does not hold the surveys:write scope.
- `429`: Rate limited.

---

[API](https://skmtc.dev/rcs-campaigns/apis/rcs-campaigns-agent-gateway.md) · [All operations](https://skmtc.dev/rcs-campaigns/apis/rcs-campaigns-agent-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/rcs-campaigns/apis/rcs-campaigns-agent-gateway/revisions/acdbf292d9d6?raw)
