---
title: "Uploads one image the html references by relative path (name, e.g. `images/hero.png`). The blob is content-addressed and tenant-wide; the node's image manifest gains or replaces the entry for that name. The editor rewrites the html's references to the returned url itself and then uploads the html through the route above — the server never parses it. Upload images one at a time: each call patches the node under its etag."
method: POST
path: "/api/simulations/{simulationId}/nodes/{nodeId}/code/images"
tags: ["CodeNode"]
---

# Uploads one image the html references by relative path (name, e.g. \`images/hero.png\`). The blob is content-addressed and tenant-wide; the node's image manifest gains or replaces the entry for that name. The editor rewrites the html's references to the returned url itself and then uploads the html through the route above — the server never parses it. Upload images one at a time: each call patches the node under its etag.

`POST /api/simulations/{simulationId}/nodes/{nodeId}/code/images`

## Request

- Base URL: `https://api.wearelearning.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.wearelearning.io/api/simulations/{simulationId}/nodes/{nodeId}/code/images`
- Auth: OAuth 2
  - Implicit: `https://login.wearelearning.io/authorize?audience=https://api.wearelearning.io`

## Path parameters

- `simulationId` string, uuid, required: A valid GUID
- `nodeId` string, uuid, required: A valid GUID

## Query parameters

- `name` string

## Request body `multipart/form-data`

- object
  - `file` string, binary

## Response `200`

OK

- CodeNodeDto
  - `nodeType` 'dialogue' | 'response' | 'poster' | 'event' | 'end' | 'open-response' | 'outcome' | 'no-match' | 'hotspot' | 'quiz' | 'page' | 'code', required
  - `id` string, required
  - `simulationId` string, required
  - `position` Position2dDto, required
    - `x` number, double, required
    - `y` number, double, required
  - `label` string, required
  - `htmlUrl` string, nullable
  - `fileName` string, nullable
  - `images` CodeNodeImageDto[], required
    - `name` string, required
    - `url` string, required
    - `contentType` string, required
    - `sizeBytes` integer, required
    - `mediaReferenceId` string, nullable
  - `continueButton` NodeContinueButtonDto
    - `text` string, required
    - `buttonColor` ColorValue, required
      - `value` string, required
    - `textColor` ColorValue, required
      - `value` string, required
  - `background` QuizBackgroundDto
    - `type` 'Hex' | 'Image' | 'Gradient', required
    - `value` string, nullable
    - `imageId` string, uuid, nullable: A valid GUID
    - `imageReference` MediaReferenceDto
      - `id` string, required
      - `fileName` string, required
      - `extension` string, required
      - `contentType` string, required
      - `url` string, required
      - `publicUrl` string, required
      - `thumbnailUrl` string, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `metadata` MetadataDto, required
        - `type` 'Image' | 'ImageVersion' | 'Video' | 'Audio' | 'Document', required
        - `size` integer, nullable
      - `folderId` string, uuid, nullable: A valid GUID
    - `imageTransformation` ImageTransformationDto
      - `imageTranslation` Position2dDto, required
        - `x` number, double, required
        - `y` number, double, required
      - `imageScale` ImageScaleDto, required
        - `x` number, double, required
        - `y` number, double, required
      - `rotation` number, double, required
      - `maskDimensions` MaskDimensionsDto, required
        - `width` number, double, required
        - `height` number, double, required
    - `fromHex` string, nullable
    - `toHex` string, nullable

---

[API](https://skmtc.dev/wearelearning/apis/we-are-learning-api.md) - [All operations](https://skmtc.dev/wearelearning/apis/we-are-learning-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wearelearning/apis/we-are-learning-api/revisions/e2ca5265db77?raw)
