---
title: "Run a follow-up action on a completed Midjourney image"
method: POST
path: "/v2/images/midjourney/action"
tags: ["Images"]
---

# Run a follow-up action on a completed Midjourney image

`POST /v2/images/midjourney/action`

## Request

- Base URL: `https://api.apiframe.ai`
- URL: `https://api.apiframe.ai/v2/images/midjourney/action`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Runs a follow-up action on a completed `midjourney` job, referenced by its job ID. Grid actions — `upsample` (U1–U4) and `variation` (V1–V4) — act on a grid-producing parent; `index` selects which of the 4 images. Upsample actions — `inpaint` (Vary Region, base64 `mask` + optional `prompt`), `outpaint` (Zoom Out, `zoomRatio` 1.5 or 2), and `pan` (`direction` up/down/left/right) — act on a completed upsample job. Upsample returns a single image; every other action returns a fresh 4-image grid (which can itself be acted on). Returns 409 when the requested action is not available for the parent job.

## Headers

- `Idempotency-Key` string

## Request body

- union: Discriminated by `action`. Grid actions (`upsample`/`variation`) take an `index` (1–4) and act on a completed grid job; upsample actions (`inpaint`/`outpaint`/`pan`) act on a completed upsample job.
  - object
    - `action` 'upsample', required
    - `index` union, required
      - 1
      - 2
      - 3
      - 4
    - `parentJobId` string, uuid, required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
  - object
    - `action` 'variation', required
    - `index` union, required
      - 1
      - 2
      - 3
      - 4
    - `parentJobId` string, uuid, required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
  - object
    - `action` 'inpaint', required
    - `mask` string, required
    - `prompt` string
    - `parentJobId` string, uuid, required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
  - object
    - `action` 'outpaint', required
    - `zoomRatio` union, required
      - 1.5
      - 2
    - `parentJobId` string, uuid, required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]
  - object
    - `action` 'pan', required
    - `direction` 'up' | 'down' | 'left' | 'right', required
    - `parentJobId` string, uuid, required
    - `webhookUrl` string, uri
    - `webhookEvents` string[]

## Response `202`

Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.

- JobAccepted: Returned by every successful job submission.
  - `jobId` string, uuid, required
  - `status` 'QUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED', required: Status at the moment the job record was persisted. Almost always `QUEUED`; idempotent replays may return the original status.

## Other responses

- `400`: Request body failed validation.
- `401`: Authentication failed (missing / invalid API key).
- `402`: Team has insufficient credits to run this model.
- `403`: Authenticated but the API key is inactive or lacks permission.
- `429`: Rate limit exceeded. Retry after the `Retry-After` seconds.
- `503`: Service temporarily unavailable (queue / DB outage). Retry with backoff.

---

[API](https://skmtc.dev/apiframe/apis/apiframe-api.md) · [All operations](https://skmtc.dev/apiframe/apis/apiframe-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apiframe/apis/apiframe-api/revisions/ba1a4c26c86a?raw)
