Nordic Layers · Nordic Byte

API documentation

Nordic Layers is a REST API over HTTPS at https://app.layers.nordicbyte.co.uk. A project is a JSON document of layers; you change it with operations and export it as an image. The browser editor uses the same API.

Authentication

Create an API key in your account panel and send it on every /v1 request. Keys start with nl_key_.

Authorization: Bearer nl_key_…

The usual flow

  1. Upload each image with POST /v1/assets and the file as the raw request body (PNG, JPEG, WebP, GIF, BMP or TIFF). The answer carries its id.
  2. Create a project with POST /v1/projects and a width, height and background. You can pass the first steps in the same call.
  3. Edit it with POST /v1/projects/{id}/run: one operation as {"op": …} or several as {"steps": [...]}. Look at it with GET /v1/projects/{id}/preview, which is free.
  4. Export with POST /v1/projects/{id}/export. The answer has the file URL, or the image itself with "response": "image".

A first request

Create a 1080×1080 project with a gradient and a title, then export it as WebP:

curl -X POST https://app.layers.nordicbyte.co.uk/v1/projects \
  -H "Authorization: Bearer $NL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "First post",
    "width": 1080,
    "height": 1080,
    "steps": [
      {"op": "layer.addFill", "gradient": {"colors": ["#1E3A5F", "#64B5F6"], "angle": 135}},
      {"op": "text.add", "content": "Hello, layers", "fontName": "Segoe UI", "fontSize": 110, "bold": true, "color": "#FFFFFF"},
      {"op": "effects.set", "shadow": {"opacity": 0.4, "distance": 12, "size": 24}}
    ]
  }'

# → {"project": {"id": "…", …}}

curl -X POST https://app.layers.nordicbyte.co.uk/v1/projects/$PROJECT_ID/export \
  -H "Authorization: Bearer $NL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "webp",
    "quality": 90
  }'

Endpoints

MethodPathWhat it does
GET/healthService status
GET/v1/opsCatalogue of every operation and its parameters (public)
POST/v1/assets?name=photo.jpgUpload an image; the body is the file
GET/v1/assetsList your images and whether a project uses them
DELETE/v1/assets/{id}Delete an image
POST/v1/projectsCreate a project (canvas, or a whole document, plus optional steps)
GET/v1/projectsList your projects
GET/v1/projects/{id}One project with its document
PUT/v1/projects/{id}/documentReplace the whole document
POST/v1/projects/{id}/runApply one operation or a list of steps
POST/v1/projects/{id}/undoUndo the last change
POST/v1/projects/{id}/redoRedo
GET/v1/projects/{id}/preview?size=1024Free PNG preview, long side up to size px
POST/v1/projects/{id}/exportExport PNG, JPEG or WebP; optional steps for this file only
POST/v1/renderStateless render of a whole document
GET/v1/exportsList your exports
GET/v1/exports/{id}/fileDownload an export
DELETE/v1/projects/{id}Delete a project

Operations

Every operation is an object with op and its parameters. Layers are referenced by id or by name; without layer, the active layer is used. Names ignore case and spaces, so "Linear Dodge (Add)" and "linearDodge" are the same blend mode. With steps, they run in order and stop at the first error (unless "stopOnError": false); the steps before it stay applied.

Layers

OperationParametersWhat it does
layer.addcolor, nameAlias of layer.addFill (the web has no empty pixel layers).
layer.addFillcolor | gradient {colors: [..], angle, type: linear|radial}, name, above, atBottomA colour or gradient layer the size of the canvas.
layer.addImageasset_id | color, name, rect | origin | center, width, height, fit (stretch|contain|cover), fitCanvas (contain|cover), above, atBottom, opacity, blendModeAdd an uploaded image (asset_id) or a solid colour (color).
layer.cliplayerClip a layer to the one below it (clipping mask).
layer.deletelayer | layersDelete layers.
layer.duplicatelayer, nameCopy a layer above itself.
layer.getlayerOne layer with all its settings.
layer.list—Layers from bottom to top.
layer.movelayer, above | below (layer), toTop, atBottom, index, offsetReorder a layer.
layer.renamelayer, nameRename a layer.
layer.selectlayerMake a layer the active one.
layer.setBlendModelayer | layers, blendMode (normal, darken, multiply, colorBurn, linearBurn, lighten, screen, colorDodge, linearDodge, overlay, softLight, hardLight, difference, exclusion, subtract, divide, hue, saturation, color, luminosity)Blend mode.
layer.setFilllayer, color | gradientChange a fill layer's colour or gradient.
layer.setImagelayer, asset_id, fit (stretch|contain|cover)Replace a layer's image and keep its box (templates).
layer.setOpacitylayer | layers, opacityLayer opacity, 0 to 1.
layer.setVisiblelayer | layers, visibleShow or hide layers.
layer.uncliplayerRelease a clipping mask.

Text

OperationParametersWhat it does
text.addcontent, fontName, fontSize, color, alignment, leading, bold, italic, boxWidth, origin | center, nameAdd a text layer.
text.defaults—Fonts on the server and whether complex scripts are shaped.
text.setlayer, content, fontName, fontSize, color, alignment, leading, bold, italic, boxWidthChange a text layer.

Shapes

OperationParametersWhat it does
shape.addshape, rect | from+to, color, cornerRadius, lineWidth, nameAdd a rectangle, ellipse or line.
shape.setlayer, color, cornerRadius, lineWidthChange a shape layer.

Transform

