Mattermix Docs
  • Welcome to Mattermix
  • API
    • Create API key
    • Authentication
    • Create image
    • Delete image
    • Template syntax
    • Set API limit
  • Integrations
    • Zapier
  • Subscription
    • Manage subscription
Powered by GitBook
On this page
  1. API

Create image

PreviousAuthenticationNextDelete image

Last updated 3 years ago

Before getting started: You will need to .

Create and return a new image URL

POST https://mtmx.io/v1/image

Headers

Name
Type
Description

Authorization*

String

Bearer YOUR-API-KEY

Request Body

Name
Type
Description

html*

String

The HTML you want to render for creating an image.

content

Object

type

String

Defines whether to render JPEG or PNG image. Accepted values are png and jpeg. Default value is png.

quality

Number

Defines the quality of JPG images. Not applicable to PNG images. Default value 80.

selector

String

Target a specific HTML element to perform the screenshot. Default value is body.

transparent

Boolean

Hides default white background and allows capturing screenshots with transparency. Default value is false.

{
    "success": true,
    "url": "https://cdn.mattermix.com/v1/image/62029ad452390ccfd9abcc4f-1644951564719.png"
    "id": "620bfdd2501f2b5c901e2800"
}
{
    "success": false,
    "statusCode": 401,
    "message": "Please provide a valid API key."
}
{
    "success": false,
    "statusCode": 402,
    "message": "Active subscription not found."
}
{
    "success": false,
    "statusCode": 500,
    "message": "Server error."
}
{
    "success": false,
    "statusCode": 429,
    "message": "You have reached your monthly export limit set in your account."
}

Updates values when using Handlebars templating syntax. .

create your API key
Learn more