Mockly API
Schema
Reference for the chat render request body. Every field, every type.
Request body
The body of POST /api/v1/chat/render is a ChatExportPayload:
| Field | Type | Required | Description |
|---|---|---|---|
mockupType | "chats" | yes | Only "chats" is supported in v1. |
platform | string | yes | One of the supported platforms below. |
renderKind | "image" | "video" | yes | Output kind. |
resolutionScale | "1x" | "2x" | "4x" | yes | Resolution multiplier — "2x" is the typical default. |
rendererVersion | string | yes | Use "mockup-remotion-v1". |
props | object | yes | The conversation and appearance settings — see props. |
The schema validates strictly. Unknown top-level fields are rejected with 400 validation_failed.
props
props describes the conversation itself and how it should look:
| Field | Type | Default | Description |
|---|---|---|---|
platform | string | — | Must match the top-level platform. |
sender | User | — | The user whose messages render on the right (sender side). |
receivers | User[] | — | Other participants. One for direct, multiple for group. |
messages | Message[] | — | The conversation, in chronological order. |
conversationType | "direct-message" | "group-chat" | "direct-message" | |
groupChatSettings | { name: string, image?: string } | — | Required when conversationType: "group-chat". |
darkMode | boolean | false | Render in dark mode (where the platform supports it). |
mobileView | boolean | true | Render in mobile aspect ratio. |
showDeviceFrame | boolean | false | Wrap the mockup in a phone-frame. |
showDeviceStatus | boolean | true | Show the iOS/Android status bar at the top. |
showHeader | boolean | true | Show the platform's chat header. |
showFooter | boolean | true | Show the platform's input bar at the bottom. |
showReceiver | boolean | false | Force-show the receiver's name above messages even in DMs. |
showDates | boolean | true | Show date dividers between messages on different days. |
batteryLevel | number 0–100 | 100 | Battery indicator in the status bar. |
statusBarTime | string | "9:41" | Time displayed in the status bar. |
timeNotation | "12h" | "24h" | "24h" | Format for message timestamps. |
timezone | string (IANA, e.g. "Europe/Amsterdam") | — | Timezone for displaying message timestamps. |
transparentBackground | boolean | false | Render with a transparent background (PNG with alpha for images, WebM for video). |
customTheme | CustomTheme | — | Required when platform: "custom". |
Messages
messages is an array of ChatMessage:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique within the array. |
userId | string | yes | Must match sender.id or one of receivers[].id. |
type | "text" | "image" | "mixed" | yes | Content discriminator. |
timestamp | string (ISO 8601, e.g. "2026-04-30T10:15:00Z") | yes | UTC instant. |
text | string | depends | Required for "text" and "mixed". |
images | Image[] | depends | Required for "image" and "mixed". |
status | "sent" | "delivered" | "read" | no | Delivery state — only rendered on platforms that show one (e.g. WhatsApp ticks, iMessage "Read"). |
Examples:
{ "id": "m1", "type": "text", "userId": "u1", "text": "Hey!", "timestamp": "2026-04-30T10:15:00Z" }
{
"id": "m2",
"type": "image",
"userId": "u1",
"timestamp": "2026-04-30T10:16:00Z",
"images": [
{
"id": "i1",
"filename": "beach.jpg",
"data": "https://cdn.example.com/beach.jpg",
"mimeType": "image/jpeg",
"size": 245760
}
]
}
{
"id": "m3",
"type": "mixed",
"userId": "u1",
"text": "Look at this!",
"timestamp": "2026-04-30T10:17:00Z",
"images": [/* ... */],
"status": "read"
}
Images
ChatMessageImage:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique within the message. |
filename | string | yes | Display name; used as the download filename suffix. |
data | string | yes | Either an https:// URL or a base64 data URL (data:image/jpeg;base64,...). |
mimeType | string | yes | MIME of the image (e.g. "image/jpeg", "image/png"). |
size | number | yes | Size in bytes (informational; not enforced). |
caption | string | no | Caption shown below the image, where the platform supports it (Telegram, Discord). |
thumbnail | string | no | Smaller preview, same encoding as data. Falls back to data if omitted. |
Recommendation: prefer https:// URLs over data URLs. Data URLs balloon the request body and easily push past the 10 MB cap if you have multiple image messages.
Users
ChatUser:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique within the conversation; referenced by messages[].userId. |
name | string | yes | Display name. |
image | string | no | Avatar URL or data URL. |
Each conversation has exactly one sender and one or more receivers. The sender's messages render on the right side; receivers' messages render on the left.
Custom theme
When platform: "custom", supply a customTheme so the renderer knows how to color bubbles and the background:
| Field | Type | Required | Description |
|---|---|---|---|
backgroundColor | string (hex / CSS) | yes | Conversation background. |
backgroundImage | string (URL / data URL) | no | Optional background image; layered above backgroundColor. |
senderBubble | { background: string, foreground: string } | yes | Colors for the sender's message bubbles. |
receiverBubble | { background: string, foreground: string } | yes | Colors for receivers' bubbles. |
fontSize | "small" | "medium" | "large" | no (default "medium") | Body text size. |
customTheme is ignored for non-custom platforms — those use the platform's official colors.
Supported platforms
22 chat platforms. Use the slug (left column) as the value of platform and props.platform:
| Slug | App |
|---|---|
whatsapp | |
imessage | iMessage |
instagram | |
discord | Discord |
telegram | Telegram |
slack | Slack |
linkedin | |
microsoftTeams | Microsoft Teams |
messenger | Facebook Messenger |
snapchat | Snapchat |
x | X (Twitter) |
reddit | |
signal | Signal |
wechat | |
tinder | Tinder |
bumble | Bumble |
bluesky | Bluesky |
msn | MSN Messenger |
line | LINE |
tiktok | TikTok |
onlyfans | OnlyFans |
custom | Custom — bring your own colors via customTheme |