OperationParametersWhat it does
transform.fliplayer | layers, axis (horizontal|vertical)Flip horizontally or vertically.
transform.movelayer | layers, dx, dy | to [x, y]Move by dx/dy or to a point.
transform.rotatelayer | layers, angleRotate by an angle (degrees, clockwise).
transform.scalelayer | layers, factor | percent | width | heightScale around each layer's centre.
transform.setlayer | layers, x, y, width, height, rotation, flipX, flipYBox, rotation and flips.

Adjustments on a layer

OperationParametersWhat it does
adjust.blackWhitelayer | layers, reds, yellows, greens, cyans, blues, magentas, tint, tintHue, tintSaturationNon-destructive blackWhite on a layer (adds it or updates it).
adjust.brightnessContrastlayer | layers, brightness, contrastNon-destructive brightnessContrast on a layer (adds it or updates it).
adjust.clearlayer | layersRemove every adjustment and filter from a layer.
adjust.colorBalancelayer | layers, shadows, midtones, highlights, preserveLuminosityNon-destructive colorBalance on a layer (adds it or updates it).
adjust.curveslayer | layers, rgb, red, green, blueNon-destructive curves on a layer (adds it or updates it).
adjust.exposurelayer | layers, exposure, offset, gammaNon-destructive exposure on a layer (adds it or updates it).
adjust.gradientMaplayer | layers, shadows, highlights, reversedNon-destructive gradientMap on a layer (adds it or updates it).
adjust.grainlayer | layers, amount, size, seedNon-destructive grain on a layer (adds it or updates it).
adjust.hueSaturationlayer | layers, hue, saturation, lightness, colorizeNon-destructive hueSaturation on a layer (adds it or updates it).
adjust.invertlayer | layers, no settingsNon-destructive invert on a layer (adds it or updates it).
adjust.levelslayer | layers, black, white, gamma, outputBlack, outputWhiteNon-destructive levels on a layer (adds it or updates it).
adjust.removelayer | layers, kindRemove one adjustment or filter from a layer.

Filters

OperationParametersWhat it does
filter.addNoiselayer | layers, amount, gaussian, monochromatic, seedNon-destructive addNoise on a layer (adds it or updates it).
filter.gaussianBlurlayer | layers, radiusNon-destructive gaussianBlur on a layer (adds it or updates it).
filter.motionBlurlayer | layers, angle, distanceNon-destructive motionBlur on a layer (adds it or updates it).
filter.pixelatelayer | layers, sizeNon-destructive pixelate on a layer (adds it or updates it).
filter.sharpenlayer | layers, amount, radius, thresholdNon-destructive sharpen on a layer (adds it or updates it).
filter.vignettelayer | layers, amount, midpoint, roundness, feather, colorNon-destructive vignette on a layer (adds it or updates it).

Adjustment layers

OperationParametersWhat it does
adjustmentLayer.addkind, settings…, name, aboveAn adjustment layer: changes everything below it.
adjustmentLayer.getlayerAn adjustment layer's settings.
adjustmentLayer.setlayer, settings…Change an adjustment layer (partial).

Layer masks

OperationParametersWhat it does
mask.addlayer, reveal | hide | rect | ellipse (rect) | gradient (from, to) | asset_id (+ rect), feather, invert, cornerRadiusAdd or replace a layer mask.
mask.blurlayer, radiusFeather the layer mask.
mask.deletelayerRemove the layer mask.
mask.invertlayerInvert the layer mask.
mask.setEnabledlayer, enabledTurn the layer mask on or off.

Layer effects

OperationParametersWhat it does
effects.copyfrom, layer | layersCopy effects from one layer to others.
effects.getlayerA layer's effects.
effects.removelayer | layers, kindsRemove effects (all, or the ones named).
effects.setlayer | layers, shadow {…}, stroke {…}, outerGlow {…}, colorOverlay {…}Set effects (partial): shadow, outerGlow, stroke, colorOverlay.
effects.setEnabledlayer, kind, enabledTurn one effect on or off.

Canvas

OperationParametersWhat it does
canvas.croprect [x, y, width, height]Crop the canvas to a rectangle.
canvas.imageSizewidth and/or height, or percentScale the whole document.
canvas.setBackgroundcolorBackground colour, or null for transparent.
canvas.sizewidth, height, anchor (topLeft…bottomRight, default center)Change the canvas without scaling layers.

Project

OperationParametersWhat it does
project.state—The whole document.

Blend modes

Font families

Templates

Pass steps to the export call and they are applied to a copy of the project for that file only. One template, many files: change the text with text.set and the photo with layer.setImage, which keeps the layer's box.

curl -X POST https://app.layers.nordicbyte.co.uk/v1/projects/$TEMPLATE_ID/export \
  -H "Authorization: Bearer $NL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "png",
    "steps": [
      {"op": "text.set", "layer": "Title", "content": "Nueva colección"},
      {"op": "layer.setImage", "layer": "Photo", "asset_id": "photo_dunes"}
    ]
  }'

Stateless render

POST /v1/render takes a whole document (as returned in project.document), optional steps and the export options, and does not save a project. With "response": "image" the answer is the image file.

curl -X POST https://app.layers.nordicbyte.co.uk/v1/render \
  -H "Authorization: Bearer $NL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document": {"width": 1200, "height": 630, "background": "#1E3A5F", "layers": ["…"]},
    "format": "png",
    "response": "image"
  }' \
  -o card.png

Errors

Errors come back as JSON with a stable code and a detail message in your account's language. A failing step reports which parameter was wrong. When a plan's renders are used up the API answers 402 with quota_renders.

Limits