Documentation
Button Actions

Button

POST
https://api.imaginepro.ai/api/v1/midjourney/button

The API simulates a button click on the Midjourney channel. A completed image will return an array of buttons which you can subsequently invoke on the image. These buttons are dynamic and a list of buttons you can press are included in every image completion.

We currently support all Midjourney buttons, and will keep updating the list as Midjourney add more features.

POST /api/v1/midjourney/button

Sample Request

{
  "messageId": "e57fb09d-25f0-49f7-8f0f-2e902ffe9fdd",
  "button": "V1"
}

Request Body

NameTypeRequired
messageIdstringtrue
buttonstringtrue
promptstringfalse
refstringfalse
webhookOverridestringfalse

messageId

Use the messageId returned from your previous generation process.

button

A Midjourney valid button action, could be any of the Midjourney actions, depends on the task, including Upscale (U1, U2, U3, U4), Variations (V1, V2,V3,V4), Reroll (🔄), Zoom (Zoom Out 2x, Zoom Out 1.5x), Vary (Vary (Strong), Vary (Subtle), Vary (Region)). Pan (⬅️, ➡️, ⬆️, ⬇️), Make Square (Make Square), Upscale (Upscale (2x), Upscale (4x), Redo Upscale (2x), Redo Upscale (4x),Upscale (Creative),Upscale (Subtle)), Cancel Job (Cancel Job). You need to make sure the value or the emoji is exactly the same as the allowed list, including the case.

prompt

This request field only works when you linked your own Discord account, and have remix mode enabled. you can use the prompt field to pass the variation prompt, with variation button actions (e.g. V1, V2, V3, V4, 🔄).

ref (optional)

You can optionally pass ref in your command - which can be used useful when using webhooks

webhookOverride (optional)

You can optionally pass webhookOverride that will route a response to a webhook of your choosing. Please note that using a webhook is completely optional. You are welcome to use the GET Message endpoint to retrieve responses. The webhook event payload is same as the Message endpoint response.

Sample Response

{
  "success": true,
  "messageId": "your-message-id",
  "createdAt": "2023-08-01T14:03:01.817Z"
}

Response Body

NameTypeDescription
successbooleana boolean value for the generation job creation status
messageIdstringthe messageId for querying the progress later
createdAtstringtimestamp of the task creation
errorstringerror message if any

Examples

const axios = require("axios")
 
const config = {
  method: "post",
  url: "https://api.imaginepro.ai/api/v1/midjourney/button",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <your-token>",
  },
  data: {
    messageId: "e57fb09d-25f0-49f7-8f0f-2e902ffe9fdd",
    button: "V1",
  },
}
 
axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data))
  })
  .catch(function (error) {
    console.log(error)
  })