---
title: "Upload an ad image from base64"
method: POST
path: "/v1/ads/images"
tags: ["Ad Creatives"]
---

# Upload an ad image from base64

`POST /v1/ads/images`

Uploads raw image bytes to the Meta ad account's image library — for callers whose
creatives aren't hosted at a public URL. Returns the image `hash` (Meta's identifier for
the asset) and the Meta-hosted `url`, which can be used directly as `imageUrl` on the
create endpoints. Max 30 MB decoded.

## Request body

- object
  - `accountId` string, required — Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
  - `adAccountId` string, required — Meta ad account id (act_<n>).
  - `imageBase64` string, required — Raw base64 image bytes, or a full data URL (the data:image/...;base64, prefix is stripped).
  - `filename` string — Optional filename shown in Meta's image library. Defaults to ad_image.jpg.

## Response `201`

Image uploaded

- object
  - `adAccountId` string
  - `image` object
    - `hash` string — Meta image hash, reusable wherever image_hash is accepted.
    - `url` string — Meta-hosted image URL; usable as imageUrl on the create endpoints.

## Other responses

- `400` — Invalid input, or Meta rejected the image
- `401` — Unauthorized
- `501` — Only supported on Meta (facebook/instagram)

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/51932b099b2f/schema)
