# stensul-upload-images

> Uploads up to five images from public URLs to a draft (or to Studio for module backgrounds), or searches the gallery.

Source: https://stensul.com/developers/reference/stensul-upload-images/ · From the live server's tool list, 2026-09-28

- Scope: `images:write`
- Access: write

PNG, JPG, JPEG or GIF; up to 5 URLs per request and 3.5 MB per image. Gallery search also needs `dam:read`. For local or pasted files there is no URL; use `stensul-image-upload-session`.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `urls` | string[] (≤5) | no | Public http(s) image URLs ending in .png, .jpg, .jpeg or .gif. |
| `email_id` | string (24-char hex id) | no | Required when `target` is `email` and `urls` are passed. |
| `target` | "email" \| "studio" | no | `email` (default) or `studio` for a module background image. |
| `gallery_search` | string | no | Search the gallery by image name instead of uploading. Empty string browses everything. |
| `page_number` | integer ≥ 1 | no | Gallery search only. |
| `page_size` | integer 1–30 | no | Gallery search only. |

## Example request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stensul-upload-images",
    "arguments": {
      "email_id": "64f0c0ffee0000000000abcd",
      "urls": [
        "https://northwind.example/img/autumn-hero.jpg"
      ]
    }
  }
}
```

## Response

Server-generated filenames to place with `stensul-update-email-content`, or `files[].path` for a Studio upload.

## Errors

| Status | Message | Cause | Fix |
| --- | --- | --- | --- |
| 401 | Authentication expired or missing | The session's authorization expired. | Sign in again when the host prompts. On a 401 or 403, the server's instructions tell the model to re-check sign-in first. |
| 403 | Insufficient OAuth scope (403): The token lacks the required scope | The API connection doesn't have the scope this tool needs. | An admin adds the scope to the API connection. Then sign in again: adding a scope revokes existing tokens. |
| 403 | API error (403): Action is unauthorized. | The signed-in user's role lacks the permission, for example `edit_campaign`. | Grant the permission to the user's role in Admin > Users & Roles. It works for other users on the same connection. |
