Skip to main content
This endpoint is currently unavailable for 3rd-party use.
Checks are implemented to ensure that only requests from the CapeMaker frontend are allowed. This might change in the future.

Request

Example valid JSON object:
{
  "image": "<encoded content>",
  "color": "#ffffff",
  "inHouse": true,
  "mode": "base64"
}
image
String (Base64 encoded)
required
A Base64 encoded Portable Network Graphics (.png, image/png) image.
No header support
The API does not support the data:image/png;base64, parser header, and it must be removed if it exists.
Developement instance only - URL mode
On dev instances, you can also pass an HTTP(S) URL as the image, although this option is only available while using a special mode value in the JSON object. This way of obtaining an image was deprecated for security and performance reasons, and will fail on production deployments.
color
String
required
A hexadecimal, three byte color code including the # sign. Shorthand format (e.g. #AABBCC becomes #ABC) is also supported.
The optional 4th byte of the color code might work, but is not officially supported and no help will be provided.
inHouse
Boolean
An option that determines if the ugc flag should be added to the cape’s database entry.
The ugc flag does not (and should not in 3rd-party implementations) display on the frontend, and is only for internal use. It’s intended purpose is not currently implemented.
mode
String
default:"base64"
deprecated
An string that determines the mode that should be used when interpreting the image field.
Developement instance only
This option is ignored on production deployments.
To use URL mode, set this to URL_DEPRECATED. Otherwise, base64 will be used.

Processing

A sequence describing how the resulting image is constructed.

Validation

All fields are validated for type and content using multiple checks.

Obtaining the Image

Depending on the mode selected, the image is retrieved and parsed using the sharp JavaScript library.

Creating a template

A template is created using a pre-determined image resolution and a mask that applies the color in the cape’s texture shape. The CapeMaker logo is also added in this step.

Resizing and pasting the source image

The source image is resized to 320px x 512px and pasted exactly at the 32, 32 position from the top left in the newly generated template.

Uploading to the database

The ✨ brand new cape ✨ is uploaded to CapeMaker’s Pocketbase instance with it’s metadata.

Response

Success

Example valid JSON Response:
{
    "status": "OK",
    "details": {
        "collectionId": "j5l5kryypjnulpn",
        "collectionName": "capes",
        "color": "#ff80ff",
        "created": "2025-01-01 18:53:37.680Z",
        "flags": ["autocape", "resolution_HD", "ugc"],
        "id": "bxwtdymtmu6pp42",
        "image": "blob_QFenlwTPwm.png",
        "sourceImageURL": "",
        "state": 0,
        "updated": "2025-01-01 18:53:37.680Z"
    },
    "imageURL": "https://ellen.tanu.moe/api/files/j5l5kryypjnulpn/bxwtdymtmu6pp42/blob_QFenlwTPwm.png"
}
status
String
required
A string that determines if the action has succeeded or errored.
details
Cape Object
required
imageURL
URL (String)
An HTTP(S) URL that points to the cape’s texture.