---
title: "Upload an image"
method: POST
path: "/api/v1/assets"
tags: ["Assets"]
---

# Upload an image

`POST /api/v1/assets`

## Request

- Base URL: `https://usewait.com`
- URL: `https://usewait.com/api/v1/assets`
- Auth: HTTP bearer

Send multipart/form-data with a `file` field, or JSON with base64 data. Maximum 5MB. Allowed: jpeg, png, gif, webp, svg. Returns the CDN url to use as ogImage or inside page code.

## Request body

- object
  - `data` string, required: Base64 encoded file contents.
  - `contentType` string, required
  - `fileName` string

## Response `200`

The uploaded asset.

- object
  - `url` string, uri

## Other responses

- `400`: Validation failed. `details` names the offending fields.
- `401`: Missing, malformed or revoked API key.
- `403`: The key is valid but lacks the scope this operation requires.
- `404`: No such resource, or it belongs to another account.
- `413`: File larger than 5MB.
- `429`: Rate limit exceeded (120 requests/minute per account).
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/usewait/apis/usewait-api.md) · [All operations](https://skmtc.dev/usewait/apis/usewait-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usewait/apis/usewait-api/revisions/d95e74897fbd?raw)
